cshuo commented on code in PR #18484:
URL: https://github.com/apache/hudi/pull/18484#discussion_r3061725197
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/index/RocksDBIndexBackend.java:
##########
@@ -52,6 +61,41 @@ public void update(String recordKey,
HoodieRecordGlobalLocation recordGlobalLoca
this.rocksDBDAO.put(COLUMN_FAMILY, recordKey, recordGlobalLocation);
}
+ @Override
+ public void registerMetrics(MetricGroup metricGroup) {
+ if (rocksDBIndexMetrics != null) {
+ return;
+ }
+ this.rocksDBIndexMetrics = new FlinkRocksDBIndexMetrics(metricGroup, this);
+ this.rocksDBIndexMetrics.registerMetrics();
+ }
+
+ @VisibleForTesting
+ void flush() {
+ this.rocksDBDAO.flush();
+ }
+
+ public long getLongMetric(String property) {
+ try {
+ return this.rocksDBDAO.getLongProperty(property);
+ } catch (RocksDBException | RuntimeException e) {
+ log.debug("Failed to read RocksDB metric property {}", property, e);
Review Comment:
That's acceptable for metrics, since it only happens when the job is being
shutdown.
--
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]