/** * Construct a synchronous implementation of AmazonDynamoDB using the current builder configuration. * * @param params * Current builder configuration represented as a parameter object. * @return Fully configured implementation of AmazonDynamoDB. */ @Override protected AmazonDynamoDB build(AwsSyncClientParams params) { if (endpointDiscoveryEnabled() && getEndpoint() == null) { return new AmazonDynamoDBClient(params, true); } return new AmazonDynamoDBClient(params); }
/** * Create a DynamoDB object that talks to the specified AWS region. The * underlying service client will use all the default client configurations, * including the default credentials provider chain. See * {@link AmazonDynamoDBClient#AmazonDynamoDBClient()} for more information. * <p> * If you need more control over the client configuration, use * {@link DynamoDB#DynamoDB(AmazonDynamoDB)} instead. * * @param regionEnum * the AWS region enum * @see AmazonDynamoDBClient#AmazonDynamoDBClient() */ public DynamoDB(Regions regionEnum) { this(new AmazonDynamoDBClient() .<AmazonDynamoDBClient>withRegion(regionEnum)); }
/** * Create client using credentials provider. This is the preferred way for creating clients */ @Override protected AmazonDynamoDBClient createClient(final ProcessContext context, final AWSCredentialsProvider credentialsProvider, final ClientConfiguration config) { getLogger().debug("Creating client with credentials provider"); final AmazonDynamoDBClient client = new AmazonDynamoDBClient(credentialsProvider, config); return client; }
/** * Create client using AWSCredentials * * @deprecated use {@link #createClient(ProcessContext, AWSCredentialsProvider, ClientConfiguration)} instead */ @Override protected AmazonDynamoDBClient createClient(final ProcessContext context, final AWSCredentials credentials, final ClientConfiguration config) { getLogger().debug("Creating client with aws credentials"); final AmazonDynamoDBClient client = new AmazonDynamoDBClient(credentials, config); return client; }
ClientConfiguration cconfig = new ClientConfiguration(); cconfig.setMaxConnections(maxConnects); dynamoDB = new AmazonDynamoDBClient(credentials, cconfig); dynamoDB.setEndpoint(this.endpoint); primaryKeyName = primaryKey;
@BeforeClass public static void setUp() throws SecurityException, NoSuchMethodException { AmazonDynamoDB dynamo = new AmazonDynamoDBClient(); mapper = new DynamoDBMapper(dynamo); testedMethod = DynamoDBMapper.class.getDeclaredMethod("createQueryRequestFromExpression", Class.class, DynamoDBQueryExpression.class, DynamoDBMapperConfig.class); testedMethod.setAccessible(true); }
@Inject public DynamodbUserStorage(AWSConfig config, DynamodbUserConfig tableConfig) { dynamoDBClient = new AmazonDynamoDBClient(config.getCredentials()); dynamoDBClient.setRegion(config.getAWSRegion()); if (config.getDynamodbEndpoint() != null) { dynamoDBClient.setEndpoint(config.getDynamodbEndpoint()); } this.tableConfig = tableConfig; }
@Inject public DynamodbMetastore(AWSConfig config, DynamodbMetastoreConfig tableConfig, FieldDependencyBuilder.FieldDependency fieldDependency, EventBus eventBus) { super(eventBus); dynamoDBClient = new AmazonDynamoDBClient(config.getCredentials()); dynamoDBClient.setRegion(config.getAWSRegion()); if (config.getDynamodbEndpoint() != null) { dynamoDBClient.setEndpoint(config.getDynamodbEndpoint()); } this.tableConfig = tableConfig; }
@Inject public DynamodbConfigManager(AWSConfig config, DynamodbConfigManagerConfig tableConfig) { dynamoDBClient = new AmazonDynamoDBClient(config.getCredentials()); dynamoDBClient.setRegion(config.getAWSRegion()); if (config.getDynamodbEndpoint() != null) { dynamoDBClient.setEndpoint(config.getDynamodbEndpoint()); } this.tableConfig = tableConfig; }
@Inject public DynamodbQueryMetastore(AWSConfig config, DynamodbQueryMetastoreConfig tableConfig) { dynamoDBClient = new AmazonDynamoDBClient(config.getCredentials()); dynamoDBClient.setRegion(config.getAWSRegion()); if (config.getDynamodbEndpoint() != null) { dynamoDBClient.setEndpoint(config.getDynamodbEndpoint()); } this.tableConfig = tableConfig; }
private static void createClient() throws IOException { AWSCredentials credentials = new PropertiesCredentials( LowLevelBatchWriteSyntax.class.getResourceAsStream("AwsCredentials.properties")); client = new AmazonDynamoDBClient(credentials); }
public DynamoDBEmitter(KinesisConnectorConfiguration configuration) { // Amazon DynamoDB Config this.dynamoDBEndpoint = configuration.DYNAMODB_ENDPOINT; this.dynamoDBTableName = configuration.DYNAMODB_DATA_TABLE_NAME; // Client this.dynamoDBClient = new AmazonDynamoDBClient(configuration.AWS_CREDENTIALS_PROVIDER); this.dynamoDBClient.setEndpoint(this.dynamoDBEndpoint); }
AmazonDynamoDB dynamoClient = new AmazonDynamoDBClient(); DynamoDB dynamoDB = new DynamoDB(dynamoClient); Table table = dynamoDB.getTable("MyTable"); Long readCapacityUnits = table.describe() .getProvisionedThroughput().getReadCapacityUnits();
@Override public IRecordProcessor createProcessor() { AmazonDynamoDBClient dynamoDBClient = new AmazonDynamoDBClient(dynamoDBCredentials, new ClientConfiguration()); dynamoDBClient.setEndpoint(dynamoDBEndpoint); return new StreamsRecordProcessor(dynamoDBClient, tableName); }
/** * Initializes the instance components if needed. */ private void initializeComponents() { if (amazonDynamoDBClient == null) { amazonDynamoDBClient = new AmazonDynamoDBClient(); scoreKeeperManager = new ScoreKeeperManager(amazonDynamoDBClient); skillContext = new SkillContext(); } } }
/** * Initializes the instance components if needed. */ private void initializeComponents() { if (amazonDynamoDBClient == null) { amazonDynamoDBClient = new AmazonDynamoDBClient(); scoreKeeperManager = new ScoreKeeperManager(amazonDynamoDBClient); skillContext = new SkillContext(); } } }
private AmazonDynamoDBClient getDynamoDBClient(Configuration conf) { ClientConfiguration clientConfig = new ClientConfiguration().withMaxErrorRetry(1); applyProxyConfiguration(clientConfig, conf); return new AmazonDynamoDBClient(getAWSCredentialsProvider(conf), clientConfig); }
public static void main(String[] args) { AmazonDynamoDBClient client = new AmazonDynamoDBClient(); client.setEndpoint("http://localhost:8000"); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.getTable("Movies"); table.delete(); System.out.println("Table is being deleted"); } }
private AmazonDynamoDBClient createDynamoClient() { AWSCredentialsProvider credentialsProvider = initCredentials(); ClientConfiguration clientConfiguration = initClientConfiguration(); AmazonDynamoDBClient dynamoClient = new AmazonDynamoDBClient(credentialsProvider, clientConfiguration); if (this.regionId != null) { dynamoClient.setRegion(RegionUtils.getRegion(this.regionId)); } if (this.endpoint != null) { dynamoClient.setEndpoint(this.endpoint); } return dynamoClient; }
public DynamoDBService(Tenant tenant) { super(tenant); m_retry_wait_millis = getParamInt("retry_wait_millis", 5000); m_max_commit_attempts = getParamInt("max_commit_attempts", 10); m_max_read_attempts = getParamInt("max_read_attempts", 3); m_tenantPrefix = Utils.isEmpty(tenant.getNamespace()) ? "" : tenant.getNamespace() + "_"; m_ddbClient = new AmazonDynamoDBClient(getCredentials()); setRegionOrEndPoint(); setDefaultCapacity(); // TODO: Do something to test connection? }