Search in sources :

Example 1 with PropertyIndexData

use of org.neo4j.kernel.impl.nioneo.store.PropertyIndexData in project neo4j-mobile-android by neo4j-contrib.

the class WriteTransaction method addPropertyIndexCommand.

private void addPropertyIndexCommand(int id) {
    PropertyIndexData index;
    if (isRecovered()) {
        index = neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id, true);
    } else {
        index = neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id);
    }
    lockReleaser.addPropertyIndex(index);
}
Also used : PropertyIndexData(org.neo4j.kernel.impl.nioneo.store.PropertyIndexData)

Example 2 with PropertyIndexData

use of org.neo4j.kernel.impl.nioneo.store.PropertyIndexData 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;
}
Also used : RelationshipTypeData(org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData) PropertyIndexData(org.neo4j.kernel.impl.nioneo.store.PropertyIndexData) CacheType(org.neo4j.kernel.impl.core.NodeManager.CacheType)

Example 3 with PropertyIndexData

use of org.neo4j.kernel.impl.nioneo.store.PropertyIndexData in project graphdb by neo4j-attic.

the class WriteTransaction method addPropertyIndexCommand.

private void addPropertyIndexCommand(int id) {
    PropertyIndexData index;
    if (isRecovered()) {
        index = neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id, true);
    } else {
        index = neoStore.getPropertyStore().getIndexStore().getPropertyIndex(id);
    }
    lockReleaser.addPropertyIndex(index);
}
Also used : PropertyIndexData(org.neo4j.kernel.impl.nioneo.store.PropertyIndexData)

Example 4 with PropertyIndexData

use of org.neo4j.kernel.impl.nioneo.store.PropertyIndexData 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;
}
Also used : RelationshipTypeData(org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData) PropertyIndexData(org.neo4j.kernel.impl.nioneo.store.PropertyIndexData) CacheType(org.neo4j.kernel.impl.core.NodeManager.CacheType)

Aggregations

PropertyIndexData (org.neo4j.kernel.impl.nioneo.store.PropertyIndexData)4 CacheType (org.neo4j.kernel.impl.core.NodeManager.CacheType)2 RelationshipTypeData (org.neo4j.kernel.impl.nioneo.store.RelationshipTypeData)2