smengcl commented on code in PR #4436:
URL: https://github.com/apache/ozone/pull/4436#discussion_r1142985406
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java:
##########
@@ -230,14 +229,14 @@ String.class, new StringCodec(), OmKeyInfo.class,
SnapshotInfo.class,
new OmDBSnapshotInfoCodec());
- public static final DBColumnFamilyDefinition<String, OmKeyRenameInfo>
+ public static final DBColumnFamilyDefinition<String, String>
RENAMED_KEY_TABLE =
new DBColumnFamilyDefinition<>(
OmMetadataManagerImpl.RENAMED_KEY_TABLE,
String.class, // /volumeName/bucketName/objectID
new StringCodec(),
- OmKeyRenameInfo.class, // list of key renames
- new OmKeyRenameInfoCodec());
+ String.class, // renamed key
Review Comment:
```suggestion
String.class, // path to the key in previous snapshot's
key(file)Table
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java:
##########
@@ -230,14 +229,14 @@ String.class, new StringCodec(), OmKeyInfo.class,
SnapshotInfo.class,
new OmDBSnapshotInfoCodec());
- public static final DBColumnFamilyDefinition<String, OmKeyRenameInfo>
+ public static final DBColumnFamilyDefinition<String, String>
Review Comment:
```suggestion
// SnapshotRenamedKeyTable that complements the keyTable (or fileTable)
entries
// of the immediately previous snapshot in the same snapshot scope (bucket
or volume)
public static final DBColumnFamilyDefinition<String, String>
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequestUtils.java:
##########
@@ -47,4 +60,40 @@ public static void checkClientRequestPrecondition(
OMException.ResultCodes.INTERNAL_ERROR);
}
}
+
+ public static boolean isSnapshotBucket(OMMetadataManager omMetadataManager,
+ OmKeyInfo keyInfo) throws IOException {
+
+ boolean status;
+ TableIterator<String, ? extends Table.KeyValue<String, SnapshotInfo>>
Review Comment:
Yes. Use try-with-resources
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java:
##########
@@ -230,14 +229,14 @@ String.class, new StringCodec(), OmKeyInfo.class,
SnapshotInfo.class,
new OmDBSnapshotInfoCodec());
- public static final DBColumnFamilyDefinition<String, OmKeyRenameInfo>
+ public static final DBColumnFamilyDefinition<String, String>
RENAMED_KEY_TABLE =
Review Comment:
```suggestion
SNAPSHOT_RENAMED_KEY_TABLE =
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java:
##########
@@ -230,14 +229,14 @@ String.class, new StringCodec(), OmKeyInfo.class,
SnapshotInfo.class,
new OmDBSnapshotInfoCodec());
- public static final DBColumnFamilyDefinition<String, OmKeyRenameInfo>
+ public static final DBColumnFamilyDefinition<String, String>
Review Comment:
Also it would be useful to put a larger block comment here to demonstrate
the intended usage of this table.
Can asciify the tables in the design doc here.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -196,7 +194,7 @@ public class OmMetadataManagerImpl implements
OMMetadataManager,
* |----------------------------------------------------------------------|
* | snapshotInfoTable | /volume/bucket/snapshotName -> SnapshotInfo |
* |----------------------------------------------------------------------|
- * | renamedKeyTable | /volumeName/bucketName/objectID -> OmKeyRenameInfo|
+ * | renamedKeyTable | /volumeName/bucketName/objectID -> renamedKey |
Review Comment:
Let's rename the table to be more specific.
```suggestion
* | snapshotRenamedKeyTable | /volName/buckName/objID -> /v/b/origKey |
```
--
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]