@Override public void close() throws Exception { indexes.invalidateAll(); indexes.cleanUp(); closeException.close(); } }
public void waitForFinish() throws Exception { // remove the extra one to avoid premature count down. decrement(); latch.await(); ex.close(); }
public void start(ExecutionPlan plan, AttemptObserver observer) throws Exception { try{ startFragments(plan, observer); } catch(ForemanException ex){ exception.addException(ex); } finally { exception.close(); } }
void deleteEverything(Set<String> skipNames) throws IOException { final DeferredException deleteException = new DeferredException(); for(Entry<String, LuceneSearchIndex> index : indexes.asMap().entrySet()){ if (!skipNames.contains(index.getKey())) { try{ index.getValue().deleteEverything(); }catch(IOException e){ deleteException.addException(e); } } } try{ deleteException.close(); }catch(IOException ex){ throw ex; }catch(Exception ex){ throw new IOException("Failure deleting indeices.", ex); } }
@Override public void close() throws Exception { if (COLLECT_METRICS) { MetricUtils.removeAllMetricsThatStartWith(METRICS_PREFIX); } maps.invalidateAll(); closeException.suppressingClose(defaultHandle); closeException.suppressingClose(db); closeException.close(); }
/** * Process all events in the queue until it's empty. */ private void processEvents() { @SuppressWarnings("resource") final DeferredException deferredException = new DeferredException(); while (true) { T event; synchronized (queuedEvents) { if (queuedEvents.isEmpty()) { isProcessing = false; break; } event = queuedEvents.removeFirst(); } try { processEvent(event); } catch (Exception e) { deferredException.addException(e); } catch (AssertionError ae) { deferredException.addException(new RuntimeException("Caught an assertion", ae)); } } try { deferredException.close(); } catch(Exception e) { throw new RuntimeException("Exceptions caught during event processing", e); } }
@Override public void close() throws Exception { DeferredException ex = new DeferredException(); if(plugins != null) { try (AutoCloseableLock l = plugins.writeLock()) { ex.suppressingClose(plugins); } } if(refresher != null) { refresher.cancel(false); } ex.suppressingClose(protocol); ex.suppressingClose(allocator); ex.close(); }
Assert.fail("Acceleration job was not completed within allowed timeout."); ex.close(); long currentTime = System.currentTimeMillis(); RelNode newLogicalPlan = logicalPlan.get().accept(new MaterializationShuttle(IncrementalUpdateUtils.UPDATE_COLUMN, currentTime));