Search in sources :

Example 1 with RocksDBFactoryConfiguration

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);
}
Also used : CommandLine(picocli.CommandLine) RocksDBFactoryConfiguration(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration) RocksDBCLIOptions(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions) Test(org.junit.Test)

Example 2 with RocksDBFactoryConfiguration

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);
}
Also used : CommandLine(picocli.CommandLine) RocksDBFactoryConfiguration(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration) RocksDBCLIOptions(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions) Test(org.junit.Test)

Example 3 with RocksDBFactoryConfiguration

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);
}
Also used : CommandLine(picocli.CommandLine) RocksDBFactoryConfiguration(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration) RocksDBCLIOptions(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions) Test(org.junit.Test)

Example 4 with RocksDBFactoryConfiguration

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);
}
Also used : CommandLine(picocli.CommandLine) RocksDBFactoryConfiguration(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration) RocksDBCLIOptions(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions) Test(org.junit.Test)

Example 5 with RocksDBFactoryConfiguration

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);
}
Also used : CommandLine(picocli.CommandLine) RocksDBFactoryConfiguration(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration) RocksDBCLIOptions(org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions) Test(org.junit.Test)

Aggregations

RocksDBCLIOptions (org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions)5 RocksDBFactoryConfiguration (org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBFactoryConfiguration)5 Test (org.junit.Test)5 CommandLine (picocli.CommandLine)5