/** * Cleanup any state for this DB. Called once per DB instance; there is one DB * instance per client thread. */ @Override public void cleanup() throws DBException { if (INIT_COUNT.decrementAndGet() == 0) { try { AzureCosmosClient.client.close(); } catch (Exception e) { if (!this.includeExceptionStackInLog) { e = null; } LOGGER.error("Could not close DocumentClient", e); } finally { client = null; } } }
@Override public void close() { safeShutdownExecutorService(this.executorService); client.close(); } }