Search in sources :

Example 6 with ExceptionWrapper

use of org.janusgraph.util.datastructures.ExceptionWrapper in project janusgraph by JanusGraph.

the class CQLStoreManager method close.

@Override
public void close() throws BackendException {
    try {
        ExceptionWrapper exceptionWrapper = new ExceptionWrapper();
        executeWithCatching(this::clearJmxMetrics, exceptionWrapper);
        executeWithCatching(session::close, exceptionWrapper);
        throwIfException(exceptionWrapper);
    } finally {
        gracefulExecutorServiceShutdown(executorService, threadPoolShutdownMaxWaitTime);
    }
}
Also used : ExceptionWrapper(org.janusgraph.util.datastructures.ExceptionWrapper)

Example 7 with ExceptionWrapper

use of org.janusgraph.util.datastructures.ExceptionWrapper in project janusgraph by JanusGraph.

the class KCVSLogManager method close.

@Override
public synchronized void close() throws BackendException {
    /* Copying the map is necessary to avoid ConcurrentModificationException.
         * The path to ConcurrentModificationException in the absence of a copy is
         * log.close() -> manager.closedLog(log) -> openLogs.remove(log.getName()).
         */
    ExceptionWrapper exceptionWrapper = new ExceptionWrapper();
    for (KCVSLog log : new ArrayList<>(openLogs.values())) {
        executeWithCatching(log::close, exceptionWrapper);
    }
    IOUtils.closeQuietly(serializer);
    throwIfException(exceptionWrapper);
}
Also used : ArrayList(java.util.ArrayList) ExceptionWrapper(org.janusgraph.util.datastructures.ExceptionWrapper)

Aggregations

ExceptionWrapper (org.janusgraph.util.datastructures.ExceptionWrapper)7 JanusGraphException (org.janusgraph.core.JanusGraphException)2 BackendException (org.janusgraph.diskstorage.BackendException)2 ArrayList (java.util.ArrayList)1 IndexProvider (org.janusgraph.diskstorage.indexing.IndexProvider)1 KeyColumnValueStore (org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore)1 Log (org.janusgraph.diskstorage.log.Log)1 MetricInstrumentedIndexProvider (org.janusgraph.diskstorage.util.MetricInstrumentedIndexProvider)1