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);
}
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();
}
}
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);
}
Aggregations