Package com.amazonaws.services.simpledb.model

Examples of com.amazonaws.services.simpledb.model.DomainMetadataResult


       
        if ("NonExistingDomain".equals(domainMetadataRequest.getDomainName())) {
            throw new NoSuchDomainException("Domain 'NonExistingDomain' doesn't exist.");
        }
       
        DomainMetadataResult result = new DomainMetadataResult();
        result.setTimestamp(new Integer(10));
        result.setItemCount(new Integer(11));
        result.setAttributeNameCount(new Integer(12));
        result.setAttributeValueCount(new Integer(13));
        result.setAttributeNamesSizeBytes(new Long(1000000));
        result.setAttributeValuesSizeBytes(new Long(2000000));
        result.setItemNamesSizeBytes(new Long(3000000));
        return result;
    }
View Full Code Here


    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());
    }
View Full Code Here

       
        if ("NonExistingDomain".equals(domainMetadataRequest.getDomainName())) {
            throw new NoSuchDomainException("Domain 'NonExistingDomain' doesn't exist.");
        }
       
        DomainMetadataResult result = new DomainMetadataResult();
        result.setTimestamp(new Integer(10));
        result.setItemCount(new Integer(11));
        result.setAttributeNameCount(new Integer(12));
        result.setAttributeValueCount(new Integer(13));
        result.setAttributeNamesSizeBytes(new Long(1000000));
        result.setAttributeValuesSizeBytes(new Long(2000000));
        result.setItemNamesSizeBytes(new Long(3000000));
        return result;
    }
View Full Code Here

            ListDomainsResult sdbResult = sdb.listDomains(sdbRequest);

            int totalItems = 0;
            for (String domainName : sdbResult.getDomainNames()) {
                DomainMetadataRequest metadataRequest = new DomainMetadataRequest().withDomainName(domainName);
                DomainMetadataResult domainMetadata = sdb.domainMetadata(metadataRequest);
                totalItems += domainMetadata.getItemCount();
            }

            System.out.println("You have " + sdbResult.getDomainNames().size() + " Amazon SimpleDB domain(s)" +
                    "containing a total of " + totalItems + " items.");
        } catch (AmazonServiceException ase) {
View Full Code Here

    private void showDomainMetadata(AmazonSimpleDB sdbService, String domain) {
        // prepare the DomainMetadata request for this domain
        DomainMetadataRequest request = new DomainMetadataRequest(domain);
             
        DomainMetadataResult result = sdbService.domainMetadata(request);
             
        // we are interested in the total amount of items
        long totalItems = result.getItemCount();

        // show results ...
        System.out.println("Domain metadata for ["+ domain +"]: " + result);
        System.out.println("The domain " + domain + " has " +
            totalItems + " items.");
View Full Code Here

                secretKey);

        // get the SimpleDB service
        AmazonSimpleDB simpleDB = new AmazonSimpleDBClient(credentials);
        // get the metadata for a domain called "my_domain"
        DomainMetadataResult result = simpleDB.domainMetadata(
                new DomainMetadataRequest(Constants.A_SIMPLEDB_DOMAIN));
       
        // number of attributes
        // check if we already have 90% of the maximum number of attributes allowed
        if (result.getAttributeNameCount() > 900000000) {

            // ...in that case, send a warning to myself...
            System.out.println("You are reaching the maximum number of attributes allowed for a domain.");
        }

        // calculate the approximate size of the domain in bytes
        // check if we already use 80% of the maximum allowed size of a domain
        if ((result.getAttributeNamesSizeBytes() +
                result.getAttributeValuesSizeBytes() +
                result.getItemNamesSizeBytes()) / 1024 / 1024  > 10 * 1024 * 0.8) {

            // ...in that case, send a warning to myself...
            System.out.println("You are reaching the maximum storage capacity of a domain");
        }
    }
View Full Code Here

            ListDomainsResult sdbResult = sdb.listDomains(sdbRequest);

            int totalItems = 0;
            for (String domainName : sdbResult.getDomainNames()) {
                DomainMetadataRequest metadataRequest = new DomainMetadataRequest().withDomainName(domainName);
                DomainMetadataResult domainMetadata = sdb.domainMetadata(metadataRequest);
                totalItems += domainMetadata.getItemCount();
            }

            System.out.println("You have " + sdbResult.getDomainNames().size() + " Amazon SimpleDB domain(s)" +
                    "containing a total of " + totalItems + " items.");
        } catch (AmazonServiceException ase) {
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpledb.model.DomainMetadataResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.