Search in sources :

Example 1 with PropertyIndexStore

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

the class WriteTransaction method getPropertyIndex.

String getPropertyIndex(int id) {
    PropertyIndexStore indexStore = getPropertyStore().getIndexStore();
    PropertyIndexRecord index = getPropertyIndexRecord(id);
    if (index == null) {
        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 2 with PropertyIndexStore

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

the class WriteTransaction method createPropertyIndex.

void createPropertyIndex(int id, String key) {
    PropertyIndexRecord record = new PropertyIndexRecord(id);
    record.setInUse(true);
    record.setCreated();
    PropertyIndexStore propIndexStore = getPropertyStore().getIndexStore();
    int keyBlockId = propIndexStore.nextKeyBlockId();
    record.setKeyBlockId(keyBlockId);
    int length = key.length();
    char[] chars = new char[length];
    key.getChars(0, length, chars, 0);
    Collection<DynamicRecord> keyRecords = propIndexStore.allocateKeyRecords(keyBlockId, chars);
    for (DynamicRecord keyRecord : keyRecords) {
        record.addKeyRecord(keyRecord);
    }
    addPropertyIndexRecord(record);
}
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 3 with PropertyIndexStore

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

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);
    Collection<DynamicRecord> keyRecords = idxStore.allocateKeyRecords(keyBlockId, encodeString(stringKey));
    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 4 with PropertyIndexStore

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

the class WriteTransaction method createPropertyIndex.

@Override
public void createPropertyIndex(String key, int id) {
    PropertyIndexRecord record = new PropertyIndexRecord(id);
    record.setInUse(true);
    record.setCreated();
    PropertyIndexStore propIndexStore = getPropertyStore().getIndexStore();
    int keyBlockId = propIndexStore.nextKeyBlockId();
    record.setKeyBlockId(keyBlockId);
    Collection<DynamicRecord> keyRecords = propIndexStore.allocateKeyRecords(keyBlockId, encodeString(key));
    for (DynamicRecord keyRecord : keyRecords) {
        record.addKeyRecord(keyRecord);
    }
    addPropertyIndexRecord(record);
}
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 5 with PropertyIndexStore

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

the class WriteTransaction method loadIndex.

@Override
public String loadIndex(int id) {
    PropertyIndexStore indexStore = getPropertyStore().getIndexStore();
    PropertyIndexRecord index = getPropertyIndexRecord(id);
    if (index == null) {
        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