sashapolo commented on code in PR #4224:
URL: https://github.com/apache/ignite-3/pull/4224#discussion_r1728736231


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/compaction/Compactor.java:
##########
@@ -216,6 +220,11 @@ void doCompaction() {
                 break;
             }
 
+            // TODO Expand the comment. 
https://issues.apache.org/jira/browse/IGNITE-23056
+            LOG.info("Starting new compaction round [files={}]", queue.size());

Review Comment:
   I would suggest to use `isInfoEnabled` since the parameters used here are 
not calculated for free



##########
modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/LoggingRocksDbFlushListener.java:
##########
@@ -87,4 +98,28 @@ protected void onFlushBeginCallback(RocksDB db, FlushJobInfo 
flushJobInfo) {
     protected void onFlushCompletedCallback(RocksDB db, FlushJobInfo 
flushJobInfo) {
         // No-op.
     }
+
+    @Override
+    public void onCompactionBegin(RocksDB db, CompactionJobInfo 
compactionJobInfo) {
+        if (lastCompactionEventType.compareAndSet(ON_COMPACTION_COMPLETED, 
ON_COMPACTION_BEGIN)) {
+            LOG.info("Starting rocksdb compaction process [name='{}', 
reason={}, input={}, output={}]",
+                    name,
+                    compactionJobInfo.compactionReason(),
+                    // Extract file names from full paths.
+                    compactionJobInfo.inputFiles().stream().map(path -> 
Paths.get(path).getFileName()).collect(Collectors.toList()),
+                    compactionJobInfo.outputFiles().stream().map(path -> 
Paths.get(path).getFileName()).collect(Collectors.toList())
+            );
+
+            lastCompactionStartTimeNanos = System.nanoTime();
+        }
+    }
+
+    @Override
+    public void onCompactionCompleted(RocksDB db, CompactionJobInfo 
compactionJobInfo) {
+        if (lastCompactionEventType.compareAndSet(ON_COMPACTION_BEGIN, 
ON_COMPACTION_COMPLETED)) {
+            long duration = System.nanoTime() - lastCompactionStartTimeNanos;

Review Comment:
   and here =)



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/compaction/Compactor.java:
##########
@@ -268,6 +277,9 @@ void doCompaction() {
 
             // Wait and check for errors.
             CompletableFuture.allOf(futures).join();
+
+            // TODO Expand the comment. 
https://issues.apache.org/jira/browse/IGNITE-23056, handle an exception too.
+            LOG.info("Compaction round finished [duration={}ms]", 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start));

Review Comment:
   Same here



##########
modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/LoggingRocksDbFlushListener.java:
##########
@@ -87,4 +98,28 @@ protected void onFlushBeginCallback(RocksDB db, FlushJobInfo 
flushJobInfo) {
     protected void onFlushCompletedCallback(RocksDB db, FlushJobInfo 
flushJobInfo) {
         // No-op.
     }
+
+    @Override
+    public void onCompactionBegin(RocksDB db, CompactionJobInfo 
compactionJobInfo) {
+        if (lastCompactionEventType.compareAndSet(ON_COMPACTION_COMPLETED, 
ON_COMPACTION_BEGIN)) {
+            LOG.info("Starting rocksdb compaction process [name='{}', 
reason={}, input={}, output={}]",

Review Comment:
   And 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