smengcl commented on code in PR #4360:
URL: https://github.com/apache/ozone/pull/4360#discussion_r1136464473
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -67,21 +77,84 @@ public final class OmSnapshotManager implements
AutoCloseable {
private final OzoneManager ozoneManager;
private final SnapshotDiffManager snapshotDiffManager;
private final LoadingCache<String, OmSnapshot> snapshotCache;
- private final ManagedRocksDB snapshotDiffDb;
+ private ManagedRocksDB snapshotDiffDb;
+
+ /**
+ * Contains all the snap diff job which are either queued, in_progress or
+ * done. This table is used to make sure that there is only single job for
+ * similar type of request at any point of time.
+ * |----------------------------------------------|
+ * | KEY | VALUE |
+ * |----------------------------------------------|
+ * | fromSnapshotId-toSnapshotId | snapDiffJodId |
+ * |----------------------------------------------|
+ */
+ private static final String SNAP_DIFF_JOB_TABLE_NAME =
+ "snap-diff-job-table";
+
+ /**
+ * Global table to keep the diff report. Each key is prefixed by the jobId
+ * to improve look up and clean up. JodId comes from snap-diff-job-table.
+ * |--------------------------------|
+ * | KEY | VALUE |
+ * |--------------------------------|
+ * | jodId-index | DiffReportEntry |
+ * |--------------------------------|
+ */
+ private static final String SNAP_DIFF_REPORT_TABLE_NAME =
+ "snap-diff-report-table";
+
+ private final ManagedColumnFamilyOptions columnFamilyOptions;
+ private final ManagedDBOptions options;
+
+ // TODO: [SNAPSHOT] create config for max allowed page size.
+ private final int maxPageSize = 1000;
OmSnapshotManager(OzoneManager ozoneManager) {
- this.ozoneManager = ozoneManager;
+ this.options = new ManagedDBOptions();
+ this.options.setCreateIfMissing(true);
+ this.columnFamilyOptions = new ManagedColumnFamilyOptions();
+
+ List<ColumnFamilyDescriptor> columnFamilyDescriptors = new ArrayList<>();
+ List<ColumnFamilyHandle> columnFamilyHandles = new ArrayList<>();
+ ColumnFamilyHandle snapDiffJobCf;
+ ColumnFamilyHandle snapDiffReportCf;
+ String dbPath = getDbPath(ozoneManager.getConfiguration());
+
+ try {
+ // Add default CF
+ columnFamilyDescriptors.add(new ColumnFamilyDescriptor(
+ StringUtils.string2Bytes(DEFAULT_COLUMN_FAMILY_NAME),
+ columnFamilyOptions));
Review Comment:
Ok sounds good
--
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]