swamirishi commented on code in PR #9235:
URL: https://github.com/apache/ozone/pull/9235#discussion_r2512219423
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1848,6 +1861,58 @@ public boolean containsIncompleteMPUs(String volume,
String bucket)
return false;
}
+ // NOTE: Update both getTableBucketPrefixInfo(volume, bucket) &
getTableBucketPrefix(tableName, volume, bucket)
+ // simultaneously. Implemented duplicate functions to avoid computing
bucketKeyPrefix redundantly for each and
+ // every table over and over again.
+ @Override
+ public TablePrefixInfo getTableBucketPrefix(String volume, String bucket)
throws IOException {
+ String keyPrefix = getBucketKeyPrefix(volume, bucket);
+ String keyPrefixFso = getBucketKeyPrefixFSO(volume, bucket);
+ // Set value to 12 to avoid creating too big a HashTable unnecessarily.
+ Map<String, String> tablePrefixMap = new HashMap<>(12, 1.0f);
+
+ tablePrefixMap.put(VOLUME_TABLE, getVolumeKey(volume));
+ tablePrefixMap.put(BUCKET_TABLE, getBucketKey(volume, bucket));
+
+ tablePrefixMap.put(KEY_TABLE, keyPrefix);
+ tablePrefixMap.put(DELETED_TABLE, keyPrefix);
+ tablePrefixMap.put(SNAPSHOT_RENAMED_TABLE, keyPrefix);
+ tablePrefixMap.put(OPEN_KEY_TABLE, keyPrefix);
+ tablePrefixMap.put(MULTIPART_INFO_TABLE, keyPrefix);
+ tablePrefixMap.put(SNAPSHOT_INFO_TABLE, keyPrefix);
+
+ tablePrefixMap.put(FILE_TABLE, keyPrefixFso);
+ tablePrefixMap.put(DIRECTORY_TABLE, keyPrefixFso);
+ tablePrefixMap.put(DELETED_DIR_TABLE, keyPrefixFso);
+ tablePrefixMap.put(OPEN_FILE_TABLE, keyPrefixFso);
+
+ return new TablePrefixInfo(tablePrefixMap);
+ }
+
+ @Override
+ public String getTableBucketPrefix(String tableName, String volume, String
bucket) throws IOException {
+ switch (tableName) {
+ case VOLUME_TABLE:
+ return getVolumeKey(volume);
+ case BUCKET_TABLE:
+ return getBucketKey(volume, bucket);
+ case KEY_TABLE:
+ case DELETED_TABLE:
+ case SNAPSHOT_RENAMED_TABLE:
+ case OPEN_KEY_TABLE:
+ case MULTIPART_INFO_TABLE:
+ case SNAPSHOT_INFO_TABLE:
+ return getBucketKeyPrefix(volume, bucket);
+ case FILE_TABLE:
+ case DIRECTORY_TABLE:
+ case DELETED_DIR_TABLE:
+ case OPEN_FILE_TABLE:
+ return getBucketKeyPrefixFSO(volume, bucket);
+ default:
Review Comment:
don
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1848,6 +1861,58 @@ public boolean containsIncompleteMPUs(String volume,
String bucket)
return false;
}
+ // NOTE: Update both getTableBucketPrefixInfo(volume, bucket) &
getTableBucketPrefix(tableName, volume, bucket)
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]