use of org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration in project besu by hyperledger.
the class RocksDBCLIOptionsTest method customMaxBackgroundCompactions.
@Test
public void customMaxBackgroundCompactions() {
final RocksDBCLIOptions options = RocksDBCLIOptions.create();
final int expectedMaxBackgroundCompactions = 223344;
new CommandLine(options).parse(MAX_BACKGROUND_COMPACTIONS_FLAG, "" + expectedMaxBackgroundCompactions);
final RocksDBFactoryConfiguration configuration = options.toDomainObject();
assertThat(configuration).isNotNull();
assertThat(configuration.getBackgroundThreadCount()).isEqualTo(DEFAULT_BACKGROUND_THREAD_COUNT);
assertThat(configuration.getCacheCapacity()).isEqualTo(DEFAULT_CACHE_CAPACITY);
assertThat(configuration.getMaxBackgroundCompactions()).isEqualTo(expectedMaxBackgroundCompactions);
assertThat(configuration.getMaxOpenFiles()).isEqualTo(DEFAULT_MAX_OPEN_FILES);
}
use of org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration in project besu by hyperledger.
the class RocksDBCLIOptionsTest method defaultValues.
@Test
public void defaultValues() {
final RocksDBCLIOptions options = RocksDBCLIOptions.create();
new CommandLine(options).parse();
final RocksDBFactoryConfiguration configuration = options.toDomainObject();
assertThat(configuration).isNotNull();
assertThat(configuration.getBackgroundThreadCount()).isEqualTo(DEFAULT_BACKGROUND_THREAD_COUNT);
assertThat(configuration.getCacheCapacity()).isEqualTo(DEFAULT_CACHE_CAPACITY);
assertThat(configuration.getMaxBackgroundCompactions()).isEqualTo(DEFAULT_MAX_BACKGROUND_COMPACTIONS);
assertThat(configuration.getMaxOpenFiles()).isEqualTo(DEFAULT_MAX_OPEN_FILES);
}
use of org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration in project besu by hyperledger.
the class RocksDBCLIOptionsTest method customMaxOpenFiles.
@Test
public void customMaxOpenFiles() {
final RocksDBCLIOptions options = RocksDBCLIOptions.create();
final int expectedMaxOpenFiles = 65;
new CommandLine(options).parse(MAX_OPEN_FILES_FLAG, "" + expectedMaxOpenFiles);
final RocksDBFactoryConfiguration configuration = options.toDomainObject();
assertThat(configuration).isNotNull();
assertThat(configuration.getBackgroundThreadCount()).isEqualTo(DEFAULT_BACKGROUND_THREAD_COUNT);
assertThat(configuration.getCacheCapacity()).isEqualTo(DEFAULT_CACHE_CAPACITY);
assertThat(configuration.getMaxBackgroundCompactions()).isEqualTo(DEFAULT_MAX_BACKGROUND_COMPACTIONS);
assertThat(configuration.getMaxOpenFiles()).isEqualTo(expectedMaxOpenFiles);
}
use of org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration in project besu by hyperledger.
the class RocksDBCLIOptionsTest method customBackgroundThreadCount.
@Test
public void customBackgroundThreadCount() {
final RocksDBCLIOptions options = RocksDBCLIOptions.create();
final int expectedBackgroundThreadCount = 99;
new CommandLine(options).parse(BACKGROUND_THREAD_COUNT_FLAG, "" + expectedBackgroundThreadCount);
final RocksDBFactoryConfiguration configuration = options.toDomainObject();
assertThat(configuration).isNotNull();
assertThat(configuration.getBackgroundThreadCount()).isEqualTo(expectedBackgroundThreadCount);
assertThat(configuration.getCacheCapacity()).isEqualTo(DEFAULT_CACHE_CAPACITY);
assertThat(configuration.getMaxBackgroundCompactions()).isEqualTo(DEFAULT_MAX_BACKGROUND_COMPACTIONS);
assertThat(configuration.getMaxOpenFiles()).isEqualTo(DEFAULT_MAX_OPEN_FILES);
}
use of org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration in project besu by hyperledger.
the class RocksDBCLIOptionsTest method customCacheCapacity.
@Test
public void customCacheCapacity() {
final RocksDBCLIOptions options = RocksDBCLIOptions.create();
final long expectedCacheCapacity = 400050006000L;
new CommandLine(options).parse(CACHE_CAPACITY_FLAG, "" + expectedCacheCapacity);
final RocksDBFactoryConfiguration configuration = options.toDomainObject();
assertThat(configuration).isNotNull();
assertThat(configuration.getBackgroundThreadCount()).isEqualTo(DEFAULT_BACKGROUND_THREAD_COUNT);
assertThat(configuration.getCacheCapacity()).isEqualTo(expectedCacheCapacity);
assertThat(configuration.getMaxBackgroundCompactions()).isEqualTo(DEFAULT_MAX_BACKGROUND_COMPACTIONS);
assertThat(configuration.getMaxOpenFiles()).isEqualTo(DEFAULT_MAX_OPEN_FILES);
}
Aggregations