use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class CassandraStorageSetup method getCQLConfiguration.
public static ModifiableConfiguration getCQLConfiguration(final String keyspace) {
final ModifiableConfiguration config = buildGraphConfiguration();
config.set(KEYSPACE, cleanKeyspaceName(keyspace));
LOGGER.debug("Set keyspace name: {}", config.get(KEYSPACE));
config.set(PAGE_SIZE, 500);
config.set(CONNECTION_TIMEOUT, Duration.ofSeconds(60L));
config.set(STORAGE_BACKEND, "cql");
if (HOSTNAME != null)
config.set(STORAGE_HOSTS, new String[] { HOSTNAME });
config.set(DROP_ON_CLEAR, false);
return config;
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class ElasticSearchConfigTest method testMultiTypeUpgrade.
@Test
public void testMultiTypeUpgrade() throws InterruptedException, BackendException, IOException {
// create multi-type index
final ModifiableConfiguration config = esr.setElasticsearchConfiguration(GraphDatabaseConfiguration.buildGraphConfiguration(), INDEX_NAME);
config.set(USE_DEPRECATED_MULTITYPE_INDEX, true, INDEX_NAME);
Configuration indexConfig = config.restrictTo(INDEX_NAME);
IndexProvider idx = open(indexConfig);
simpleWriteAndQuery(idx);
idx.close();
// should be able to open multi-type index if USE_DEPRECATED_MULTITYPE_INDEX is unset
config.remove(USE_DEPRECATED_MULTITYPE_INDEX, INDEX_NAME);
indexConfig = config.restrictTo(INDEX_NAME);
idx = open(indexConfig);
idx.close();
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class RestClientSetupTest method baseConfigTest.
private ElasticSearchClient baseConfigTest(Map<String, String> extraConfigValues) throws Exception {
final CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
cc.set("index." + INDEX_NAME + ".backend", "elasticsearch");
cc.set("index." + INDEX_NAME + ".elasticsearch.interface", "REST_CLIENT");
for (Map.Entry<String, String> me : extraConfigValues.entrySet()) {
cc.set(me.getKey(), me.getValue());
}
final ModifiableConfiguration config = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, cc, BasicConfiguration.Restriction.NONE);
doReturn(restClientBuilderMock).when(restClientSetup).getRestClientBuilder(any());
doReturn(restElasticSearchClientMock).when(restClientSetup).getElasticSearchClient(any(RestClient.class), anyInt());
return restClientSetup.connect(config.restrictTo(INDEX_NAME));
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class ElasticSearchIndexTest method getESTestConfig.
public Configuration getESTestConfig() {
final String index = "es";
final CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
if (esr.getEsMajorVersion().value > 2) {
cc.set("index." + index + ".elasticsearch.ingest-pipeline.ingestvertex", "pipeline_1");
}
return esr.setElasticsearchConfiguration(new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, cc, BasicConfiguration.Restriction.NONE), index).set(GraphDatabaseConfiguration.INDEX_MAX_RESULT_SET_SIZE, 3, index).restrictTo(index);
}
use of org.janusgraph.diskstorage.configuration.ModifiableConfiguration in project janusgraph by JanusGraph.
the class MapReduceIndexJobs method hbaseRemove.
public static ScanMetrics hbaseRemove(Properties janusgraphProperties, String indexName, String relationType, Configuration hadoopBaseConf) throws InterruptedException, IOException, ClassNotFoundException {
IndexRemoveJob job = new IndexRemoveJob();
HBaseHadoopScanRunner cr = new HBaseHadoopScanRunner(job);
ModifiableConfiguration mc = getIndexJobConf(indexName, relationType);
copyPropertiesToInputAndOutputConf(hadoopBaseConf, janusgraphProperties);
cr.scanJobConf(mc);
cr.scanJobConfRoot(GraphDatabaseConfiguration.class.getName() + "#JOB_NS");
cr.baseHadoopConf(hadoopBaseConf);
return cr.run();
}
Aggregations