hemantk-12 commented on code in PR #5008:
URL: https://github.com/apache/ozone/pull/5008#discussion_r1249009133


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -113,8 +116,16 @@ private class SstFilteringTask implements BackgroundTask {
     @Override
     public BackgroundTaskResult call() throws Exception {
 
+      Optional<SnapshotCache> snapshotCache = Optional.ofNullable(ozoneManager)
+          .map(OzoneManager::getOmSnapshotManager)
+          .map(OmSnapshotManager::getSnapshotCache);
+      if (!snapshotCache.isPresent()) {

Review Comment:
   Yes, I understand that. But my point is if you expect cache to be non-null 
then it should be handle properly. If you sure that cache is only null when 
snapshot is disable then it is fine as I said earlier. But if not, then we 
should throw an exception when cache is null.



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RocksDatabase.java:
##########
@@ -1001,4 +1003,8 @@ protected void finalize() throws Throwable {
     }
     super.finalize();
   }
+
+  public ManagedRocksDB getDb() {

Review Comment:
   nit: `getManagedRocksDB()` because 
`OmSnapshot.getMetadataManager().getStore()).getDb().getDb()` is confusing.
   I agree that variable name could have been better. But it is what it is now.



##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -695,40 +696,25 @@ static List<ColumnFamilyDescriptor> getCFDescriptorList(
   /**
    * Read the current Live manifest for a given RocksDB instance (Active or
    * Checkpoint).
-   * @param dbPathArg path to a RocksDB directory
+   * @param rocksDB open rocksDB instance.
    * @return a list of SST files (without extension) in the DB.
    */
-  public HashSet<String> readRocksDBLiveFiles(String dbPathArg) {
-    ManagedRocksDB rocksDB = null;
+  public HashSet<String> readRocksDBLiveFiles(ManagedRocksDB rocksDB) {
     HashSet<String> liveFiles = new HashSet<>();
 
-    final ColumnFamilyOptions cfOpts = new ColumnFamilyOptions();
-    final List<ColumnFamilyDescriptor> cfDescriptors =

Review Comment:
   `getCFDescriptorList()` is not needed in source code anymore. Please move to 
test class.



-- 
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]

Reply via email to