Search in sources :

Example 1 with MultipleUnderlyingStorageExceptions

use of org.neo4j.kernel.impl.store.MultipleUnderlyingStorageExceptions in project neo4j by neo4j.

the class IndexUpdaterMap method close.

@Override
public void close() throws UnderlyingStorageException {
    Set<Pair<IndexDescriptor, UnderlyingStorageException>> exceptions = null;
    for (Map.Entry<IndexDescriptor, IndexUpdater> updaterEntry : updaterMap.entrySet()) {
        IndexUpdater updater = updaterEntry.getValue();
        try {
            updater.close();
        } catch (UncheckedIOException | IndexEntryConflictException e) {
            if (null == exceptions) {
                exceptions = new HashSet<>();
            }
            exceptions.add(Pair.of(updaterEntry.getKey(), new UnderlyingStorageException(e)));
        }
    }
    clear();
    if (null != exceptions) {
        throw new MultipleUnderlyingStorageExceptions(exceptions);
    }
}
Also used : UncheckedIOException(java.io.UncheckedIOException) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) UnderlyingStorageException(org.neo4j.exceptions.UnderlyingStorageException) Map(java.util.Map) HashMap(java.util.HashMap) IndexEntryConflictException(org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException) IndexUpdater(org.neo4j.kernel.api.index.IndexUpdater) Pair(org.neo4j.internal.helpers.collection.Pair) HashSet(java.util.HashSet) MultipleUnderlyingStorageExceptions(org.neo4j.kernel.impl.store.MultipleUnderlyingStorageExceptions)

Aggregations

UncheckedIOException (java.io.UncheckedIOException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 UnderlyingStorageException (org.neo4j.exceptions.UnderlyingStorageException)1 Pair (org.neo4j.internal.helpers.collection.Pair)1 IndexDescriptor (org.neo4j.internal.schema.IndexDescriptor)1 IndexEntryConflictException (org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException)1 IndexUpdater (org.neo4j.kernel.api.index.IndexUpdater)1 MultipleUnderlyingStorageExceptions (org.neo4j.kernel.impl.store.MultipleUnderlyingStorageExceptions)1