use of org.neo4j.kernel.impl.core.NodeManager.CacheType 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.core.NodeManager.CacheType in project graphdb by neo4j-attic.
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;
}
Aggregations