Search in sources :

Example 41 with ModifiableConfiguration

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;
}
Also used : ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 42 with ModifiableConfiguration

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();
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(org.janusgraph.diskstorage.configuration.Configuration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) GraphDatabaseConfiguration(org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration) BasicConfiguration(org.janusgraph.diskstorage.configuration.BasicConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) Test(org.junit.Test)

Example 43 with ModifiableConfiguration

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));
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) RestClient(org.elasticsearch.client.RestClient) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) HashMap(java.util.HashMap) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 44 with ModifiableConfiguration

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);
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration)

Example 45 with ModifiableConfiguration

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();
}
Also used : HBaseHadoopScanRunner(org.janusgraph.hadoop.scan.HBaseHadoopScanRunner) ModifiableConfiguration(org.janusgraph.diskstorage.configuration.ModifiableConfiguration) IndexRemoveJob(org.janusgraph.graphdb.olap.job.IndexRemoveJob)

Aggregations

ModifiableConfiguration (org.janusgraph.diskstorage.configuration.ModifiableConfiguration)62 Test (org.junit.Test)16 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)10 CommonsConfiguration (org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration)10 KeyColumnValueStoreTest (org.janusgraph.diskstorage.KeyColumnValueStoreTest)6 BasicConfiguration (org.janusgraph.diskstorage.configuration.BasicConfiguration)5 Configuration (org.janusgraph.diskstorage.configuration.Configuration)5 GraphDatabaseConfiguration (org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration)5 HashMap (java.util.HashMap)3 Map (java.util.Map)3 StandardBaseTransactionConfig (org.janusgraph.diskstorage.util.StandardBaseTransactionConfig)3 WriteConfiguration (org.janusgraph.diskstorage.configuration.WriteConfiguration)2 InMemoryStoreManager (org.janusgraph.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager)2 IndexRemoveJob (org.janusgraph.graphdb.olap.job.IndexRemoveJob)2 IndexRepairJob (org.janusgraph.graphdb.olap.job.IndexRepairJob)2 CassandraHadoopScanRunner (org.janusgraph.hadoop.scan.CassandraHadoopScanRunner)2 HBaseHadoopScanRunner (org.janusgraph.hadoop.scan.HBaseHadoopScanRunner)2 Before (org.junit.Before)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 IOException (java.io.IOException)1