/** * Close the tree. * * @param cleanLog if true then wait for the BerkeleyDB clean thread to finish. * @param operation optionally test or repair the berkeleyDB. */ @Override public void close(boolean cleanLog, CloseOperation operation) throws IOException { if (!closed.compareAndSet(false, true)) { log.trace("already closed"); return; } log.debug("closing {}", this); sync(); if (source != null) { int status = source.close(cleanLog, operation); if (status != 0) { throw new RuntimeException("page db close returned a non-zero exit code : " + status); } } if (logger != null) { logger.terminate(); } }