use of com.thinkaurelius.titan.diskstorage.idmanagement.ConsistentKeyIDAuthority 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");
}
}
Aggregations