This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch cp14312
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/cp14312 by this push:
     new a5577f19558 Pipe: Fix potential NPE from 
WALEntryHandler#getInsertNodeViaCacheIfPossible & Improve performance for pipe 
slightly (#14312)
a5577f19558 is described below

commit a5577f195580b2df174550e6d582b60840919178
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Dec 4 19:03:15 2024 +0800

    Pipe: Fix potential NPE from 
WALEntryHandler#getInsertNodeViaCacheIfPossible & Improve performance for pipe 
slightly (#14312)
    
    (cherry picked from commit f84a52eca0f1b5c25262b4209f501c6f95624136)
---
 .../iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java
index edc67edccfa..de2379c380e 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java
@@ -89,8 +89,9 @@ public class WALEntryHandler {
 
   public InsertNode getInsertNodeViaCacheIfPossible() {
     try {
-      return value instanceof InsertNode
-          ? (InsertNode) value
+      final WALEntryValue finalValue = value;
+      return finalValue instanceof InsertNode
+          ? (InsertNode) finalValue
           : 
walEntryPosition.readByteBufferOrInsertNodeViaCacheDirectly().getRight();
     } catch (Exception e) {
       logger.warn("Fail to get insert node via cache. {}", this, e);

Reply via email to