@Override public void close() { AutoCloseables.closeNoChecked(context); } }
@Override public void queryCompleted(QueryState state) { AutoCloseables.closeNoChecked(allocator); System.out.println("Total rows returned : " + count.get() + ". Returned in " + w.elapsed(TimeUnit.MILLISECONDS) + "ms."); }
@Override public void submissionFailed(UserException ex) { AutoCloseables.closeNoChecked(allocator); this.ex = ex; }
@Override public synchronized void close() { List<AutoCloseable> closeables = new ArrayList<>(); closeables.add(() -> super.close()); List<AutoCloseable> backList = new ArrayList<>(); backList.addAll(closeable.getCloseables()); Collections.reverse(backList); closeables.addAll(backList); AutoCloseables.closeNoChecked(AutoCloseables.all(closeables)); } }
public PriorityQueueCopier createCopier() throws Exception { Preconditions.checkState(tempContainer == null); Preconditions.checkState(mergeState == MergeState.COPY); if (copier != null) { AutoCloseables.closeNoChecked(copier); } tempContainer = VectorContainer.create(copierAllocator, dataSchema); return createCopier(tempContainer, this.diskRuns); }
@Override public void close() { try { Metrics.resetMetrics(); } catch (Error | Exception e) { logger.warn("failure resetting metrics.", e); } executor.close(); AutoCloseables.closeNoChecked(allocator); }
this.client.close(); AutoCloseables.closeNoChecked(recordAllocator); AutoCloseables.closeNoChecked(connectionAllocator); if (this.ownsAllocator && rootAllocator != null) { AutoCloseables.closeNoChecked(rootAllocator);
private void nextReader() { AutoCloseables.closeNoChecked(current); current = null; currentIndex++; if(currentIndex == footer.getBlocks().size()) { return; } current = new ParquetRowiseReader( context, footer, currentIndex, status.getPath().toString(), GroupScan.ALL_COLUMNS, fs, schemaHelper, streamProvider ); try { current.setup(output); } catch (ExecutionSetupException e) { throw Throwables.propagate(e); } }
@After public void clear(){ // TODO: (Re DRILL-1735) Check whether still needed now that // BootstrapContext.close() resets the metrics. Metrics.resetMetrics(); AutoCloseables.closeNoChecked(allocator); AutoCloseables.closeNoChecked(rootAllocator); }
/** * Obtains a query ticket (creating one if one hasn't already been created), and invokes the callback with * this ticket * Multi-thread safe */ public void buildAndStartQuery(final QueryId queryId, final long maxAllocation, final CoordinationProtos.NodeEndpoint foreman, final CoordinationProtos.NodeEndpoint assignment, final ExecToCoordTunnelCreator tunnelCreator, final QueryStarter queryStarter) { QueryTicket queryTicket = queryTickets.get(queryId); if (queryTicket == null) { final BufferAllocator queryAllocator = makeQueryAllocator(getAllocator(), queryId, maxAllocation); queryTicket = new QueryTicket(this, queryId, queryAllocator, foreman, assignment, tunnelCreator, 0L); QueryTicket insertedTicket = queryTickets.putIfAbsent(queryId, queryTicket); if (insertedTicket == null) { this.reserve(); } else { // Race condition: another user managed to insert a query ticket. Let's close ours and use theirs AutoCloseables.closeNoChecked(queryTicket); // NB: closing the ticket will close the query allocator queryTicket = insertedTicket; } } queryTicket.reserve(); queryStarter.buildAndStartQuery(queryTicket); }