rkhachatryan commented on code in PR #24031:
URL: https://github.com/apache/flink/pull/24031#discussion_r1443421426


##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java:
##########
@@ -154,6 +162,54 @@ private static void deleteRange(
         }
     }
 
+    /**
+     * Clip the entries in the CF according to the range [begin_key, end_key). 
Any entries outside
+     * this range will be completely deleted (including tombstones).
+     *
+     * @param db the target need to be clipped.
+     * @param columnFamilyHandles the column family need to be clipped.
+     * @param beginKeyBytes the begin key bytes
+     * @param endKeyBytes the end key bytes
+     */
+    public static void clipColumnFamilies(
+            RocksDB db,
+            List<ColumnFamilyHandle> columnFamilyHandles,
+            byte[] beginKeyBytes,
+            byte[] endKeyBytes)
+            throws RocksDBException {
+
+        for (ColumnFamilyHandle columnFamilyHandle : columnFamilyHandles) {
+            db.clipColumnFamily(columnFamilyHandle, beginKeyBytes, 
endKeyBytes);
+        }
+    }
+
+    public static List<Pair<RegisteredStateMetaInfoBase, 
ExportImportFilesMetaData>>
+            exportColumnFamilies(
+                    RocksDB db,
+                    List<ColumnFamilyHandle> columnFamilyHandles,
+                    List<StateMetaInfoSnapshot> stateMetaInfoSnapshots,

Review Comment:
   These two lists should match each other, right?
   Should we check with `Preconditions.checkState(columnFamilyHandles.size() == 
stateMetaInfoSnapshots.size());`,
   or better pass RocksDB instance 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]

Reply via email to