• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AmazonDynamoDBClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.dynamodb.AmazonDynamoDBClient的典型用法代码示例。如果您正苦于以下问题:Java AmazonDynamoDBClient类的具体用法?Java AmazonDynamoDBClient怎么用?Java AmazonDynamoDBClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AmazonDynamoDBClient类属于com.amazonaws.services.dynamodb包,在下文中一共展示了AmazonDynamoDBClient类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getClient

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
/**
  * Method to create the specific client to be used
  * @param clientType
  * @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;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:14,代码来源:DynamoDBStore.java


示例2: DynamoDBStorage

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
DynamoDBStorage(String tableName, String awsAccessKeyId, String awsSecretKey, 
        AmazonDynamoDBClient dynamo, HadoopJobInfo hadoopJobInfo) {
    this.tableName = tableName;
    this.awsAccessKeyId = awsAccessKeyId;
    this.awsSecretKey = awsSecretKey;
    this.dynamo = dynamo;
    this.hadoopJobInfo = hadoopJobInfo;
}
 
开发者ID:mortardata,项目名称:pig-dynamodb,代码行数:9,代码来源:DynamoDBStorage.java


示例3: loadDynamoDB

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
private AmazonDynamoDBClient loadDynamoDB() {
    if (this.dynamo == null) {
        this.dynamo = new AmazonDynamoDBClient(new BasicAWSCredentials(
                this.awsAccessKeyId, this.awsSecretKey));
    }
    return this.dynamo;
}
 
开发者ID:mortardata,项目名称:pig-dynamodb,代码行数:8,代码来源:DynamoDBStorage.java


示例4: testMissingPrimaryKey

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
@Test
public void testMissingPrimaryKey() throws IOException, InterruptedException {
    String tableName = "mortar_test_foo_table";
    String awsAccessKeyId = "XXXXXXXXXXXXX";
    String awsSecretKey = "YYYYYYYYYYYYYY";
    ResourceSchema schema = 
            new ResourceSchema(Utils.getSchemaFromString("my_field:int"));
    
 // mock dynamo client
    AmazonDynamoDBClient dynamo = mock(AmazonDynamoDBClient.class);
    DescribeTableResult describeResult = new DescribeTableResult()
        .withTable(
            new TableDescription()
                .withProvisionedThroughput(
                    new ProvisionedThroughputDescription().withWriteCapacityUnits(50L))
                .withKeySchema(new KeySchema()
                    .withHashKeyElement(new KeySchemaElement()
                        .withAttributeName("not_the_key_you_will_find")
                        .withAttributeType(ScalarAttributeType.N))));
             
    when(dynamo.describeTable(any(DescribeTableRequest.class))).thenReturn(describeResult);
    DynamoDBStorage storage = 
            new DynamoDBStorage(tableName, awsAccessKeyId, awsSecretKey, dynamo, null);
    try {
        storage.checkSchema(schema);
        Assert.fail("Expected schema validation to fail");
    } catch(IOException e) {
        Assert.assertTrue("Expected " + e.getMessage() + " to contain hash msg", e.getMessage().contains("hash primary key"));
    }
}
 
开发者ID:mortardata,项目名称:pig-dynamodb,代码行数:31,代码来源:TestDynamoDBStorage.java


示例5: initalize

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
/**
 * Creates the metastore table in DynamoDB if it doesn't exist with the configured
 * read and write units.
 * 
 * @param uri
 * @param conf
 * @throws Exception 
 */
@Override
public void initalize(URI uri, Configuration conf) throws Exception {
    scheme = uri.getScheme();
    
    String keyId = conf.get("fs."+uri.getScheme()+".awsAccessKeyId");
    String keySecret = conf.get("fs."+uri.getScheme()+".awsSecretAccessKey");
    
    //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);
    timeout = conf.getInt("s3mper.metastore.timeout", timeout);
    
    tableName = conf.get("s3mper.metastore.name", tableName);
    
    deleteMarkerEnabled = conf.getBoolean("s3mper.metastore.deleteMarker.enabled", false);
    
    boolean checkTableExists = conf.getBoolean("s3mper.metastore.create", false);
    
    if(checkTableExists) {
        ListTablesResult tables = db.listTables();
        
        if(!tables.getTableNames().contains(tableName)) {
            createTable();
        }
    }
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:42,代码来源:DynamoDBMetastore.java


示例6: initalize

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public void initalize(URI uri, Configuration conf) throws Exception {
    String keyId = conf.get("fs."+uri.getScheme()+".awsAccessKeyId");
    String keySecret = conf.get("fs."+uri.getScheme()+".awsSecretAccessKey");
    
    //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);
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:16,代码来源:MetastoreJanitor.java


示例7: TimeseriesScannerTask

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public TimeseriesScannerTask(AmazonDynamoDBClient db, RateLimiter limiter, BlockingQueue<Key> deleteQueue, int queueSize, long age) {
    super(db, limiter);
    this.deleteQueue = deleteQueue;
    this.queueSize = queueSize;
    this.age = age;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:7,代码来源:TimeseriesScannerTask.java


示例8: AbstractScannerTask

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public AbstractScannerTask(AmazonDynamoDBClient db, RateLimiter limiter) {
    super(db, limiter);
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:4,代码来源:AbstractScannerTask.java


示例9: PathScannerTask

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public PathScannerTask(AmazonDynamoDBClient db, RateLimiter limiter, BlockingQueue<Key> deleteQueue, int queueSize, long age) {
    super(db, limiter);
    this.deleteQueue = deleteQueue;
    this.age = age;
    this.queueSize = queueSize;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:7,代码来源:PathScannerTask.java


示例10: DeleteWriterTask

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public DeleteWriterTask(AmazonDynamoDBClient db, RateLimiter limiter, BlockingQueue<Key> deleteQueue) {
    super(db, limiter);
    this.deleteQueue = deleteQueue;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:5,代码来源:DeleteWriterTask.java


示例11: AbstractDynamoDBTask

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public AbstractDynamoDBTask(AmazonDynamoDBClient db, RateLimiter limiter) {
    this.db = db;
    this.limiter = limiter;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:5,代码来源:AbstractDynamoDBTask.java


示例12: getDb

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public AmazonDynamoDBClient getDb() {
    return db;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:4,代码来源:AbstractDynamoDBTask.java


示例13: setDb

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
public void setDb(AmazonDynamoDBClient db) {
    this.db = db;
}
 
开发者ID:Netflix,项目名称:s3mper,代码行数:4,代码来源:AbstractDynamoDBTask.java


示例14: getDynamoDBClient

import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; //导入依赖的package包/类
/**
 * Gets DynamoDBClient to be used
 * @return
 */
public AmazonDynamoDBClient getDynamoDBClient() {
  return dynamoDBClient;
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:8,代码来源:GoraDynamoDBTestDriver.java



注:本文中的com.amazonaws.services.dynamodb.AmazonDynamoDBClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TDoubleDoubleMap类代码示例发布时间:2022-05-23
下一篇:
Java DescribeInstanceAttributeRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap