Search in sources :

Example 1 with CQLProgrammaticConfigurationLoaderBuilder

use of org.janusgraph.diskstorage.cql.builder.CQLProgrammaticConfigurationLoaderBuilder in project janusgraph by JanusGraph.

the class CQLConfigTest method defaultProgrammaticConfigurationShouldUseJanusGraphDefaultRequestTimeout.

@Test
public void defaultProgrammaticConfigurationShouldUseJanusGraphDefaultRequestTimeout() {
    // Create a CQLProgrammaticConfigurationLoaderBuilder from default values
    Configuration config = new ModifiableConfiguration(ROOT_NS, getConfiguration(), BasicConfiguration.Restriction.NONE);
    CQLProgrammaticConfigurationLoaderBuilder builder = new CQLProgrammaticConfigurationLoaderBuilder();
    // DriverConfigLoader should use CQLConfigOptions.REQUEST_TIMEOUT default value and not DataStax default value of 2s
    DriverConfigLoader loader = builder.build(config, Collections.emptyList(), Duration.of(1, ChronoUnit.SECONDS));
    Duration requestTimeout = loader.getInitialConfig().getDefaultProfile().getDuration(DefaultDriverOption.REQUEST_TIMEOUT);
    assertEquals(Duration.of(REQUEST_TIMEOUT.getDefaultValue(), ChronoUnit.MILLIS), requestTimeout);
}
Also used : WriteConfiguration(org.janusgraph.diskstorage.configuration.WriteConfiguration) BasicConfiguration(org.janusgraph.diskstorage.configuration.BasicConfiguration) Configuration(org.janusgraph.diskstorage.configuration.Configuration) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) CQLProgrammaticConfigurationLoaderBuilder(org.janusgraph.diskstorage.cql.builder.CQLProgrammaticConfigurationLoaderBuilder) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) DriverConfigLoader(com.datastax.oss.driver.api.core.config.DriverConfigLoader) Duration(java.time.Duration) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

DriverConfigLoader (com.datastax.oss.driver.api.core.config.DriverConfigLoader)1 Duration (java.time.Duration)1 BasicConfiguration (org.janusgraph.diskstorage.configuration.BasicConfiguration)1 Configuration (org.janusgraph.diskstorage.configuration.Configuration)1 ModifiableConfiguration (org.janusgraph.diskstorage.configuration.ModifiableConfiguration)1 WriteConfiguration (org.janusgraph.diskstorage.configuration.WriteConfiguration)1 CQLProgrammaticConfigurationLoaderBuilder (org.janusgraph.diskstorage.cql.builder.CQLProgrammaticConfigurationLoaderBuilder)1 GraphDatabaseConfiguration (org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1