Example usage for com.amazonaws.services.dynamodbv2.model GlobalSecondaryIndex setIndexName

List of usage examples for com.amazonaws.services.dynamodbv2.model GlobalSecondaryIndex setIndexName

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model GlobalSecondaryIndex setIndexName.

Prototype


public void setIndexName(String indexName) 

Source Link

Document

The name of the global secondary index.

Usage

From source file:io.venable.amazonaws.dynamo.table.builder.GlobalSecondaryIndexBuilderImpl.java

License:Apache License

public void buildSecondaryIndexes(Collection<GlobalSecondaryIndex> globalSecondaryIndexCollection,
        Collection<AttributeDefinition> attributeDefinitionCollection) {
    GlobalSecondaryIndex globalSecondaryIndex = new GlobalSecondaryIndex();

    globalSecondaryIndex.setIndexName(indexName);
    Collection<KeySchemaElement> keySchemaElementCollection = new ArrayList<>();
    buildKeys(keySchemaElementCollection, attributeDefinitionCollection);
    globalSecondaryIndex.setKeySchema(keySchemaElementCollection);

    projection.build(globalSecondaryIndex);

    setProvisionedThroughput(new GlobalSecondaryIndexProvisionedThroughputSetter(globalSecondaryIndex));

    globalSecondaryIndexCollection.add(globalSecondaryIndex);
}

From source file:org.xmlsh.aws.util.AWSDDBCommand.java

License:BSD License

protected GlobalSecondaryIndex parseGlobalSecondaryIndex(XValue xv)
        throws InvalidArgumentException, UnexpectedException {
    if (!xv.isXdmNode())
        throw new InvalidArgumentException(
                "Unexpected argument type for global secondary index: " + xv.describe());

    GlobalSecondaryIndex gi = new GlobalSecondaryIndex();

    gi.setIndexName(xv.xpath(getShell(), "./@name").toString());
    gi.setKeySchema(parseKeySchemaList(xv.xpath(getShell(), "./key-schema")));
    gi.setProjection(parseProjection(xv.xpath(getShell(), "./projection")));
    gi.setProvisionedThroughput(parseProvisionedThroughput(xv.xpath(getShell(), "./provisioned-throughput")));

    return gi;/*from w w  w .j ava2 s .  c o m*/
}