prashantpogde commented on code in PR #3652:
URL: https://github.com/apache/ozone/pull/3652#discussion_r948651883
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java:
##########
@@ -549,4 +549,8 @@ private OzoneConsts() {
* tenant.
*/
public static final int OZONE_MAXIMUM_ACCESS_ID_LENGTH = 100;
+
+ public static final String OM_SNAPSHOT_NAME = "snapshotName";
Review Comment:
This is not used.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java:
##########
@@ -104,6 +107,17 @@ public RDBStore(File dbFile, ManagedDBOptions dbOptions,
}
}
+ //create snapshot directory if does not exist.
+ snapshotsParentDir = Paths.get(dbLocation.getParent(),
+ OM_SNAPSHOT_DIR).toString();
+ File snapshotsDir = new File(snapshotsParentDir);
+ if (!snapshotsDir.exists()) {
+ boolean success = snapshotsDir.mkdir();
+ if (!success) {
+ LOG.warn("Unable to create RocksDB snapshot directory");
Review Comment:
Shouldn't we throw an exception here ?
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java:
##########
@@ -71,8 +89,14 @@ public static SnapshotStatus valueOf(SnapshotStatusProto
status) {
"BUG: missing valid SnapshotStatus, found status=" + status);
}
}
- };
+ }
+ public static final String SNAPSHOT_FLAG = "snapshot";
+ private static final String SEPARATOR = "-";
+ private static final long UNDELETED_TIME = -1;
Review Comment:
please consider s/UNDELETED_TIME/INVALID_TIMESTAMP/ os something
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java:
##########
@@ -71,8 +89,14 @@ public static SnapshotStatus valueOf(SnapshotStatusProto
status) {
"BUG: missing valid SnapshotStatus, found status=" + status);
}
}
- };
+ }
+ public static final String SNAPSHOT_FLAG = "snapshot";
+ private static final String SEPARATOR = "-";
+ private static final long UNDELETED_TIME = -1;
+ private static final String INITIAL_SNAPSHOT_ID =
+ UUID.randomUUID().toString();
Review Comment:
instead of random UUID, can we have the timestamp based name ? we can list
the snapshots in the order they were created.
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/audit/OMAction.java:
##########
@@ -88,7 +88,9 @@ public enum OMAction implements AuditAction {
TENANT_ASSIGN_ADMIN,
TENANT_REVOKE_ADMIN,
- TENANT_LIST_USER;
+ TENANT_LIST_USER,
+
Review Comment:
remove extra line here.
--
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]