/** * {@inheritDoc} * <p> * If the a default internal KMS client has been constructed, it will also be * shut down by calling this method. * Otherwise, users who provided the KMS client would be responsible to * shut down the KMS client extrinsic to this method. */ @Override public void shutdown() { super.shutdown(); if (isKMSClientInternal) kms.shutdown(); }
/** * Cleanup any state for this storage. * Called once per S3 instance; */ @Override public void cleanup() throws DBException { if (INIT_COUNT.decrementAndGet() == 0) { try { s3Client.shutdown(); System.out.println("The client is shutdown successfully"); } catch (Exception e){ System.err.println("Could not shutdown the S3Client: "+e.toString()); e.printStackTrace(); } finally { if (s3Client != null){ s3Client = null; } } } } /**
@Override public void run() { try { while ( !Thread.currentThread().isInterrupted() ) { shutdownQueue.take().client.shutdown(); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); } } }
/** * Forcefully shuts down this TransferManager instance - currently executing * transfers will not be allowed to finish. Callers should use this method * when they either: * <ul> * <li>have already verified that their transfers have completed by checking * each transfer's state * <li>need to exit quickly and don't mind stopping transfers before they * complete. * </ul> * <p> * Callers should also remember that uploaded parts from an interrupted * upload may not always be automatically cleaned up, but callers can use * {@link #abortMultipartUploads(String, Date)} to clean up any upload * parts. WARNING: Do not call on the main thread! * * @param shutDownS3Client Whether to shut down the underlying Amazon S3 * client. */ public void shutdownNow(boolean shutDownS3Client) { threadPool.shutdownNow(); timedThreadPool.shutdownNow(); if (shutDownS3Client) { if (s3 instanceof AmazonS3Client) { ((AmazonS3Client) s3).shutdown(); } } }
/** * {@inheritDoc} * <p> * If the a default internal KMS client has been constructed, it will also be * shut down by calling this method. * Otherwise, users who provided the KMS client would be responsible to * shut down the KMS client extrinsic to this method. */ @Override public void shutdown() { super.shutdown(); if (isKMSClientInternal) kms.shutdown(); }
@Override public void shutdown() { client.shutdown(); }
@Override public void shutdown() { s3Client.shutdown(); }
@Override public void shutdown() { s3client.shutdown(); }
@Override public void shutdown() { s3Client.shutdown(); }
/** * Closes the S3 client if it is completely dereferenced. This is necessary because Hadoop may close the file * system while a stream returned by {@link #open(org.apache.hadoop.fs.Path, int)} is still open. */ private void maybeCloseS3Client(String reason) { LOG.debug("Decremented S3 client reference count for " + reason); if (_stashReaderRefCount.decrementAndGet() == 0) { LOG.debug("Closing S3 client for StashFileSystem at " + _uri); _s3.shutdown(); } }
/** * Closes the S3 client if it is completely dereferenced. This is necessary because Hadoop may close the file * system while a stream returned by {@link #open(org.apache.hadoop.fs.Path, int)} is still open. */ private void maybeCloseS3Client(String reason) { LOG.debug("Decremented S3 client reference count for " + reason); if (_stashReaderRefCount.decrementAndGet() == 0) { LOG.debug("Closing S3 client for StashFileSystem at " + _uri); _s3.shutdown(); } }
@Override protected void doClose() throws ElasticsearchException { for (AmazonS3Client client : clients.values()) { client.shutdown(); } // Ensure that IdleConnectionReaper is shutdown IdleConnectionReaper.shutdown(); } }
@Override public void destroy() { this.shutDown = true; AmazonS3Client conn = this.conn; this.conn = null; if (conn != null) { s3Ops.shutDown(); conn.shutdown(); } }
@Override public void destroy() { this.shutDown = true; AmazonS3Client conn = this.conn; this.conn = null; if (conn != null) { s3Ops.shutDown(); conn.shutdown(); } }
public static boolean checkAuth(String awsAccessKey, String awsSecretKey) { BasicAWSCredentials creds = null; try { creds = new BasicAWSCredentials(awsAccessKey, awsSecretKey); AmazonS3Client s3Service = new AmazonS3Client(creds); s3Service.listBuckets(); s3Service.shutdown(); return true; } catch (Exception e) { SDFSLogger.getLog().fatal("Unable to authenticate to AWS", e); return false; } }
@Override public void close() { // backend is closing. abort all mulitpart uploads from start. if(s3service.doesBucketExist(bucket)) { tmx.abortMultipartUploads(bucket, startTime); } tmx.shutdownNow(); s3service.shutdown(); LOG.info("S3Backend closed."); }
@Override public void close() { // backend is closing. abort all mulitpart uploads from start. if(s3service.doesBucketExist(bucket)) { tmx.abortMultipartUploads(bucket, startTime); } tmx.shutdownNow(); s3service.shutdown(); LOG.info("S3Backend closed."); }
@Override public void close() throws DataStoreException { super.close(); // backend is closing. abort all mulitpart uploads from start. if(s3service.doesBucketExist(bucket)) { tmx.abortMultipartUploads(bucket, startTime); } tmx.shutdownNow(); s3service.shutdown(); LOG.info("S3Backend closed."); }
@Override public void close() throws DataStoreException { super.close(); // backend is closing. abort all mulitpart uploads from start. if(s3service.doesBucketExist(bucket)) { tmx.abortMultipartUploads(bucket, startTime); } tmx.shutdownNow(); s3service.shutdown(); LOG.info("S3Backend closed."); }
@Override protected void after() { if (!isConfigured()) { return; } try { delete(); } finally { temporaryPrefix = null; s3.shutdown(); } }