Search in sources :

Example 6 with PropertyIndexStore

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

the class ReadTransaction method loadIndex.

@Override
public String loadIndex(int id) {
    PropertyIndexStore indexStore = getPropertyStore().getIndexStore();
    PropertyIndexRecord index = indexStore.getRecord(id);
    if (index.isLight()) {
        indexStore.makeHeavy(index);
    }
    return indexStore.getStringFor(index);
}
Also used : PropertyIndexRecord(org.neo4j.kernel.impl.nioneo.store.PropertyIndexRecord) PropertyIndexStore(org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore)

Example 7 with PropertyIndexStore

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

the class BatchInserterImpl method createNewPropertyIndex.

private int createNewPropertyIndex(String stringKey) {
    PropertyIndexStore idxStore = getPropertyIndexStore();
    int keyId = (int) idxStore.nextId();
    PropertyIndexRecord record = new PropertyIndexRecord(keyId);
    record.setInUse(true);
    record.setCreated();
    int keyBlockId = idxStore.nextKeyBlockId();
    record.setKeyBlockId(keyBlockId);
    int length = stringKey.length();
    char[] chars = new char[length];
    stringKey.getChars(0, length, chars, 0);
    Collection<DynamicRecord> keyRecords = idxStore.allocateKeyRecords(keyBlockId, chars);
    for (DynamicRecord keyRecord : keyRecords) {
        record.addKeyRecord(keyRecord);
    }
    idxStore.updateRecord(record);
    indexHolder.addPropertyIndex(stringKey, keyId);
    return keyId;
}
Also used : DynamicRecord(org.neo4j.kernel.impl.nioneo.store.DynamicRecord) PropertyIndexRecord(org.neo4j.kernel.impl.nioneo.store.PropertyIndexRecord) PropertyIndexStore(org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore)

Example 8 with PropertyIndexStore

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

the class ReadTransaction method getPropertyIndex.

String getPropertyIndex(int id) {
    PropertyIndexStore indexStore = getPropertyStore().getIndexStore();
    PropertyIndexRecord index = indexStore.getRecord(id);
    if (index.isLight()) {
        indexStore.makeHeavy(index);
    }
    return indexStore.getStringFor(index);
}
Also used : PropertyIndexRecord(org.neo4j.kernel.impl.nioneo.store.PropertyIndexRecord) PropertyIndexStore(org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore)

Aggregations

PropertyIndexRecord (org.neo4j.kernel.impl.nioneo.store.PropertyIndexRecord)8 PropertyIndexStore (org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore)8 DynamicRecord (org.neo4j.kernel.impl.nioneo.store.DynamicRecord)4