Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23811 )

Change subject: IMPALA-14641: Add detailed operation page for Catalogd 
operations
......................................................................


Patch Set 11:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java
File 
fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java:

http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@139
PS11, Line 139: initally
nit: "initially"


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@139
PS11, Line 139:
nit: add a period.


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@159
PS11, Line 159:     // Set timeline if provided
              :     if (timeline != null) {
              :       operation.timeline = timeline;
              :     }
This can be merged into the constructor of InFlightOperation.


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@192
PS11, Line 192:     // Then check if the operation is archived
              :     // Search backwards to find the most recent matching 
operation
              :     synchronized (finishedOperations_) {
              :       TCatalogOpRecord[] records = 
finishedOperations_.toArray(new TCatalogOpRecord[0]);
              :       for (int i = records.length - 1; i >= 0; i--) {
              :         TCatalogOpRecord record = records[i];
              :         if (record.getQuery_id().equals(queryId)
              :             && record.getThread_id() == 
Thread.currentThread().getId()) {
              :           // If start_time_ms is provided, use it to uniquely 
identify the operation
              :           if (startTimeMs > 0 && record.getStart_time_ms() != 
startTimeMs) {
              :             continue;
              :           }
              :           updater.accept(record);
              :           return;
              :         }
              :       }
              :     }
If we return the record in addRecord(), maybe we don't need these since 
increment() only updates in-flight records, and the JniCatalog methods can 
update response size directly using the returned record. Then 
updateRecordFields() is the only caller of this method. We can probably merge 
them.


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@318
PS11, Line 318:     if (queryId != null) {
Is it true that if queryId is not null, we can always find the inflight 
operation? If so, we can simply return fast when queryId == null and simplify 
the method.

The original code passes tTableName as a parameter. We can keep it as-it to not 
complicate this method.


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/catalog/monitor/CatalogOperationTracker.java@369
PS11, Line 369:   public void decrement(TResetMetadataRequest req, String 
errorMsg) {
Same in this method and the method for TUpdateCatalogRequest. Please check if 
we can return fast when queryId is null, i.e.

  public void decrement(TResetMetadataRequest req, String errorMsg) {
    if (!(req.isSetHeader() && req.getHeader().isSetQuery_id())) return;
    archiveRecord(req.getHeader().getQuery_id(), errorMsg);
    catalogResetMetadataCounter_.decrementOperation(req);
  }


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/service/JniCatalog.java
File fe/src/main/java/org/apache/impala/service/JniCatalog.java:

http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/service/JniCatalog.java@332
PS11, Line 332:     final long startTimeMs = 
CatalogOperationTracker.INSTANCE.addRecord(queryId,
We can let addRecord() returns the record and later use it directly in setting 
the response size. Then the code on L346-348 can be simplified.

record = CatalogOperationTracker.INSTANCE.addRecord(...)
...
record.setResponse_size_bytes(responseSize);


http://gerrit.cloudera.org:8080/#/c/23811/11/fe/src/main/java/org/apache/impala/service/JniCatalog.java@336
PS11, Line 336: []
Why do we need an array here?



--
To view, visit http://gerrit.cloudera.org:8080/23811
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib80ce3b5873672065b04b00a21d3419a1db0969c
Gerrit-Change-Number: 23811
Gerrit-PatchSet: 11
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Surya Hebbar <[email protected]>
Gerrit-Comment-Date: Thu, 26 Feb 2026 08:10:11 +0000
Gerrit-HasComments: Yes

Reply via email to