use of org.neo4j.kernel.api.exceptions.legacyindex.LegacyIndexNotFoundKernelException in project neo4j by neo4j.
the class InternalAutoIndexOperations method propertyChanged.
@Override
public void propertyChanged(DataWriteOperations ops, long entityId, Property oldProperty, Property newProperty) throws AutoIndexingKernelException {
if (enabled) {
try {
String name = propertyKeyLookup.getTokenById(oldProperty.propertyKeyId()).name();
if (propertyKeysToInclude.get().contains(name)) {
ensureIndexExists(ops);
type.remove(ops, entityId, name, oldProperty.value());
type.add(ops, entityId, name, newProperty.value());
}
} catch (LegacyIndexNotFoundKernelException | EntityNotFoundException | PropertyNotFoundException e) {
throw new AutoIndexingKernelException(e);
} catch (TokenNotFoundException e) {
// KernelException now
throw new AutoIndexingKernelException(new PropertyKeyIdNotFoundKernelException(oldProperty.propertyKeyId(), e));
}
}
}
use of org.neo4j.kernel.api.exceptions.legacyindex.LegacyIndexNotFoundKernelException 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