本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.Select类的典型用法代码示例。如果您正苦于以下问题:Java Select类的具体用法?Java Select怎么用?Java Select使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Select类属于com.amazonaws.services.dynamodbv2.model包,在下文中一共展示了Select类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: details
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Directive> details(final long time) throws IOException {
final Iterator<Item> items = this.table()
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(1)
)
.where("url", Conditions.equalTo(this.url))
.where("time", Conditions.equalTo(time))
.iterator();
if (!items.hasNext()) {
throw new IllegalArgumentException(
String.format(
"Request at %d for %s not found",
time, this.url
)
);
}
return DyStatus.xembly(items.next(), true);
}
示例2: expired
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Take> expired() {
return new Mapped<>(
this.table()
.frame()
.through(
new QueryValve()
.withIndexName("expired")
.withConsistentRead(false)
.withSelect(Select.ALL_ATTRIBUTES)
)
.where("success", Conditions.equalTo(Boolean.toString(false)))
.where(
"when",
new Condition()
.withComparisonOperator(ComparisonOperator.LT)
.withAttributeValueList(
new AttributeValue().withN(
Long.toString(System.currentTimeMillis())
)
)
),
item -> new DyTake(item, this.delay)
);
}
示例3: scripts
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Iterable<Directive>> scripts() {
return new Mapped<Item, Iterable<Directive>>(
item -> new Directives()
.add("script")
.add("name").set(item.get("name").getS()).up()
.add("bash").set(item.get("bash").getS()).up()
.add("paid").set(item.get("paid").getN()).up()
.add("used").set(item.get("used").getN()).up()
.add("hour").set(item.get("hour").getN()).up()
.add("day").set(item.get("day").getN()).up()
.add("week").set(item.get("week").getN()).up()
.up(),
this.region.table("scripts")
.frame()
.through(
new QueryValve()
// @checkstyle MagicNumber (1 line)
.withLimit(10)
.withSelect(Select.ALL_ATTRIBUTES)
)
.where("login", this.login)
);
}
示例4: logs
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Iterable<Directive>> logs() {
return new Mapped<Item, Iterable<Directive>>(
item -> new Directives()
.add("log")
.add("group").set(item.get("group").getS()).up()
.add("start").set(item.get("start").getN()).up()
.add("finish").set(item.get("finish").getN()).up()
.add("period").set(item.get("period").getS()).up()
.add("ocket").set(item.get("ocket").getS()).up()
.add("exit").set(item.get("exit").getN()).up()
.up(),
this.region.table("logs")
.frame()
.through(
new QueryValve()
.withIndexName("mine")
// @checkstyle MagicNumber (1 line)
.withLimit(20)
.withConsistentRead(false)
.withScanIndexForward(false)
.withSelect(Select.ALL_ATTRIBUTES)
)
.where("login", this.login)
);
}
示例5: mine
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Domain> mine() {
return this.table()
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(Tv.HUNDRED)
.withConsistentRead(false)
.withIndexName("mine")
)
.where("user", Conditions.equalTo(this.handle))
.stream()
.map(DyDomain::new)
.map(Domain.class::cast)
.collect(Collectors.toList());
}
示例6: domain
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Domain> domain(final String name) {
return this.table()
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(1)
.withConsistentRead(true)
)
.where(
"domain",
Conditions.equalTo(name.toLowerCase(Locale.ENGLISH))
)
.stream()
.map(DyDomain::new)
.map(Domain.class::cast)
.collect(Collectors.toList());
}
示例7: iterate
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Pipe> iterate() {
return () -> this.table()
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(Tv.HUNDRED)
.withConsistentRead(true)
)
.where("urn", Conditions.equalTo(this.urn))
.stream()
.map(DyPipe::new)
.map(Pipe.class::cast)
.iterator();
}
示例8: iterate
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Event> iterate() {
return () -> this.table()
.frame()
.through(
new QueryValve()
.withLimit(Tv.TWENTY)
.withIndexName("top")
.withSelect(Select.ALL_ATTRIBUTES)
.withScanIndexForward(false)
.withConsistentRead(false)
)
.where("urn", Conditions.equalTo(this.urn))
.stream()
.map(DyEvent::new)
.map(Event.class::cast)
.iterator();
}
示例9: getDictionaryEntry
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
/**
* Generate a list of attribute names found in the Aggregator's dynamo
* table. Assumes that all Items in the Aggregator table are of the same
* structure.
*
* @param dynamoClient
* Dynamo DB Client to use for connection to Dynamo DB.
* @param dynamoTable
* The Dynamo Table for the Aggregator
* @return A list of attribute names from the Dynamo table
* @throws Exception
*/
public static List<String> getDictionaryEntry(
final AmazonDynamoDB dynamoClient, final String dynamoTable)
throws Exception {
// get a list of all columns in the table, with keys first
List<String> columns = new ArrayList<>();
List<KeySchemaElement> keys = dynamoClient.describeTable(dynamoTable)
.getTable().getKeySchema();
for (KeySchemaElement key : keys) {
columns.add(key.getAttributeName());
}
ScanResult scan = dynamoClient.scan(new ScanRequest()
.withTableName(dynamoTable).withSelect(Select.ALL_ATTRIBUTES)
.withLimit(1));
List<Map<String, AttributeValue>> scannedItems = scan.getItems();
for (Map<String, AttributeValue> map : scannedItems) {
for (String s : map.keySet()) {
if (!columns.contains(s))
columns.add(s);
}
}
return columns;
}
示例10: getDictionaryEntry
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
/**
* Generate a list of attribute names found in the Aggregator's dynamo
* table. Assumes that all Items in the Aggregator table are of the same
* structure.
*
* @param dynamoClient Dynamo DB Client to use for connection to Dynamo DB.
* @param dynamoTable The Dynamo Table for the Aggregator
* @return A list of attribute names from the Dynamo table
* @throws Exception
*/
protected List<String> getDictionaryEntry() throws Exception {
// get a list of all columns in the table, with keys first
List<String> columns = new ArrayList<>();
List<KeySchemaElement> keys = dynamoClient.describeTable(this.tableName).getTable().getKeySchema();
for (KeySchemaElement key : keys) {
columns.add(key.getAttributeName());
}
ScanResult scan = dynamoClient.scan(new ScanRequest().withTableName(this.tableName).withSelect(
Select.ALL_ATTRIBUTES).withLimit(1));
List<Map<String, AttributeValue>> scannedItems = scan.getItems();
for (Map<String, AttributeValue> map : scannedItems) {
for (String s : map.keySet()) {
if (!columns.contains(s))
columns.add(s);
}
}
return columns;
}
示例11: iterate
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Iterable<Deck> iterate() {
return Iterables.transform(
this.region.table(DyDeck.TBL)
.frame()
.through(new QueryValve().withSelect(Select.ALL_ATTRIBUTES))
.where(DyDeck.HASH, this.user),
new Function<Item, Deck>() {
@Override
public Deck apply(final Item input) {
try {
return DyDecks.this.get(input.get(DyDeck.RANGE).getS());
} catch (final IOException ex) {
throw new IllegalStateException(ex);
}
}
}
);
}
示例12: item
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
/**
* Item.
* @return Item
*/
private Item item() {
final Iterator<Item> items = this.region
.table(DyDeck.TBL)
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(1)
)
.where(DyDeck.HASH, this.user)
.where(DyDeck.RANGE, this.deck)
.iterator();
if (!items.hasNext()) {
throw new IllegalArgumentException(
String.format("deck '%s' not found", this.deck)
);
}
return items.next();
}
示例13: target
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
@Override
public Take target(final URL url, final long time) throws IOException {
final Iterator<Item> items = this.table()
.frame()
.through(
new QueryValve()
.withSelect(Select.ALL_ATTRIBUTES)
.withLimit(1)
)
.where("url", Conditions.equalTo(url))
.where("time", Conditions.equalTo(time))
.iterator();
final Item item;
if (items.hasNext()) {
item = items.next();
} else {
item = this.table().put(
new Attributes()
.with("url", url)
.with("time", time)
.with("code", 0)
.with("attempts", 0)
.with("when", System.currentTimeMillis())
.with(
"ttl",
(System.currentTimeMillis()
+ TimeUnit.DAYS.toMillis(1L))
/ TimeUnit.SECONDS.toMillis(1L)
)
);
}
return new DyTake(item, this.delay);
}
示例14: worst
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
/**
* Worst metrics.
* @return List of them
* @throws IOException If fails
*/
public Iterable<Iterable<Directive>> worst() throws IOException {
return new Mapped<>(
item -> new Directives()
.add("metric")
.attr("id", item.get("metric").getS())
.add("pos").set(item.get("pos").getN()).up()
.add("neg").set(item.get("neg").getN()).up()
.add("psum").set(new DyNum(item, "psum").doubleValue()).up()
.add("pavg").set(new DyNum(item, "pavg").doubleValue()).up()
.add("nsum").set(new DyNum(item, "nsum").doubleValue()).up()
.add("navg").set(new DyNum(item, "navg").doubleValue()).up()
.add("avg").set(new DyNum(item, "avg").doubleValue()).up()
.add("champions").set(item.get("champions").getN()).up()
.add("artifact").set(item.get("artifact").getS()).up()
.add("mean").set(new DyNum(item, "mean").doubleValue()).up()
.add("sigma").set(new DyNum(item, "sigma").doubleValue()).up()
.up(),
this.table.frame()
.where("version", new Version().value())
.through(
new QueryValve()
.withScanIndexForward(false)
.withIndexName("mistakes")
.withConsistentRead(false)
// @checkstyle MagicNumber (1 line)
.withLimit(20)
.withSelect(Select.ALL_ATTRIBUTES)
)
);
}
示例15: QueryValve
import com.amazonaws.services.dynamodbv2.model.Select; //导入依赖的package包/类
/**
* Public ctor.
*/
public QueryValve() {
this(
Tv.TWENTY, true, new ArrayList<String>(0),
"", Select.SPECIFIC_ATTRIBUTES.toString(), true
);
}