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

Java DynamoDBEmbedded类代码示例

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

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



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

示例1: setup

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
/**
 * setup
 */
@Before
public void setup() {
    // Create an in-memory and in-process instance of DynamoDB Local that skips HTTP
    dynamodbClient = DynamoDBEmbedded.create().amazonDynamoDB();

    // Create and verify table
    final CreateTableResult createTableResult = createTable();
    assertEquals(TABLE_NAME, createTableResult.getTableDescription().getTableName());
}
 
开发者ID:duraspace,项目名称:lambdora,代码行数:13,代码来源:IntegrationTestBase.java


示例2: createInMemoryDb

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
public static AmazonDynamoDB createInMemoryDb() {
    AmazonDynamoDB dynamodb = null;
    try {
        // Create an in-memory and in-process instance of DynamoDB Local
        AmazonDynamoDBLocal amazonDynamoDBLocal = DynamoDBEmbedded.create();
        dynamodb = amazonDynamoDBLocal.amazonDynamoDB();
        return dynamodb;
    } catch (Exception e){
        if(dynamodb != null)
            dynamodb.shutdown();// Shutdown the thread pools in DynamoDB Local / Embedded
    }
    return dynamodb;
}
 
开发者ID:satr,项目名称:aws-amazon-shopping-bot-lambda-func,代码行数:14,代码来源:ObjectMother.java


示例3: beforeClass

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() {
    sDynamoDB = DynamoDBEmbedded.create().amazonDynamoDB();
    sDynamoDBMapper = new DynamoDBMapper(sDynamoDB);
    sDynamoDBRepository = new DynamoDBRepository();
    sDynamoDBRepository.setDynamoDBMapper(sDynamoDBMapper);
    sDynamoDBRepository.setLockDurationMs(LOCK_DURATION_MS);
}
 
开发者ID:milton0825,项目名称:plano,代码行数:9,代码来源:DynamoDBRepositoryTests.java


示例4: before

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Override
protected void before() throws Throwable {
    try {
        amazonDynamoDB = DynamoDBEmbedded.create().amazonDynamoDB();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:vvondra,项目名称:fleet-cron,代码行数:9,代码来源:LocalDynamoDbRule.java


示例5: before

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Override
protected void before() throws Throwable {
  nativeLibraryRule.before();
  System.setProperty("sqlite4java.library.path", nativeLibraryRule.getNativeLibrariesFolder().toString());

  client = DynamoDBEmbedded.create().amazonDynamoDB();
}
 
开发者ID:mlk,项目名称:AssortmentOfJUnitRules,代码行数:8,代码来源:LocalDynamoDbRule.java


示例6: setup

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Before
public void setup() {
    methodCalls = new HashMap<String, Integer>();
    client = instrument(DynamoDBEmbedded.create(), AmazonDynamoDB.class, methodCalls);
    MetaStore.createTable(client, TABLE_NAME, new ProvisionedThroughput(1L, 1L));
    store = new MetaStore(client, TABLE_NAME, ENCRYPTOR);
    ctx = new EncryptionContext.Builder().build();
    methodCalls.clear();
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-encryption-java,代码行数:10,代码来源:MostRecentProviderTests.java


示例7: setup

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Before
public void setup() {
    client = synchronize(DynamoDBEmbedded.create(), AmazonDynamoDB.class);
    MetaStore.createTable(client, TABLE_NAME, new ProvisionedThroughput(1L, 1L));
    store = new MetaStore(client, TABLE_NAME, ENCRYPTOR);
    ctx = new EncryptionContext.Builder().build();
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-encryption-java,代码行数:8,代码来源:MetaStoreTests.java


示例8: setUp

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Before
public void setUp() {
    client = DynamoDBEmbedded.create();
    
    ArrayList<AttributeDefinition> attrDef = new ArrayList<AttributeDefinition>();
    attrDef.add(new AttributeDefinition().withAttributeName("hashKey").withAttributeType(ScalarAttributeType.N));
    attrDef.add(new AttributeDefinition().withAttributeName("rangeKey").withAttributeType(ScalarAttributeType.N));
    
    ArrayList<KeySchemaElement> keySchema = new ArrayList<KeySchemaElement>();
    keySchema.add(new KeySchemaElement().withAttributeName("hashKey").withKeyType(KeyType.HASH));
    keySchema.add(new KeySchemaElement().withAttributeName("rangeKey").withKeyType(KeyType.RANGE));
    
    client.createTable(new CreateTableRequest().withTableName("TableName")
            .withAttributeDefinitions(attrDef)
            .withKeySchema(keySchema)
            .withProvisionedThroughput(new ProvisionedThroughput(100L, 100L)));
    
    attrDef = new ArrayList<AttributeDefinition>();
    attrDef.add(new AttributeDefinition().withAttributeName("hashKey").withAttributeType(ScalarAttributeType.S));
    keySchema = new ArrayList<KeySchemaElement>();
    keySchema.add(new KeySchemaElement().withAttributeName("hashKey").withKeyType(KeyType.HASH));
    
    client.createTable(new CreateTableRequest().withTableName("HashKeyOnly")
            .withAttributeDefinitions(attrDef)
            .withKeySchema(keySchema)
            .withProvisionedThroughput(new ProvisionedThroughput(100L, 100L)));
    
    attrDef = new ArrayList<AttributeDefinition>();
    attrDef.add(new AttributeDefinition().withAttributeName("hashKey").withAttributeType(ScalarAttributeType.B));
    attrDef.add(new AttributeDefinition().withAttributeName("rangeKey").withAttributeType(ScalarAttributeType.N));
    
    keySchema = new ArrayList<KeySchemaElement>();
    keySchema.add(new KeySchemaElement().withAttributeName("hashKey").withKeyType(KeyType.HASH));
    keySchema.add(new KeySchemaElement().withAttributeName("rangeKey").withKeyType(KeyType.RANGE));
    
    client.createTable(new CreateTableRequest().withTableName("DeterministicTable")
            .withAttributeDefinitions(attrDef)
            .withKeySchema(keySchema)
            .withProvisionedThroughput(new ProvisionedThroughput(100L, 100L)));
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-encryption-java,代码行数:41,代码来源:TransformerHolisticTests.java


示例9: main

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
/**
 * You can use mvn to run DynamoDBLocalFixture, e.g.
 * <p>
 * $ mvn clean package
 * <p>
 * $ mvn exec:java -Dexec.mainClass="com.amazonaws.services.dynamodbv2.DynamoDBLocalFixture" \
 * -Dexec.classpathScope="test" \
 * -Dsqlite4java.library.path=target/dependencies
 * <p>
 * It's recommended to run "aws configure" one time before you run DynamoDBLocalFixture
 *
 * @param args - no args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
    AmazonDynamoDB dynamodb = null;
    try {
        // Create an in-memory and in-process instance of DynamoDB Local that skips HTTP
        dynamodb = DynamoDBEmbedded.create().amazonDynamoDB();
        // use the DynamoDB API with DynamoDBEmbedded
        listTables(dynamodb.listTables(), "DynamoDB Embedded");
    } finally {
        // Shutdown the thread pools in DynamoDB Local / Embedded
        if(dynamodb != null) {
            dynamodb.shutdown();
        }
    }
    
    // Create an in-memory and in-process instance of DynamoDB Local that runs over HTTP
    final String[] localArgs = { "-inMemory" };
    DynamoDBProxyServer server = null;
    try {
        server = ServerRunner.createServerFromCommandLineArgs(localArgs);
        server.start();

        dynamodb = AmazonDynamoDBClientBuilder.standard().withEndpointConfiguration(
            // we can use any region here
            new AwsClientBuilder.EndpointConfiguration("http://localhost:8000", "us-west-2"))
            .build();

        // use the DynamoDB API over HTTP
        listTables(dynamodb.listTables(), "DynamoDB Local over HTTP");
    } finally {
        // Stop the DynamoDB Local endpoint
        if(server != null) {
            server.stop();
        }
    }
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-examples,代码行数:50,代码来源:DynamoDBLocalFixture.java


示例10: CloudNoticeDAO

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
public CloudNoticeDAO(boolean local) {
    ddb = local ? DynamoDBEmbedded.create().amazonDynamoDB()
            : AmazonDynamoDBClientBuilder.defaultClient();
    verifyTables();
    mapper = new DynamoDBMapper(ddb);
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:7,代码来源:CloudNoticeDAO.java


示例11: createAmazonDynamoDBLocal

import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded; //导入依赖的package包/类
@Bean
@Primary
public AmazonDynamoDB createAmazonDynamoDBLocal() throws Exception {
    return DynamoDBEmbedded.create().amazonDynamoDB();
}
 
开发者ID:milton0825,项目名称:plano,代码行数:6,代码来源:PlanoApplicationDynamoDBTests.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ProgressWindow类代码示例发布时间:2022-05-23
下一篇:
Java StringComparable类代码示例发布时间: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