@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public String name() { return this.origin.name(); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public String name() { return this.origin.name(); }
/** * Adjusts throughput on the table. */ public void adjust() { this.table .region() .aws() .updateTable( this.table.name(), Throughput.suitableThroughput() ); }
/** * Adjusts throughput on the table. */ public void adjust() { this.table .region() .aws() .updateTable( this.table.name(), Throughput.suitableThroughput() ); }
@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; }