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;
}
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");
}
}
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;
}
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();
}
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();
}
Aggregations