Search in sources :

Example 1 with LegacyIndexProviderTransaction

use of org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction in project neo4j by neo4j.

the class LegacyIndexTransactionStateImpl method nodeChanges.

@Override
public LegacyIndex nodeChanges(String indexName) throws LegacyIndexNotFoundKernelException {
    Map<String, String> configuration = indexConfigStore.get(Node.class, indexName);
    if (configuration == null) {
        throw new LegacyIndexNotFoundKernelException("Node index '" + indexName + " not found");
    }
    String providerName = configuration.get(IndexManager.PROVIDER);
    IndexImplementation provider = providerLookup.apply(providerName);
    LegacyIndexProviderTransaction transaction = transactions.get(providerName);
    if (transaction == null) {
        transactions.put(providerName, transaction = provider.newTransaction(this));
    }
    return transaction.nodeIndex(indexName, configuration);
}
Also used : LegacyIndexNotFoundKernelException(org.neo4j.kernel.api.exceptions.legacyindex.LegacyIndexNotFoundKernelException) IndexImplementation(org.neo4j.kernel.spi.legacyindex.IndexImplementation) LegacyIndexProviderTransaction(org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction)

Example 2 with LegacyIndexProviderTransaction

use of org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction in project neo4j by neo4j.

the class LegacyIndexTransactionStateImpl method extractCommands.

@Override
public void extractCommands(Collection<StorageCommand> target) {
    if (defineCommand != null) {
        target.add(defineCommand);
        extractCommands(target, nodeCommands);
        extractCommands(target, relationshipCommands);
    }
    for (LegacyIndexProviderTransaction providerTransaction : transactions.values()) {
        providerTransaction.close();
    }
}
Also used : LegacyIndexProviderTransaction(org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction)

Example 3 with LegacyIndexProviderTransaction

use of org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction in project neo4j by neo4j.

the class LegacyIndexTransactionStateImpl method relationshipChanges.

@Override
public LegacyIndex relationshipChanges(String indexName) throws LegacyIndexNotFoundKernelException {
    Map<String, String> configuration = indexConfigStore.get(Relationship.class, indexName);
    if (configuration == null) {
        throw new LegacyIndexNotFoundKernelException("Relationship index '" + indexName + " not found");
    }
    String providerName = configuration.get(IndexManager.PROVIDER);
    IndexImplementation provider = providerLookup.apply(providerName);
    LegacyIndexProviderTransaction transaction = transactions.get(providerName);
    if (transaction == null) {
        transactions.put(providerName, transaction = provider.newTransaction(this));
    }
    return transaction.relationshipIndex(indexName, configuration);
}
Also used : LegacyIndexNotFoundKernelException(org.neo4j.kernel.api.exceptions.legacyindex.LegacyIndexNotFoundKernelException) IndexImplementation(org.neo4j.kernel.spi.legacyindex.IndexImplementation) LegacyIndexProviderTransaction(org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction)

Aggregations

LegacyIndexProviderTransaction (org.neo4j.kernel.spi.legacyindex.LegacyIndexProviderTransaction)3 LegacyIndexNotFoundKernelException (org.neo4j.kernel.api.exceptions.legacyindex.LegacyIndexNotFoundKernelException)2 IndexImplementation (org.neo4j.kernel.spi.legacyindex.IndexImplementation)2