@Override public void close() { // this is kinda nasty index.close(); } }
@TearDown(Level.Trial) public void tearDown() throws Exception { if (index != null) { index.close(); index = null; } if (segmentGenerator != null) { segmentGenerator.close(); segmentGenerator = null; } }
@TearDown(Level.Trial) public void tearDown() throws Exception { if (index != null) { index.close(); index = null; } if (segmentGenerator != null) { segmentGenerator.close(); segmentGenerator = null; } }
@After public void cleanUp() { index.close(); }
@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); } }
@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); } }
index.close();
@Test public void testPersistWithSegmentMetadata() throws IOException { File outDir = Files.createTempDir(); QueryableIndex index = null; try { outDir = Files.createTempDir(); index = indexIO.loadIndex(indexMerger.persist(toPersist, outDir, INDEX_SPEC, null)); Assert.assertEquals("value", index.getMetadata().get("key")); } finally { if (index != null) { index.close(); } if (outDir != null) { FileUtils.deleteDirectory(outDir); } } }
index.close();
@Override public void close() { // this is kinda nasty index.close(); } }