use of org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData in project neo4j-mobile-android by neo4j-contrib.
the class ReadTransaction method loadRelationshipTypes.
@Override
public RelationshipTypeData[] loadRelationshipTypes() {
RelationshipTypeData[] relTypeData = neoStore.getRelationshipTypeStore().getRelationshipTypes();
RelationshipTypeData[] rawRelTypeData = new RelationshipTypeData[relTypeData.length];
for (int i = 0; i < relTypeData.length; i++) {
rawRelTypeData[i] = new RelationshipTypeData(relTypeData[i].getId(), relTypeData[i].getName());
}
return rawRelTypeData;
}
use of org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData in project neo4j-mobile-android by neo4j-contrib.
the class WriteTransaction method loadRelationshipTypes.
@Override
public RelationshipTypeData[] loadRelationshipTypes() {
RelationshipTypeData[] relTypeData = neoStore.getRelationshipTypeStore().getRelationshipTypes();
;
RelationshipTypeData[] rawRelTypeData = new RelationshipTypeData[relTypeData.length];
for (int i = 0; i < relTypeData.length; i++) {
rawRelTypeData[i] = new RelationshipTypeData(relTypeData[i].getId(), relTypeData[i].getName());
}
return rawRelTypeData;
}
use of org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData in project neo4j-mobile-android by neo4j-contrib.
the class DefaultRelationshipTypeCreator method getOrCreate.
public int getOrCreate(TransactionManager txManager, EntityIdGenerator idGenerator, PersistenceManager persistence, RelationshipTypeHolder relTypeHolder, String name) {
RelTypeCreater createrThread = new RelTypeCreater(name, txManager, idGenerator, persistence);
synchronized (createrThread) {
createrThread.start();
while (createrThread.isAlive()) {
try {
createrThread.wait(50);
} catch (InterruptedException e) {
Thread.interrupted();
}
}
}
if (createrThread.succeded()) {
int id = createrThread.getRelTypeId();
relTypeHolder.addRawRelationshipType(new RelationshipTypeData(id, name));
return id;
}
throw new TransactionFailureException("Unable to create relationship type " + name);
}
use of org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData in project neo4j-mobile-android by neo4j-contrib.
the class GraphDbModule method start.
public void start(LockReleaser lockReleaser, PersistenceManager persistenceManager, RelationshipTypeCreator relTypeCreator, Map<Object, Object> params) {
if (!startIsOk) {
return;
}
String cacheTypeName = (String) params.get(Config.CACHE_TYPE);
CacheType cacheType = null;
try {
cacheType = cacheTypeName != null ? CacheType.valueOf(cacheTypeName) : DEFAULT_CACHE_TYPE;
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Invalid cache type, please use one of: " + Arrays.asList(CacheType.values()) + " or keep empty for default (" + DEFAULT_CACHE_TYPE + ")", e.getCause());
}
if (!readOnly) {
nodeManager = new NodeManager(graphDbService, cacheManager, lockManager, lockReleaser, transactionManager, persistenceManager, idGenerator, relTypeCreator, cacheType);
} else {
nodeManager = new ReadOnlyNodeManager(graphDbService, cacheManager, lockManager, lockReleaser, transactionManager, persistenceManager, idGenerator, cacheType);
}
// load and verify from PS
RelationshipTypeData[] relTypes = null;
PropertyIndexData[] propertyIndexes = null;
// beginTx();
relTypes = persistenceManager.loadAllRelationshipTypes();
propertyIndexes = persistenceManager.loadPropertyIndexes(INDEX_COUNT);
// commitTx();
nodeManager.addRawRelationshipTypes(relTypes);
nodeManager.addPropertyIndexes(propertyIndexes);
if (propertyIndexes.length < INDEX_COUNT) {
nodeManager.setHasAllpropertyIndexes(true);
}
nodeManager.start(params);
startIsOk = false;
}
use of org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData in project graphdb by neo4j-attic.
the class WriteTransaction method addRelationshipType.
private void addRelationshipType(int id) {
setRecovered();
RelationshipTypeData type;
if (isRecovered()) {
type = neoStore.getRelationshipTypeStore().getRelationshipType(id, true);
} else {
type = neoStore.getRelationshipTypeStore().getRelationshipType(id);
}
lockReleaser.addRelationshipType(type);
}
Aggregations