Rename getPathFromDynamoDB to getItemFromDynamoDB
The name is more representative of what the method actually does.
Change-Id: I5ff4af6d8655abffe057bbc02c09c3167aee37d5
diff --git a/src/main/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/dynamodb/DynamoDBRefDatabase.java b/src/main/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/dynamodb/DynamoDBRefDatabase.java
index d78ef2d..cabf2db 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/dynamodb/DynamoDBRefDatabase.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/dynamodb/DynamoDBRefDatabase.java
@@ -78,7 +78,7 @@
@Override
public boolean isUpToDate(Project.NameKey project, Ref ref) throws GlobalRefDbLockException {
try {
- GetItemResult result = getPathFromDynamoDB(pathFor(project, ref.getName()));
+ GetItemResult result = getItemFromDynamoDB(pathFor(project, ref.getName()));
if (!exists(result)) {
return true;
}
@@ -209,7 +209,7 @@
@Override
public boolean exists(Project.NameKey project, String refName) {
try {
- if (!exists(getPathFromDynamoDB(pathFor(project, refName)))) {
+ if (!exists(getItemFromDynamoDB(pathFor(project, refName)))) {
logger.atFine().log("ref '%s' does not exist in dynamodb", pathFor(project, refName));
return false;
}
@@ -227,7 +227,7 @@
public Integer getCurrentVersion(Project.NameKey project) {
// TODO: this should be served by a cache
String pathForVersion = currentVersionKey(project);
- GetItemResult item = getPathFromDynamoDB(pathForVersion, false);
+ GetItemResult item = getItemFromDynamoDB(pathForVersion, false);
return exists(item) ? Integer.parseInt(item.getItem().get(REF_DB_VALUE_KEY).getS()) : null;
}
@@ -247,7 +247,7 @@
public <T> Optional<T> get(Project.NameKey project, String refName, Class<T> clazz)
throws GlobalRefDbSystemError {
try {
- GetItemResult item = getPathFromDynamoDB(pathFor(project, refName));
+ GetItemResult item = getItemFromDynamoDB(pathFor(project, refName));
if (!exists(item)) {
return Optional.empty();
}
@@ -263,11 +263,11 @@
}
}
- private GetItemResult getPathFromDynamoDB(String refPath) {
- return getPathFromDynamoDB(refPath, true);
+ private GetItemResult getItemFromDynamoDB(String refPath) {
+ return getItemFromDynamoDB(refPath, true);
}
- private GetItemResult getPathFromDynamoDB(String refPath, Boolean consistentRead) {
+ private GetItemResult getItemFromDynamoDB(String refPath, Boolean consistentRead) {
return dynamoDBClient.getItem(
configuration.getRefsDbTableName(),
ImmutableMap.of(REF_DB_PRIMARY_KEY, new AttributeValue(refPath)),