Package com.amazonaws.services.dynamodb

Examples of com.amazonaws.services.dynamodb.AmazonDynamoDBClient


    * @param credentials
    * @return
    */
  public AmazonDynamoDB getClient(String clientType, AWSCredentials credentials){
    if (clientType.equals("sync"))
      return new AmazonDynamoDBClient(credentials);
    if (clientType.equals("async"))
      return new AmazonDynamoDBAsyncClient(credentials);
    return null;
  }
View Full Code Here


    }

    AmazonDynamoDB createDdbClient() {
        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(),
                configuration.getSecretKey());
        AmazonDynamoDB client = new AmazonDynamoDBClient(credentials);
        if (configuration.getAmazonDdbEndpoint() != null) {
            client.setEndpoint(configuration.getAmazonDdbEndpoint());
        }
        configuration.setAmazonDDBClient(client);
        return client;
    }
View Full Code Here

    * @param credentials
    * @return
    */
  public AmazonDynamoDB getClient(String clientType, AWSCredentials credentials){
    if (clientType.equals("sync"))
      return new AmazonDynamoDBClient(credentials);
    if (clientType.equals("async"))
      return new AmazonDynamoDBAsyncClient(credentials);
    return null;
  }
View Full Code Here

    }

    AmazonDynamoDB createDdbClient() {
        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(),
                configuration.getSecretKey());
        AmazonDynamoDB client = new AmazonDynamoDBClient(credentials);
        return client;
    }
View Full Code Here


    // AWS Access Key ID and Secret Access Key
    public DynamoDBService(Jsoda jsoda, AWSCredentials cred) {
        this.jsoda = jsoda;
        this.ddbClient = new AmazonDynamoDBClient(cred);
    }
View Full Code Here

        if (start.compareTo(end) > 0) {
            return 0;
        }
        S3StorageConfiguration storageConfiguration = (S3StorageConfiguration) BaseEntity.initializeAndUnproxy(orgStorageConfig.getStorageConfigurations().get(0));
        com.amazonaws.auth.AWSCredentials credentials = new BasicAWSCredentials(storageConfiguration.getAccessKey(), storageConfiguration.getSecretKey());
        AmazonDynamoDBClient dynamoDB = new AmazonDynamoDBClient(credentials);

        //TODO get hash key and range key names from table description
        HashMap<String, Condition> scanFilter = new HashMap<String, Condition>();
        Condition hashCondition = new Condition()
                .withComparisonOperator(ComparisonOperator.EQ.toString())
                .withAttributeValueList(new AttributeValue().withS(orgStorageConfig.getPrefix()));
        scanFilter.put("bucket_prefix", hashCondition);

        Condition rangeCondition = getRangeCondition(start, end);
        scanFilter.put("time", rangeCondition);

        ScanRequest scanRequest = new ScanRequest(bandwidthTableName).withScanFilter(scanFilter);
        ScanResult scanResult;
        try {
            scanResult = dynamoDB.scan(scanRequest);
        } catch (Exception e) {
            log.error("Error scanning DynamoDB table: " + bandwidthTableName, e);
            return 0;
        }
View Full Code Here

    * @param credentials
    * @return
    */
  public AmazonDynamoDB getClient(String clientType, AWSCredentials credentials){
    if (clientType.equals("sync"))
      return new AmazonDynamoDBClient(credentials);
    if (clientType.equals("async"))
      return new AmazonDynamoDBAsyncClient(credentials);
    return null;
  }
View Full Code Here

        try {
            AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile));
            ClientConfiguration cconfig = new ClientConfiguration();
            cconfig.setMaxConnections(maxConnects);
            dynamoDB = new AmazonDynamoDBClient(credentials,cconfig);
            dynamoDB.setEndpoint(this.endpoint);
            primaryKeyName = primaryKey;
            logger.info("dynamodb connection created with " + this.endpoint);
        } catch (Exception e1) {
            String errMsg = "DynamoDBClient.init(): Could not initialize DynamoDB client: " + e1.getMessage();
View Full Code Here

       
        //An override option for accessing across accounts
        keyId = conf.get("s3mper.override.awsAccessKeyId", keyId);
        keySecret = conf.get("s3mper.override.awsSecretAccessKey", keySecret);
       
        db = new AmazonDynamoDBClient(new BasicAWSCredentials(keyId, keySecret));
       
        readUnits = conf.getLong("s3mper.metastore.read.units", readUnits);
        writeUnits = conf.getLong("s3mper.metastore.write.units", writeUnits);
       
        retryCount = conf.getInt("s3mper.metastore.retry", retryCount);
View Full Code Here

       
        //An override option for accessing across accounts
        keyId = conf.get("s3mper.override.awsAccessKeyId", keyId);
        keySecret = conf.get("s3mper.override.awsSecretAccessKey", keySecret);
       
        db = new AmazonDynamoDBClient(new BasicAWSCredentials(keyId, keySecret));
       
        tableName = conf.get("s3mper.metastore.name", tableName);
       
        metastore = new DynamoDBMetastore();
        metastore.initalize(uri, conf);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.AmazonDynamoDBClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.