if (getTableId() != null) sb.append("TableId: ").append(getTableId()).append(","); if (getBillingModeSummary() != null) sb.append("BillingModeSummary: ").append(getBillingModeSummary()).append(","); if (getLocalSecondaryIndexes() != null) sb.append("LocalSecondaryIndexes: ").append(getLocalSecondaryIndexes()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeDefinitions() == null) ? 0 : getAttributeDefinitions().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode()); hashCode = prime * hashCode + ((getTableStatus() == null) ? 0 : getTableStatus().hashCode()); hashCode = prime * hashCode + ((getCreationDateTime() == null) ? 0 : getCreationDateTime().hashCode()); hashCode = prime * hashCode + ((getProvisionedThroughput() == null) ? 0 : getProvisionedThroughput().hashCode()); hashCode = prime * hashCode + ((getTableSizeBytes() == null) ? 0 : getTableSizeBytes().hashCode()); hashCode = prime * hashCode + ((getItemCount() == null) ? 0 : getItemCount().hashCode()); hashCode = prime * hashCode + ((getTableArn() == null) ? 0 : getTableArn().hashCode()); hashCode = prime * hashCode + ((getTableId() == null) ? 0 : getTableId().hashCode()); hashCode = prime * hashCode + ((getBillingModeSummary() == null) ? 0 : getBillingModeSummary().hashCode()); hashCode = prime * hashCode + ((getLocalSecondaryIndexes() == null) ? 0 : getLocalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getStreamSpecification() == null) ? 0 : getStreamSpecification().hashCode()); hashCode = prime * hashCode + ((getLatestStreamLabel() == null) ? 0 : getLatestStreamLabel().hashCode()); hashCode = prime * hashCode + ((getLatestStreamArn() == null) ? 0 : getLatestStreamArn().hashCode()); hashCode = prime * hashCode + ((getRestoreSummary() == null) ? 0 : getRestoreSummary().hashCode()); hashCode = prime * hashCode + ((getSSEDescription() == null) ? 0 : getSSEDescription().hashCode()); return hashCode; }
if (other.getTableId() != null && other.getTableId().equals(this.getTableId()) == false) return false; if (other.getBillingModeSummary() == null ^ this.getBillingModeSummary() == null) return false; if (other.getBillingModeSummary() != null && other.getBillingModeSummary().equals(this.getBillingModeSummary()) == false) return false; if (other.getLocalSecondaryIndexes() == null ^ this.getLocalSecondaryIndexes() == null)
/** * Marshall the given parameter object. */ public void marshall(TableDescription tableDescription, ProtocolMarshaller protocolMarshaller) { if (tableDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tableDescription.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING); protocolMarshaller.marshall(tableDescription.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(tableDescription.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(tableDescription.getTableStatus(), TABLESTATUS_BINDING); protocolMarshaller.marshall(tableDescription.getCreationDateTime(), CREATIONDATETIME_BINDING); protocolMarshaller.marshall(tableDescription.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING); protocolMarshaller.marshall(tableDescription.getTableSizeBytes(), TABLESIZEBYTES_BINDING); protocolMarshaller.marshall(tableDescription.getItemCount(), ITEMCOUNT_BINDING); protocolMarshaller.marshall(tableDescription.getTableArn(), TABLEARN_BINDING); protocolMarshaller.marshall(tableDescription.getTableId(), TABLEID_BINDING); protocolMarshaller.marshall(tableDescription.getBillingModeSummary(), BILLINGMODESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getLocalSecondaryIndexes(), LOCALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getGlobalSecondaryIndexes(), GLOBALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getStreamSpecification(), STREAMSPECIFICATION_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamLabel(), LATESTSTREAMLABEL_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamArn(), LATESTSTREAMARN_BINDING); protocolMarshaller.marshall(tableDescription.getRestoreSummary(), RESTORESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getSSEDescription(), SSEDESCRIPTION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
private double getThroughput() { TableDescription tableDescription = dynamoDBClient.describeTable(tableName); if (tableDescription.getBillingModeSummary() != null && tableDescription.getBillingModeSummary().getBillingMode() .equalsIgnoreCase(DynamoDBConstants.BILLING_MODE_PROVISIONED)) { ProvisionedThroughputDescription provisionedThroughput = tableDescription .getProvisionedThroughput(); return provisionedThroughput.getReadCapacityUnits(); } return DynamoDBConstants.DEFAULT_CAPACITY_FOR_ON_DEMAND; } }
private double getThroughput() { TableDescription tableDescription = dynamoDBClient.describeTable(tableName); if (tableDescription.getBillingModeSummary() != null && tableDescription.getBillingModeSummary() .getBillingMode().equalsIgnoreCase(DynamoDBConstants.BILLING_MODE_PROVISIONED)) { ProvisionedThroughputDescription provisionedThroughput = tableDescription.getProvisionedThroughput(); return provisionedThroughput.getWriteCapacityUnits(); } return DynamoDBConstants.DEFAULT_CAPACITY_FOR_ON_DEMAND; }
private void setTableProperties(JobConf jobConf, String tableName, Double writeRatio) { jobConf.set(DynamoDBConstants.OUTPUT_TABLE_NAME, tableName); jobConf.set(DynamoDBConstants.INPUT_TABLE_NAME, tableName); jobConf.set(DynamoDBConstants.TABLE_NAME, tableName); DynamoDBClient client = new DynamoDBClient(jobConf); TableDescription description = client.describeTable(tableName); if (description.getBillingModeSummary().getBillingMode() .equals(DynamoDBConstants.BILLING_MODE_PROVISIONED)) { jobConf.set(DynamoDBConstants.READ_THROUGHPUT, description.getProvisionedThroughput().getReadCapacityUnits().toString()); jobConf.set(DynamoDBConstants.WRITE_THROUGHPUT, description.getProvisionedThroughput().getWriteCapacityUnits().toString()); } else { jobConf.set(DynamoDBConstants.READ_THROUGHPUT, DynamoDBConstants.DEFAULT_CAPACITY_FOR_ON_DEMAND.toString()); jobConf.set(DynamoDBConstants.WRITE_THROUGHPUT, DynamoDBConstants.DEFAULT_CAPACITY_FOR_ON_DEMAND.toString()); } log.info("Read throughput: " + jobConf.get(DynamoDBConstants.READ_THROUGHPUT)); log.info("Write throughput: " + jobConf.get(DynamoDBConstants.WRITE_THROUGHPUT)); // Optional properties if (writeRatio != null) { jobConf.set(DynamoDBConstants.THROUGHPUT_WRITE_PERCENT, writeRatio.toString()); log.info("Throughput write ratio: " + writeRatio); } }
Double averageItemSize = DynamoDBUtil.calculateAverageItemSize(description); if (description.getBillingModeSummary().getBillingMode() .equals(DynamoDBConstants.BILLING_MODE_PROVISIONED)) { jobConf.set(DynamoDBConstants.READ_THROUGHPUT,
if (getTableId() != null) sb.append("TableId: ").append(getTableId()).append(","); if (getBillingModeSummary() != null) sb.append("BillingModeSummary: ").append(getBillingModeSummary()).append(","); if (getLocalSecondaryIndexes() != null) sb.append("LocalSecondaryIndexes: ").append(getLocalSecondaryIndexes()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeDefinitions() == null) ? 0 : getAttributeDefinitions().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode()); hashCode = prime * hashCode + ((getTableStatus() == null) ? 0 : getTableStatus().hashCode()); hashCode = prime * hashCode + ((getCreationDateTime() == null) ? 0 : getCreationDateTime().hashCode()); hashCode = prime * hashCode + ((getProvisionedThroughput() == null) ? 0 : getProvisionedThroughput().hashCode()); hashCode = prime * hashCode + ((getTableSizeBytes() == null) ? 0 : getTableSizeBytes().hashCode()); hashCode = prime * hashCode + ((getItemCount() == null) ? 0 : getItemCount().hashCode()); hashCode = prime * hashCode + ((getTableArn() == null) ? 0 : getTableArn().hashCode()); hashCode = prime * hashCode + ((getTableId() == null) ? 0 : getTableId().hashCode()); hashCode = prime * hashCode + ((getBillingModeSummary() == null) ? 0 : getBillingModeSummary().hashCode()); hashCode = prime * hashCode + ((getLocalSecondaryIndexes() == null) ? 0 : getLocalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getStreamSpecification() == null) ? 0 : getStreamSpecification().hashCode()); hashCode = prime * hashCode + ((getLatestStreamLabel() == null) ? 0 : getLatestStreamLabel().hashCode()); hashCode = prime * hashCode + ((getLatestStreamArn() == null) ? 0 : getLatestStreamArn().hashCode()); hashCode = prime * hashCode + ((getRestoreSummary() == null) ? 0 : getRestoreSummary().hashCode()); hashCode = prime * hashCode + ((getSSEDescription() == null) ? 0 : getSSEDescription().hashCode()); return hashCode; }
if (other.getTableId() != null && other.getTableId().equals(this.getTableId()) == false) return false; if (other.getBillingModeSummary() == null ^ this.getBillingModeSummary() == null) return false; if (other.getBillingModeSummary() != null && other.getBillingModeSummary().equals(this.getBillingModeSummary()) == false) return false; if (other.getLocalSecondaryIndexes() == null ^ this.getLocalSecondaryIndexes() == null)
/** * Marshall the given parameter object. */ public void marshall(TableDescription tableDescription, ProtocolMarshaller protocolMarshaller) { if (tableDescription == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tableDescription.getAttributeDefinitions(), ATTRIBUTEDEFINITIONS_BINDING); protocolMarshaller.marshall(tableDescription.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(tableDescription.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(tableDescription.getTableStatus(), TABLESTATUS_BINDING); protocolMarshaller.marshall(tableDescription.getCreationDateTime(), CREATIONDATETIME_BINDING); protocolMarshaller.marshall(tableDescription.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_BINDING); protocolMarshaller.marshall(tableDescription.getTableSizeBytes(), TABLESIZEBYTES_BINDING); protocolMarshaller.marshall(tableDescription.getItemCount(), ITEMCOUNT_BINDING); protocolMarshaller.marshall(tableDescription.getTableArn(), TABLEARN_BINDING); protocolMarshaller.marshall(tableDescription.getTableId(), TABLEID_BINDING); protocolMarshaller.marshall(tableDescription.getBillingModeSummary(), BILLINGMODESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getLocalSecondaryIndexes(), LOCALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getGlobalSecondaryIndexes(), GLOBALSECONDARYINDEXES_BINDING); protocolMarshaller.marshall(tableDescription.getStreamSpecification(), STREAMSPECIFICATION_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamLabel(), LATESTSTREAMLABEL_BINDING); protocolMarshaller.marshall(tableDescription.getLatestStreamArn(), LATESTSTREAMARN_BINDING); protocolMarshaller.marshall(tableDescription.getRestoreSummary(), RESTORESUMMARY_BINDING); protocolMarshaller.marshall(tableDescription.getSSEDescription(), SSEDESCRIPTION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }