Skip to content

Commit

Permalink
Add config for gcIntervalInMinutes (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhan1 authored Jun 26, 2024
1 parent 8b9eb65 commit a44f124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public interface StorageServiceConfig
@WithDefault("100")
int gcBatchSize();

// value <= 0 disables gc effectively
@WithName( "gcIntervalInMinutes" )
@WithDefault("60")
int gcIntervalInMinutes();

@WithName( "type" )
@WithDefault( STORAGE_NFS )
String type();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
@ApplicationScoped
public class FileManagerProducer
{
private static final int STORAGE_GC_BATCH_SIZE = 100;

@Inject
CassandraConfig cassandraConfig;

Expand All @@ -59,9 +57,9 @@ public PathMappedFileManager getFileManager()
props.put( PROP_CASSANDRA_PASS, cassandraConfig.pass() );

DefaultPathMappedStorageConfig config = new DefaultPathMappedStorageConfig( props );
config.setGcBatchSize( STORAGE_GC_BATCH_SIZE );
config.setPhysicalFileExistenceCheckEnabled( storageConfig.physicalFileExistenceCheck() );
config.setGcBatchSize( storageConfig.gcBatchSize() );
config.setGcIntervalInMinutes( storageConfig.gcIntervalInMinutes() );

PathDB pathDB = new CassandraPathDB( config );
PhysicalStore physicalStore;
Expand Down

0 comments on commit a44f124

Please sign in to comment.