@Override public void close() { index.close(); } }
@TearDown(Level.Iteration) public void teardown() { incIndex.close(); incIndex = null; }
@Override public void doRun() { try { persist(persistIndex, interval, file, progressIndicator); } catch (Exception e) { log.error(e, "persist index error"); throw Throwables.propagate(e); } finally { // close this index persistIndex.close(); } } }
/** * Clear out maps to allow GC * NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing */ @Override public void close() { super.close(); closeAggregators(); aggregators.clear(); facts.clear(); if (selectors != null) { selectors.clear(); } }
/** * NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing */ @Override public void close() { super.close(); facts.clear(); indexAndOffsets.clear(); if (selectors != null) { selectors.clear(); } Closer c = Closer.create(); aggBuffers.forEach(c::register); try { c.close(); } catch (IOException e) { throw new RuntimeException(e); } aggBuffers.clear(); } }
@TearDown(Level.Trial) public void tearDown() { try { if (anIncrementalIndex != null) { anIncrementalIndex.close(); } if (queryableIndexes != null) { for (QueryableIndex index : queryableIndexes) { index.close(); } } if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } } catch (IOException e) { log.warn(e, "Failed to tear down, temp dir was: %s", tmpDir); throw Throwables.propagate(e); } }
@TearDown(Level.Trial) public void tearDown() { try { if (anIncrementalIndex != null) { anIncrementalIndex.close(); } if (queryableIndexes != null) { for (QueryableIndex index : queryableIndexes) { index.close(); } } if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } } catch (IOException e) { log.warn(e, "Failed to tear down, temp dir was: %s", tmpDir); throw Throwables.propagate(e); } }
private void flushIndexToContextAndClose(BytesWritable key, IncrementalIndex index, Context context) throws IOException, InterruptedException { final List<String> dimensions = index.getDimensionNames(); Iterator<Row> rows = index.iterator(); while (rows.hasNext()) { context.progress(); Row row = rows.next(); InputRow inputRow = getInputRowFromRow(row, dimensions); // reportParseExceptions is true as any unparseable data is already handled by the mapper. InputRowSerde.SerializeResult serializeResult = InputRowSerde.toBytes(typeHelperMap, inputRow, combiningAggs); context.write( key, new BytesWritable(serializeResult.getSerializedRow()) ); } index.close(); }
log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId()); future.cancel(true); closeOnFailure.close(); throw new QueryInterruptedException(e); closeOnFailure.close(); throw new QueryInterruptedException(e); closeOnFailure.close(); log.info("Query timeout, cancelling pending results for query id [%s]", query.getId()); future.cancel(true); closeOnFailure.close(); throw Throwables.propagate(e.getCause());
@After public void cleanup() throws Exception { queryableIndex.close(); incrementalIndex.close(); FileUtils.deleteDirectory(persistedSegmentDir); } }
@After public void tearDown() throws Exception { for (IncrementalIndex incrementalIndex : incrementalIndices) { incrementalIndex.close(); } for (QueryableIndex queryableIndex : groupByIndices) { queryableIndex.close(); } if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } }
@After public void tearDown() throws Exception { for (IncrementalIndex incrementalIndex : incrementalIndices) { incrementalIndex.close(); } for (QueryableIndex queryableIndex : groupByIndices) { queryableIndex.close(); } resourceCloser.close(); if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } }
@After public void tearDown() throws Exception { for (IncrementalIndex incrementalIndex : incrementalIndices) { incrementalIndex.close(); } for (QueryableIndex queryableIndex : groupByIndices) { queryableIndex.close(); } resourceCloser.close(); if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } }
@After public void tearDown() throws Exception { for (IncrementalIndex incrementalIndex : incrementalIndices) { incrementalIndex.close(); } for (QueryableIndex queryableIndex : groupByIndices) { queryableIndex.close(); } resourceCloser.close(); if (tmpDir != null) { FileUtils.deleteDirectory(tmpDir); } }
); innerQueryResultIndex.close();
index.close(); if (persistExecutor != null) { persistExecutor.shutdownNow();
} else { newIndex.close(); throw new ISE("finishWriting() called during swap");
@Override public void close() { index.close(); } }
/** * Clear out maps to allow GC * NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing */ @Override public void close() { super.close(); closeAggregators(); aggregators.clear(); facts.clear(); if (selectors != null) { selectors.clear(); } }