/** * Shuts down and release all resources. */ public void shutdown() { client.shutdown(); } }
/** * Shuts down and release all resources. */ public void shutdown() { client.shutdown(); } }
@Override public void close() { if (_shutdownOnClose) { _dynamoDb.shutdown(); } }
public void shutdown() { dynamoDB.shutdown(); logger.info("DynamoDB shutdown"); }
@Override public void stop() { try { super.stop(); } finally { try { dynamoClient.shutdown(); } catch (Exception e) { // pass } } }
/** * Stops the client and releases resources. * <b>There's no need to call this explicitly!</b> */ protected static void shutdownClient() { if (ddbClient != null) { ddbClient.shutdown(); ddbClient = null; ddb.shutdown(); ddb = null; } }
/** * Stops the client and releases resources. * <b>There's no need to call this explicitly!</b> */ protected static void shutdownClient() { if (ddbClient != null) { ddbClient.shutdown(); ddbClient = null; ddb.shutdown(); ddb = null; } }
@Override protected void after() { try { client.shutdown(); } catch (Exception e) { e.printStackTrace(); } nativeLibraryRule.after(); } }
@Override public void shutdown() { getBackend().shutdown(); }
@Override public void stop() { super.stop(); if (client != null) { client.shutdown(); } Loggers.MAIN_LOG.info("[DS0105] Stopped DynamoDB store connector for cache {}", getCacheName()); }
public void shutdown() { MetricManager.INSTANCE.getRegistry().remove(executorGaugeName); // TODO(amcp) figure out a way to make the thread pool not be static // https://github.com/awslabs/dynamodb-titan-storage-backend/issues/48 client.shutdown(); }
); } finally { aws.shutdown();
); } finally { aws.shutdown();
@Override public String lock(final String name, final String label) throws IOException { final AmazonDynamoDB aws = this.table.region().aws(); String msg = ""; try { final PutItemRequest request = new PutItemRequest(); request.setTableName(this.table.name()); request.setItem( new Attributes() .with(DyLocks.HASH, this.owner) .with(DyLocks.RANGE, name) .with(DyLocks.ATTR_LABEL, label) ); request.setExpected( new ImmutableMap.Builder<String, ExpectedAttributeValue>().put( DyLocks.ATTR_LABEL, new ExpectedAttributeValue().withExists(false) ).build() ); aws.putItem(request); } catch (final ConditionalCheckFailedException ex) { msg = ex.getLocalizedMessage(); } catch (final AmazonClientException ex) { throw new IOException(ex); } finally { aws.shutdown(); } return msg; }
); } finally { aws.shutdown();
return new QueryValve.NextDosage(this.credentials, rqst, rslt); } finally { aws.shutdown();
return new ScanValve.NextDosage(this.credentials, rqst, rslt); } finally { aws.shutdown();
@Override public int count(final Credentials credentials, final String table, final Map<String, Condition> conditions) { final AmazonDynamoDB aws = credentials.aws(); try { final ScanRequest request = new ScanRequest() .withTableName(table) .withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL) .withScanFilter(conditions) .withSelect(Select.COUNT) .withLimit(Integer.MAX_VALUE); final long start = System.currentTimeMillis(); final ScanResult result = aws.scan(request); final int count = result.getCount(); Logger.info( this, // @checkstyle LineLength (1 line) "#total(): COUNT=%d in '%s' using %s, %s, in %[ms]s", count, request.getTableName(), request.getFilterExpression(), new PrintableConsumedCapacity( result.getConsumedCapacity() ).print(), System.currentTimeMillis() - start ); return count; } finally { aws.shutdown(); } }
@Override public int count(final Credentials credentials, final String table, final Map<String, Condition> conditions) { final AmazonDynamoDB aws = credentials.aws(); try { final ScanRequest request = new ScanRequest() .withTableName(table) .withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL) .withScanFilter(conditions) .withSelect(Select.COUNT) .withLimit(Integer.MAX_VALUE); final long start = System.currentTimeMillis(); final ScanResult result = aws.scan(request); final int count = result.getCount(); Logger.info( this, // @checkstyle LineLength (1 line) "#total(): COUNT=%d in '%s' using %s, %s, in %[ms]s", count, request.getTableName(), request.getFilterExpression(), new PrintableConsumedCapacity( result.getConsumedCapacity() ).print(), System.currentTimeMillis() - start ); return count; } finally { aws.shutdown(); } }