@Override public void close() { if (fileStorage != null) { try { fileStorage.close(); } finally { fileStorage = null; } } }
@Override public void close() { if (fileStorage != null) { try { fileStorage.close(); endOfFile = true; } finally { fileStorage = null; } } }
/** * Close the file without throwing any exceptions. Exceptions are simply * ignored. */ public void closeSilently() { try { close(); } catch (Exception e) { // ignore } }
void close() { save(); fileStorage.close(); }
private void closeStorage() { if (closed) { return; } save(); closed = true; synchronized (this) { for (BTreeChunk c : chunks.values()) { if (c.fileStorage != null) c.fileStorage.close(); } chunks.clear(); // release memory early - this is important when called // because of out of memory if (cache != null) cache.clear(); try { chunkMetaData.close(); } catch (IOException e) { } } }
private void removeUnusedChunks(TreeSet<Long> removedPages) { int size = removedPages.size(); for (BTreeChunk c : findUnusedChunks(removedPages)) { c.fileStorage.close(); c.fileStorage.delete(); chunks.remove(c.id); chunkIds.clear(c.id); removedPages.removeAll(c.pagePositions); } if (size > removedPages.size()) { writeChunkMetaData(lastChunk.id, removedPages); } }