Java 类com.amazonaws.services.dynamodbv2.document.internal.InternalUtils 实例源码

项目:webcrawler    文件:CrawlerBatchService.java   
@Override
public Map<String, AttributeValue> getNodes(WebsiteModel websiteModel) {

    try
    {
        ObjectMapper mapper = new ObjectMapper();
        String string = mapper.writeValueAsString(websiteModel);
        Item item = new Item().withJSON(Utils.params.nodes, string);
        return InternalUtils.toAttributeValues(item);
    }
    catch (JsonProcessingException e)
    {
        LOG.error(e.getMessage());
    }

    return new HashMap<>();
}
项目:webcrawler    文件:CrawlerService.java   
@Override
public Mono<Map<String, Object>> getWebsites(String url) {

    return Mono.from(this.getItemResultMono(url))
            .flatMap(
                    (result) -> {
                        if (result.getItem() != null) return Mono.just(result.getItem());
                        return this.putItemResultMono(url);
                    })
            .doOnError((throwable -> LOG.error(Utils.error.failed_get_website, url)))
            .map(InternalUtils::toSimpleMapValue);
}
项目:logback-ext    文件:DynamoDbAppender.java   
@Override
protected void handle(final ILoggingEvent event, final String encoded) throws Exception {
    Item item = Item.fromJSON(encoded).withPrimaryKey(createEventId(event));
    Map<String, AttributeValue> attributes = InternalUtils.toAttributeValues(item);
    PutItemRequest request = new PutItemRequest(table, attributes);
    String errorMessage = format("Appender '%s' failed to send logging event '%s' to DynamoDB table '%s'", getName(), event, table);
    CountDownLatch latch = new CountDownLatch(isAsyncParent() ? 0 : 1);
    dynamoDb.putItemAsync(request, new LoggingEventHandler<PutItemRequest, PutItemResult>(this, latch, errorMessage));
    AppenderExecutors.awaitLatch(this, latch, getMaxFlushTime());
}
项目:reinvent2015-practicaldynamodb    文件:InternalCalls.java   
/**
 * This method is calling an internal API which could be changed over time.
 * It is only for use of this demo and not expected for external use.
 */
public static Map<String, Object> toSimpleMapValue(
        Map<String, AttributeValue> values) {
    return InternalUtils.toSimpleMapValue(values);
}