use of org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendFixedThreadPoolSize.
@Test
public void shouldCreateCustomBackendFixedThreadPoolSize() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CORE_POOL_SIZE.toStringWithoutRoot(), 15);
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendExecutorServiceWithoutExecutorServiceConfigurationConstructor.
@Test
public void shouldCreateCustomBackendExecutorServiceWithoutExecutorServiceConfigurationConstructor() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CLASS.toStringWithoutRoot(), CustomParameterlessExecutorServiceImplementation.class.getName());
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendExecutorServiceWithoutBothExecutorServiceConfigurationConstructors.
@Test
public void shouldCreateCustomBackendExecutorServiceWithoutBothExecutorServiceConfigurationConstructors() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CORE_POOL_SIZE.toStringWithoutRoot(), 15);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CLASS.toStringWithoutRoot(), CustomExecutorServiceWithBothConstructorsImplementation.class.getName());
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder in project janusgraph by JanusGraph.
the class HBaseStoreManagerConfigTest method testHBaseTimestampProvider.
@Test
public // Test HBase preferred timestamp provider MILLI is set by default
void testHBaseTimestampProvider() {
// Get an empty configuration
// GraphDatabaseConfiguration.buildGraphConfiguration() only build an empty one.
ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
// Set backend to hbase
config.set(GraphDatabaseConfiguration.STORAGE_BACKEND, "hbase");
// Instantiate a GraphDatabaseConfiguration based on the above
GraphDatabaseConfiguration graphConfig = new GraphDatabaseConfigurationBuilder().build(config.getConfiguration());
// Check the TIMESTAMP_PROVIDER has been set to the hbase preferred MILLI
TimestampProviders provider = graphConfig.getConfiguration().get(GraphDatabaseConfiguration.TIMESTAMP_PROVIDER);
assertEquals(HBaseStoreManager.PREFERRED_TIMESTAMPS, provider);
}
use of org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder in project janusgraph by JanusGraph.
the class AbstractConfiguredGraphFactoryTest method setup.
@BeforeEach
public void setup() {
if (gm != null)
return;
gm = new JanusGraphManager(new Settings());
final MapConfiguration config = getManagementConfig();
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
// Instantiate the ConfigurationManagementGraph Singleton
new ConfigurationManagementGraph(graph);
}
Aggregations