List of usage examples for com.amazonaws.services.dynamodbv2.model TableDescription getCreationDateTime
public java.util.Date getCreationDateTime()
From source file:com.erudika.para.persistence.AWSDynamoUtils.java
License:Apache License
/** * Gives basic information about a DynamoDB table (status, creation date, size). * @param appid name of the {@link com.erudika.para.core.App} * @return a map// w w w. j a v a 2s . c o m */ public static Map<String, Object> getTableStatus(final String appid) { if (StringUtils.isBlank(appid)) { return Collections.emptyMap(); } try { final TableDescription td = getClient().describeTable(getTableNameForAppid(appid)).getTable(); return new HashMap<String, Object>() { { put("id", appid); put("status", td.getTableStatus()); put("created", td.getCreationDateTime().getTime()); put("sizeBytes", td.getTableSizeBytes()); put("itemCount", td.getItemCount()); put("readCapacityUnits", td.getProvisionedThroughput().getReadCapacityUnits()); put("writeCapacityUnits", td.getProvisionedThroughput().getWriteCapacityUnits()); } }; } catch (Exception e) { logger.error(null, e); } return Collections.emptyMap(); }
From source file:com.haskins.cloudtrailviewer.dialog.resourcedetail.detailpanels.DbTableDetail.java
License:Open Source License
private void buildUI(DescribeTableResult detail) { this.add(primaryScrollPane, BorderLayout.CENTER); if (detail.getTable() != null) { TableDescription table = detail.getTable(); if (table.getCreationDateTime() != null) { primaryTableModel.addRow(new Object[] { "Created", getDateString(table.getCreationDateTime()) }); }//w w w . ja va 2 s . c o m if (table.getItemCount() != null) { primaryTableModel.addRow(new Object[] { "Item Count", table.getItemCount() }); } if (table.getLatestStreamArn() != null) { primaryTableModel.addRow(new Object[] { "Latest Stream Arn", table.getLatestStreamArn() }); } if (table.getLatestStreamLabel() != null) { primaryTableModel.addRow(new Object[] { "Latest Stream Label", table.getLatestStreamLabel() }); } if (table.getTableArn() != null) { primaryTableModel.addRow(new Object[] { "Arn", table.getTableArn() }); } if (table.getTableName() != null) { primaryTableModel.addRow(new Object[] { "Name", table.getTableName() }); } if (table.getTableSizeBytes() != null) { primaryTableModel.addRow(new Object[] { "Size (bytes)", table.getTableSizeBytes() }); } if (table.getTableStatus() != null) { primaryTableModel.addRow(new Object[] { "Status", table.getTableStatus() }); } } }
From source file:org.xmlsh.aws.util.AWSDDBCommand.java
License:BSD License
protected void writeTableDescription(TableDescription tableDescription) throws XMLStreamException { startElement("table"); attribute("name", tableDescription.getTableName()); attribute("status", tableDescription.getTableStatus()); attribute("create-date", Util.formatXSDateTime(tableDescription.getCreationDateTime())); attribute("item-count", tableDescription.getItemCount()); attribute("size", tableDescription.getTableSizeBytes()); attribute("item-count", tableDescription.getItemCount()); writeAttributeDefinitions(tableDescription.getAttributeDefinitions()); writeKeySchemaList(tableDescription.getKeySchema()); writeLocalSecondaryIndexes(tableDescription.getLocalSecondaryIndexes()); writeGlobalSecondaryIndexes(tableDescription.getGlobalSecondaryIndexes()); writeProvisionedThroughput(tableDescription.getProvisionedThroughput()); }