本文整理汇总了Java中com.jcabi.dynamo.retry.ReRegion类的典型用法代码示例。如果您正苦于以下问题:Java ReRegion类的具体用法?Java ReRegion怎么用?Java ReRegion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReRegion类属于com.jcabi.dynamo.retry包,在下文中一共展示了ReRegion类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: connect
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Connect.
* @return Region
*/
private static Region connect() {
final String key = Manifests.read("Rehttp-DynamoKey");
final Credentials creds = new Credentials.Simple(
key, Manifests.read("Rehttp-DynamoSecret")
);
final Region region;
if (key.startsWith("AAAAA")) {
final int port = Integer.parseInt(
System.getProperty("dynamo.port")
);
region = new Region.Simple(new Credentials.Direct(creds, port));
Logger.warn(Entrance.class, "Test DynamoDB at port #%d", port);
} else {
region = new Region.Prefixed(
new ReRegion(new Region.Simple(creds)),
"rehttp-"
);
}
Logger.info(Entrance.class, "DynamoDB connected as %s", key);
return region;
}
开发者ID:yegor256,项目名称:rehttp,代码行数:26,代码来源:Dynamo.java
示例2: connect
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Connect.
* @return Region
*/
private static Region connect() {
final String key = Manifests.read("ThreeCopies-DynamoKey");
final Credentials creds = new Credentials.Simple(
key, Manifests.read("ThreeCopies-DynamoSecret")
);
final Region region;
if (key.startsWith("AAAAA")) {
final int port = Integer.parseInt(
System.getProperty("dynamo.port")
);
region = new Region.Simple(new Credentials.Direct(creds, port));
Logger.warn(Dynamo.class, "Test DynamoDB at port #%d", port);
} else {
region = new Region.Prefixed(
new ReRegion(new Region.Simple(creds)),
"tc-"
);
}
Logger.info(Dynamo.class, "DynamoDB connected as %s", key);
return region;
}
开发者ID:yegor256,项目名称:threecopies,代码行数:26,代码来源:Dynamo.java
示例3: connect
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Connect.
* @return Region
*/
private static Region connect() {
final String key = Manifests.read("Jare-DynamoKey");
final Credentials creds = new Credentials.Simple(
key, Manifests.read("Jare-DynamoSecret")
);
final Region region;
if (key.startsWith("AAAAA")) {
final int port = Integer.parseInt(
System.getProperty("dynamo.port")
);
region = new Region.Simple(new Credentials.Direct(creds, port));
Logger.warn(Dynamo.class, "test DynamoDB at port #%d", port);
} else {
region = new Region.Prefixed(
new ReRegion(new Region.Simple(creds)),
"jare-"
);
}
Logger.info(Dynamo.class, "DynamoDB connected as %s", key);
return region;
}
开发者ID:yegor256,项目名称:jare,代码行数:26,代码来源:Dynamo.java
示例4: dynamo
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Dynamo DB region.
* @return Region
*/
private static Region dynamo() {
final String key = Manifests.read("Thindeck-DynamoKey");
Credentials creds = new Credentials.Simple(
key, Manifests.read("Thindeck-DynamoSecret")
);
if (key.startsWith("AAAAA")) {
final String port = System.getProperty("dynamo.port");
if (port == null) {
throw new IllegalStateException(
"dynamo.port system property is not set, check pom.xml"
);
}
creds = new Credentials.Direct(
creds,
Integer.parseInt(port)
);
}
return new Region.Prefixed(
new ReRegion(new Region.Simple(creds)), "td-"
);
}
开发者ID:yegor256,项目名称:thindeck,代码行数:26,代码来源:DyBase.java
示例5: dynamo
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Dynamo DB region.
* @return Region
*/
private Region dynamo() {
final String key = Manifests.read("Bib-DynamoKey");
Credentials creds = new Credentials.Simple(
key,
Manifests.read("Bib-DynamoSecret")
);
if (key.startsWith("AAAAA")) {
final int port = Integer.parseInt(
System.getProperty("dynamo.port")
);
creds = new Credentials.Direct(creds, port);
Logger.warn(this, "test DynamoDB at port #%d", port);
}
return new Region.Prefixed(
new ReRegion(new Region.Simple(creds)), "bib-"
);
}
开发者ID:yegor256,项目名称:bibrarian,代码行数:22,代码来源:Lifespan.java
示例6: region
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* DynamoDB region for tests.
* @return Region
*/
public Region region() {
final String key = Manifests.read("Bib-DynamoKey");
MatcherAssert.assertThat(key.startsWith("AAAA"), Matchers.is(true));
return new Region.Prefixed(
new ReRegion(
new Region.Simple(
new Credentials.Direct(
new Credentials.Simple(
key,
Manifests.read("Bib-DynamoSecret")
),
Integer.parseInt(System.getProperty("dynamo.port"))
)
)
),
"bib-"
);
}
开发者ID:yegor256,项目名称:bibrarian,代码行数:23,代码来源:DynamoRule.java
示例7: connect
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Connect.
* @return Region
*/
private static Region connect() {
final String key = Manifests.read("Wring-DynamoKey");
final Credentials creds = new Credentials.Simple(
key,
Manifests.read("Wring-DynamoSecret")
);
final Region region;
if (key.startsWith("AAAAA")) {
final String property = System.getProperty("dynamo.port");
if (property == null) {
throw new IllegalStateException(
"You're not supposed to run this test outside of Maven"
);
}
final int port = Integer.parseInt(property);
region = new Region.Simple(new Credentials.Direct(creds, port));
Logger.warn(Dynamo.class, "test DynamoDB at port #%d", port);
} else {
region = new Region.Prefixed(
new ReRegion(new Region.Simple(creds)),
"wring-"
);
}
Logger.info(Dynamo.class, "DynamoDB connected as %s", key);
return region;
}
开发者ID:yegor256,项目名称:wring,代码行数:31,代码来源:Dynamo.java
示例8: get
import com.jcabi.dynamo.retry.ReRegion; //导入依赖的package包/类
/**
* Get region with a table.
* @param table Table name
* @return Region
* @throws Exception If fails
*/
public Region get(final String table) throws Exception {
final Region region = new Region.Simple(
new Credentials.Direct(Credentials.TEST, this.prt)
);
final MadeTable mocker = new MadeTable(
region,
new CreateTableRequest()
.withTableName(table)
.withProvisionedThroughput(
new ProvisionedThroughput()
.withReadCapacityUnits(1L)
.withWriteCapacityUnits(1L)
)
.withAttributeDefinitions(
new AttributeDefinition()
.withAttributeName(this.ahash)
.withAttributeType(ScalarAttributeType.S),
new AttributeDefinition()
.withAttributeName(this.arange)
.withAttributeType(ScalarAttributeType.N)
)
.withKeySchema(
new KeySchemaElement()
.withAttributeName(this.ahash)
.withKeyType(KeyType.HASH),
new KeySchemaElement()
.withAttributeName(this.arange)
.withKeyType(KeyType.RANGE)
)
);
mocker.create();
mocker.createIfAbsent();
return new ReRegion(region);
}
开发者ID:jcabi,项目名称:jcabi-dynamo,代码行数:41,代码来源:RegionMock.java
注:本文中的com.jcabi.dynamo.retry.ReRegion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论