mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(dynamodb): show table creation times to the millisecond (#6325)
* fix(dynamodb): show table creation times to the millisecond * chore(dynamodb): share the time range check between the tests
This commit is contained in:
1 parent
33620a59c0
commit
80e5df933b
5 files changed
+71
-4
No files matched your search
@@ -4903,7 +4903,8 @@ public class DynamoDbService {
|
||||
|
||||
TableDefinition table = requireBackupSource(storageKey, tableArn);
|
||||
Instant startTime = clock.instant().truncatedTo(ChronoUnit.MILLIS);
|
||||
// Seconds, as CreationDateTime is shown, so an EarliestRestorableDateTime in the creation second passes.
|
||||
// AWS cannot enable point-in-time recovery until seconds after the creation, so its
|
||||
// EarliestRestorableDateTime is never in the creation second.
|
||||
if (exportTime != null && (exportTime.isBefore(table.getCreationDateTime().truncatedTo(ChronoUnit.SECONDS))
|
||||
|| startTime.isBefore(exportTime))) {
|
||||
throw new AwsException("InvalidExportTimeException", "Export Time is invalid", 400);
|
||||
|
||||
+3
-3
@@ -486,7 +486,7 @@ public class NativeDynamoDbJsonHandler {
|
||||
description.put("GlobalTableStatus", "ACTIVE");
|
||||
description.put("GlobalTableArn", table.getTableArn());
|
||||
if (table.getCreationDateTime() != null) {
|
||||
description.put("CreationDateTime", table.getCreationDateTime().getEpochSecond());
|
||||
description.put("CreationDateTime", epochSeconds(table.getCreationDateTime()));
|
||||
}
|
||||
description.set("ReplicationGroup", replicaNodes(table, objectMapper.createArrayNode(), true));
|
||||
return description;
|
||||
@@ -3133,7 +3133,7 @@ public class NativeDynamoDbJsonHandler {
|
||||
node.put("TableId", table.getTableId());
|
||||
node.put("TableStatus", table.getTableStatus());
|
||||
node.put("TableArn", table.getTableArn());
|
||||
node.put("CreationDateTime", table.getCreationDateTime().getEpochSecond());
|
||||
node.put("CreationDateTime", epochSeconds(table.getCreationDateTime()));
|
||||
node.put("ItemCount", table.getItemCount());
|
||||
node.put("TableSizeBytes", table.getTableSizeBytes());
|
||||
node.put("DeletionProtectionEnabled", table.isDeletionProtectionEnabled());
|
||||
@@ -3142,7 +3142,7 @@ public class NativeDynamoDbJsonHandler {
|
||||
ObjectNode billing = objectMapper.createObjectNode();
|
||||
billing.put("BillingMode", "PAY_PER_REQUEST");
|
||||
billing.put("LastUpdateToPayPerRequestDateTime",
|
||||
table.getCreationDateTime().getEpochSecond());
|
||||
epochSeconds(table.getCreationDateTime()));
|
||||
node.set("BillingModeSummary", billing);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user