Skip to content

Commit d283be7

Browse files
committed
fixes dynamotableutils
1 parent 8b6158d commit d283be7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

dynamodb-driver/src/main/java/org/jnosql/diana/dynamodb/DynamoTableUtils.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
public final class DynamoTableUtils {
3535

36+
private static final long READ_CAPACITY_UNITS = 5L;
37+
3638
private DynamoTableUtils() {
3739
}
3840

@@ -73,14 +75,17 @@ public static ProvisionedThroughput createProvisionedThroughput(Long readCapacit
7375

7476
if (readCapacityUnits != null && readCapacityUnits.longValue() > 0)
7577
provisionedThroughputBuilder.readCapacityUnits(readCapacityUnits);
76-
else
77-
provisionedThroughputBuilder.readCapacityUnits(5l);
78+
else {
79+
provisionedThroughputBuilder.readCapacityUnits(READ_CAPACITY_UNITS);
80+
}
7881

7982

8083
if (writeCapacityUnit != null && writeCapacityUnit.longValue() > 0)
8184
provisionedThroughputBuilder.writeCapacityUnits(writeCapacityUnit);
82-
else
83-
provisionedThroughputBuilder.writeCapacityUnits(5l);
85+
else {
86+
provisionedThroughputBuilder.writeCapacityUnits(READ_CAPACITY_UNITS);
87+
}
88+
8489

8590
return provisionedThroughputBuilder.build();
8691
}
@@ -109,9 +114,9 @@ public static void manageTables(String tableName, DynamoDbClient client, Long re
109114
response = client.listTables(request);
110115
}
111116

112-
List<String> table_names = response.tableNames();
117+
List<String> tableNames = response.tableNames();
113118

114-
if (table_names.size() == 0) {
119+
if (tableNames.size() == 0) {
115120
createTable(tableName, client, readCapacityUnits, writeCapacityUnit);
116121
} else {
117122
lastName = response.lastEvaluatedTableName();

0 commit comments

Comments
 (0)