masteryhx commented on code in PR #24322:
URL: https://github.com/apache/flink/pull/24322#discussion_r1511001449


##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBNativeMetricMonitor.java:
##########
@@ -114,7 +114,14 @@ private void setProperty(RocksDBNativePropertyMetricView 
metricView) {
         try {
             synchronized (lock) {
                 if (rocksDB != null) {
-                    long value = rocksDB.getLongProperty(metricView.handle, 
metricView.property);
+                    long value =
+                            metricView.property.contains(
+                                            
RocksDBProperty.NumFilesAtLevel.getRocksDBProperty())
+                                    ? Long.parseLong(
+                                            rocksDB.getProperty(
+                                                    metricView.handle, 
metricView.property))
+                                    : rocksDB.getLongProperty(
+                                            metricView.handle, 
metricView.property);

Review Comment:
   Hi, all. Sorry for the late reply.
   RocksDB expose different methods for different properties, so it's not a 
special case. 
   I'd suggest to handle this logic in `RocksDBProperty`: Define type of 
different propety and extract a common method in `RocksDBProperty` to decide 
which methods to call.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to