server.start(); amazonDynamoDB = new AmazonDynamoDBClient(new BasicAWSCredentials("access", "secret")); amazonDynamoDB.setEndpoint("http://localhost:" + port); } catch (Exception e) { throw new RuntimeException(e);
@Override public AmazonDynamoDB aws() { final AmazonDynamoDB aws = this.origin.aws(); aws.setEndpoint(this.endpoint); return aws; } }
@Override public void setEndpoint(String request) throws IllegalArgumentException { getBackend().setEndpoint(request); }
private void setEndpoint() { String endpoint = endpointName.get(); dbClient.setEndpoint(endpoint); log.info("Set Dynamo endpoint:" + endpoint); } }
@Override public AmazonDynamoDB aws() { final AmazonDynamoDB aws = this.origin.aws(); aws.setEndpoint(this.endpoint); return aws; } }
private void setDynamoDBProperties(Properties properties) throws IOException { setSerializationType(properties.getProperty(SERIALIZATION_TYPE)); PropertiesCredentials creds = DynamoDBUtils.getCredentials(this.getClass()); setPreferredSchema(properties.getProperty(PREF_SCH_NAME)); setDynamoDBClient(DynamoDBUtils.getClient( properties.getProperty(CLI_TYP_PROP), creds)); getDynamoDBClient().setEndpoint(properties.getProperty(ENDPOINT_PROP)); setDynamoDbMapping(readMapping()); setConsistency(properties.getProperty(CONSISTENCY_READS)); }
/** * Creates tables. * @throws IOException if something goes wrong */ public void create() throws IOException { final AmazonDynamoDB aws = new AmazonDynamoDBClient( new BasicAWSCredentials(this.key, this.secret) ); aws.setEndpoint(String.format("%s:%d", this.endpoint, this.port)); for (final String table : this.locations) { final JsonObject json = this.readJson(table); if (json.containsKey("TableName")) { final String name = json.getString("TableName"); if (Tables.exists(aws, name)) { Logger.info( this, "Table '%s' already exists, skipping...", name ); } else { this.createTable(aws, json); } } else { throw new IOException( String.format( "File '%s' does not specify TableName attribute", table ) ); } } }
new AmazonDynamoDBClient(Client.createAWSCredentialsProvider(config.getDynamodbCredentialsFqClassName(), config.getDynamodbCredentialsCtorArguments() == null ? null : config.getDynamodbCredentialsCtorArguments().split(","))); client.setEndpoint(config.getDynamodbEndpoint()); for(CreateTableRequest request : requests) { try {