List of usage examples for com.amazonaws.services.dynamodbv2.model GlobalSecondaryIndexDescription getProvisionedThroughput
public ProvisionedThroughputDescription getProvisionedThroughput()
Represents the provisioned throughput settings for the specified global secondary index.
From source file:com.amazon.janusgraph.diskstorage.dynamodb.DynamoDbDelegate.java
License:Open Source License
private static boolean areGsisSameConfiguration(final GlobalSecondaryIndexDescription g1, final GlobalSecondaryIndexDescription g2) { if (g1 == null ^ g2 == null) { return false; }//from w ww. j av a 2s . co m if (g1 == g2) { return true; } final EqualsBuilder builder = new EqualsBuilder(); builder.append(g1.getIndexName(), g2.getIndexName()); builder.append(g1.getKeySchema(), g2.getKeySchema()); builder.append(g1.getProjection().getProjectionType(), g2.getProjection().getProjectionType()); builder.append(g1.getProvisionedThroughput().getReadCapacityUnits(), g2.getProvisionedThroughput().getReadCapacityUnits()); builder.append(g1.getProvisionedThroughput().getWriteCapacityUnits(), g2.getProvisionedThroughput().getWriteCapacityUnits()); final Set<String> projectionNonKeyAttributesG1 = new HashSet<>( Optional.ofNullable(g1.getProjection().getNonKeyAttributes()).orElse(Collections.emptyList())); final Set<String> projectionNonKeyAttributesG2 = new HashSet<>( Optional.ofNullable(g2.getProjection().getNonKeyAttributes()).orElse(Collections.emptyList())); builder.append(projectionNonKeyAttributesG1, projectionNonKeyAttributesG2); return builder.build(); }
From source file:com.rapid7.diskstorage.dynamodb.DynamoDBDelegate.java
License:Open Source License
public static boolean areGSIsSameConfiguration(GlobalSecondaryIndexDescription g1, GlobalSecondaryIndexDescription g2) { if (g1 == null ^ g2 == null) { return false; }/*from w ww . ja v a 2 s .c o m*/ if (g1 == g2) { return true; } final EqualsBuilder builder = new EqualsBuilder(); builder.append(g1.getIndexName(), g2.getIndexName()); builder.append(g1.getKeySchema(), g2.getKeySchema()); builder.append(g1.getProjection().getProjectionType(), g2.getProjection().getProjectionType()); builder.append(g1.getProvisionedThroughput().getReadCapacityUnits(), g2.getProvisionedThroughput().getReadCapacityUnits()); builder.append(g1.getProvisionedThroughput().getWriteCapacityUnits(), g2.getProvisionedThroughput().getWriteCapacityUnits()); final Set<String> projectionNonKeyAttributesG1 = g1.getProjection().getNonKeyAttributes() == null ? Collections.<String>emptySet() : new HashSet<String>(g1.getProjection().getNonKeyAttributes()); final Set<String> projectionNonKeyAttributesG2 = g2.getProjection().getNonKeyAttributes() == null ? Collections.<String>emptySet() : new HashSet<String>(g2.getProjection().getNonKeyAttributes()); builder.append(projectionNonKeyAttributesG1, projectionNonKeyAttributesG2); return builder.isEquals(); }
From source file:org.xmlsh.aws.util.AWSDDBCommand.java
License:BSD License
private void writeGlobalSecondaryIndex(GlobalSecondaryIndexDescription index) throws XMLStreamException { startElement("global-secondary-index"); attribute("index-name", index.getIndexName()); attribute("index-size", index.getIndexSizeBytes()); attribute("index-status", index.getIndexStatus()); attribute("item-count", index.getItemCount()); writeKeySchemaList(index.getKeySchema()); writeProjection(index.getProjection()); writeProvisionedThroughput(index.getProvisionedThroughput()); endElement();/*w w w . ja va2s . c om*/ }