Example usage for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNamesSizeBytes

List of usage examples for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNamesSizeBytes

Introduction

In this page you can find the example usage for com.amazonaws.services.simpledb.model DomainMetadataResult getAttributeNamesSizeBytes.

Prototype


public Long getAttributeNamesSizeBytes() 

Source Link

Document

The total size of all unique attribute names in the domain, in bytes.

Usage

From source file:com.zotoh.cloudapi.aws.SDB.java

License:Open Source License

private KeyValueDatabase toKVD(String domain, DomainMetadataResult res) {
    KeyValueDatabase db = null;/*from w ww  .j a va2  s  .  c  o  m*/
    if (res != null) {
        db = new KeyValueDatabase();
        db.setDescription(domain);
        db.setItemCount(res.getItemCount());
        db.setItemSize(new Long(res.getItemNamesSizeBytes()).intValue());
        db.setKeyCount(res.getAttributeNameCount());
        db.setKeySize(new Long(res.getAttributeNamesSizeBytes()).intValue());
        db.setKeyValueCount(res.getAttributeValueCount());
        db.setKeyValueSize(new Long(res.getAttributeValuesSizeBytes()).intValue());
        db.setName(domain);
        db.setProviderDatabaseId(db.getName());
        db.setProviderOwnerId(_svc.getCloud().getContext().getAccountNumber());
        db.setProviderRegionId(_svc.getCloud().getContext().getRegionId());
    }
    return db;
}

From source file:org.apache.camel.component.aws.sdb.DomainMetadataCommand.java

License:Apache License

public void execute() {
    DomainMetadataRequest request = new DomainMetadataRequest().withDomainName(determineDomainName());
    log.trace("Sending request [{}] for exchange [{}]...", request, exchange);

    DomainMetadataResult result = this.sdbClient.domainMetadata(request);

    log.trace("Received result [{}]", result);

    Message msg = getMessageForResponse(exchange);
    msg.setHeader(SdbConstants.TIMESTAMP, result.getTimestamp());
    msg.setHeader(SdbConstants.ITEM_COUNT, result.getItemCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_NAME_COUNT, result.getAttributeNameCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_VALUE_COUNT, result.getAttributeValueCount());
    msg.setHeader(SdbConstants.ATTRIBUTE_NAME_SIZE, result.getAttributeNamesSizeBytes());
    msg.setHeader(SdbConstants.ATTRIBUTE_VALUE_SIZE, result.getAttributeValuesSizeBytes());
    msg.setHeader(SdbConstants.ITEM_NAME_SIZE, result.getItemNamesSizeBytes());
}