@Override public Table table(final String name) { return this.origin.table( new StringBuilder(this.prefix).append(name).toString() ); } }
@Override public AmazonDynamoDB aws() { return this.origin.aws(); } @Override
@Override public Table table(final String name) { return this.origin.table( new StringBuilder(this.prefix).append(name).toString() ); } }
@Override public AmazonDynamoDB aws() { return this.origin.aws(); } @Override
@Override public Table table(final String name) { try { return Dynamo.live().table(name); } catch (final IOException ex) { throw new IllegalStateException(ex); } }
@Override public AmazonDynamoDB aws() { try { return Dynamo.live().aws(); } catch (final IOException ex) { throw new IllegalStateException(ex); } }
@Override public Locks locks() { return new DyLocks(this.region.table(DyLocks.TBL), this.name); } }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public AmazonDynamoDB aws() { return this.origin.aws(); }
Region region = new Region.Simple(credentials); Table table = region.table("my-table"); Collection<Item> items = table.frame().where("name", "Jeff"); for (Item item : items) { System.out.println(item.get("salary").getS()); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public AmazonDynamoDB aws() { return this.origin.aws(); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public Table table(final String name) { return new ReTable(this.origin.table(name)); } }
/** * Adjusts throughput on the table. */ public void adjust() { this.table .region() .aws() .updateTable( this.table.name(), Throughput.suitableThroughput() ); }
Credentials credentials = new Credentials.Simple("AWS key", "AWS secret"); Region region = new Region.Simple(credentials); Table table = region.table("foo"); Collection<Item> items = table.frame().where("id", Conditions.equalTo(123)); for (Item item : items) { System.out.println(item.get("name").getS()); }
/** * Adjusts throughput on the table. */ public void adjust() { this.table .region() .aws() .updateTable( this.table.name(), Throughput.suitableThroughput() ); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public Table table(final String name) { return new ReTable(this.origin.table(name)); } }
/** * Drop table. * @throws InterruptedException If something fails */ public void drop() throws InterruptedException { final AmazonDynamoDB aws = this.region.aws(); final String name = this.request.getTableName(); aws.deleteTable(new DeleteTableRequest().withTableName(name)); Logger.info(this, "DynamoDB table '%s' deletion requested", name); while (this.exists()) { Logger.info(this, "DynamoDB table '%s' still exists", name); TimeUnit.SECONDS.sleep((long) Tv.TEN); } Logger.info(this, "DynamoDB table '%s' deleted", name); }
Credentials credentials = new Credentials.Simple("AWS key", "AWS secret"); Region region = new Region.Simple(credentials); Table table = region.table("foo"); Collection<Item> items = table.frame().where("id", Conditions.equalTo(123)); for (Item item : items) { System.out.println(item.get("name").getS()); }
/** * Drop table. * @throws InterruptedException If something fails */ public void drop() throws InterruptedException { final AmazonDynamoDB aws = this.region.aws(); final String name = this.request.getTableName(); aws.deleteTable(new DeleteTableRequest().withTableName(name)); Logger.info(this, "DynamoDB table '%s' deletion requested", name); while (this.exists()) { Logger.info(this, "DynamoDB table '%s' still exists", name); TimeUnit.SECONDS.sleep((long) Tv.TEN); } Logger.info(this, "DynamoDB table '%s' deleted", name); }
@Override @Cacheable(lifetime = 1, unit = TimeUnit.HOURS) public Counters counters() { return new DyCounters(this.region.table(DyCounters.TBL), this.name); }
/** * The table exists? * @return TRUE if it exists in DynamoDB * @since 0.9 */ public boolean exists() { final AmazonDynamoDB aws = this.region.aws(); final String name = this.request.getTableName(); boolean exists; try { aws.describeTable(name); exists = true; Logger.info(this, "DynamoDB table '%s' already exists", name); } catch (final ResourceNotFoundException ex) { exists = false; Logger.info( this, "DynamoDB table '%s' doesn't exist: %s", name, ex.getLocalizedMessage() ); } return exists; }