Search in sources :

Example 1 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration in project titan by thinkaurelius.

the class IDAuthorityTest method configs.

@Parameterized.Parameters
public static Collection<Object[]> configs() {
    List<Object[]> configurations = new ArrayList<Object[]>();
    ModifiableConfiguration c = getBasicConfig();
    configurations.add(new Object[] { c.getConfiguration() });
    c = getBasicConfig();
    c.set(IDAUTHORITY_CAV_BITS, 9);
    c.set(IDAUTHORITY_CAV_TAG, 511);
    configurations.add(new Object[] { c.getConfiguration() });
    c = getBasicConfig();
    c.set(IDAUTHORITY_CAV_RETRIES, 10);
    c.set(IDAUTHORITY_WAIT, Duration.ofMillis(10L));
    c.set(IDAUTHORITY_CAV_BITS, 7);
    //c.set(IDAUTHORITY_RANDOMIZE_UNIQUEID,true);
    c.set(IDAUTHORITY_CONFLICT_AVOIDANCE, ConflictAvoidanceMode.GLOBAL_AUTO);
    configurations.add(new Object[] { c.getConfiguration() });
    return configurations;
}
Also used : ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Example 2 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration in project titan by thinkaurelius.

the class IDAuthorityTest method open.

public void open() throws BackendException {
    manager = new KeyColumnValueStoreManager[CONCURRENCY];
    idAuthorities = new IDAuthority[CONCURRENCY];
    for (int i = 0; i < CONCURRENCY; i++) {
        ModifiableConfiguration sc = StorageSetup.getConfig(baseStoreConfiguration.copy());
        //sc.set(GraphDatabaseConfiguration.INSTANCE_RID_SHORT,(short)i);
        sc.set(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_SUFFIX, (short) i);
        if (!sc.has(UNIQUE_INSTANCE_ID)) {
            String uniqueGraphId = getOrGenerateUniqueInstanceId(sc);
            log.debug("Setting unique instance id: {}", uniqueGraphId);
            sc.set(UNIQUE_INSTANCE_ID, uniqueGraphId);
        }
        sc.set(GraphDatabaseConfiguration.CLUSTER_MAX_PARTITIONS, MAX_NUM_PARTITIONS);
        manager[i] = openStorageManager();
        StoreFeatures storeFeatures = manager[i].getFeatures();
        KeyColumnValueStore idStore = manager[i].openDatabase("ids");
        if (storeFeatures.isKeyConsistent())
            idAuthorities[i] = new ConsistentKeyIDAuthority(idStore, manager[i], sc);
        else
            throw new IllegalArgumentException("Cannot open id store");
    }
}
Also used : ConsistentKeyIDAuthority(com.thinkaurelius.titan.diskstorage.idmanagement.ConsistentKeyIDAuthority) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Example 3 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration in project titan by thinkaurelius.

the class IDAuthorityTest method getBasicConfig.

public static ModifiableConfiguration getBasicConfig() {
    ModifiableConfiguration c = GraphDatabaseConfiguration.buildGraphConfiguration();
    c.set(IDAUTHORITY_WAIT, Duration.ofMillis(100L));
    c.set(IDS_BLOCK_SIZE, 400);
    return c;
}
Also used : ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Example 4 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration in project titan by thinkaurelius.

the class ThriftSolrTest method getConfiguration.

@Override
public WriteConfiguration getConfiguration() {
    ModifiableConfiguration config = CassandraStorageSetup.getCassandraThriftConfiguration(ThriftSolrTest.class.getName());
    //Add index
    config.set(SolrIndex.ZOOKEEPER_URL, SolrRunner.getMiniCluster().getZkServer().getZkAddress(), INDEX);
    config.set(SolrIndex.WAIT_SEARCHER, true, INDEX);
    config.set(INDEX_BACKEND, "solr", INDEX);
    //TODO: set SOLR specific config options
    return config.getConfiguration();
}
Also used : ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Example 5 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration in project titan by thinkaurelius.

the class BerkeleyGraphTest method getConfiguration.

@Override
public WriteConfiguration getConfiguration() {
    ModifiableConfiguration mcfg = BerkeleyStorageSetup.getBerkeleyJEConfiguration();
    String methodName = methodNameRule.getMethodName();
    if (methodName.equals("testConsistencyEnforcement")) {
        IsolationLevel iso = IsolationLevel.SERIALIZABLE;
        log.debug("Forcing isolation level {} for test method {}", iso, methodName);
        mcfg.set(BerkeleyJEStoreManager.ISOLATION_LEVEL, iso.toString());
    } else {
        IsolationLevel iso = null;
        if (mcfg.has(BerkeleyJEStoreManager.ISOLATION_LEVEL)) {
            iso = ConfigOption.getEnumValue(mcfg.get(BerkeleyJEStoreManager.ISOLATION_LEVEL), IsolationLevel.class);
        }
        log.debug("Using isolation level {} (null means adapter default) for test method {}", iso, methodName);
    }
    return mcfg.getConfiguration();
}
Also used : IsolationLevel(com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager.IsolationLevel) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Aggregations

ModifiableConfiguration (com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)50 Test (org.junit.Test)13 Configuration (com.thinkaurelius.titan.diskstorage.configuration.Configuration)9 ElasticSearchIndex (com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex)9 GraphDatabaseConfiguration (com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration)9 CommonsConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration)8 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)8 BasicConfiguration (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)7 File (java.io.File)3 KeyColumnValueStoreTest (com.thinkaurelius.titan.diskstorage.KeyColumnValueStoreTest)2 WriteConfiguration (com.thinkaurelius.titan.diskstorage.configuration.WriteConfiguration)2 IndexProviderTest (com.thinkaurelius.titan.diskstorage.indexing.IndexProviderTest)2 StandardBaseTransactionConfig (com.thinkaurelius.titan.diskstorage.util.StandardBaseTransactionConfig)2 IndexRemoveJob (com.thinkaurelius.titan.graphdb.olap.job.IndexRemoveJob)2 IndexRepairJob (com.thinkaurelius.titan.graphdb.olap.job.IndexRepairJob)2 CassandraHadoopScanRunner (com.thinkaurelius.titan.hadoop.scan.CassandraHadoopScanRunner)2 HBaseHadoopScanRunner (com.thinkaurelius.titan.hadoop.scan.HBaseHadoopScanRunner)2 Map (java.util.Map)2 TitanFactory (com.thinkaurelius.titan.core.TitanFactory)1 TitanGraph (com.thinkaurelius.titan.core.TitanGraph)1