Skip to content

Commit f84a52e

Browse files
Pipe: Fix potential NPE from WALEntryHandler#getInsertNodeViaCacheIfPossible & Improve performance for pipe slightly (apache#14312)
1 parent 4f4dd79 commit f84a52e

File tree

1 file changed

+3
-2
lines changed
  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils

1 file changed

+3
-2
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ public void unpinMemTable() throws MemTablePinException {
8989

9090
public InsertNode getInsertNodeViaCacheIfPossible() {
9191
try {
92-
return value instanceof InsertNode
93-
? (InsertNode) value
92+
final WALEntryValue finalValue = value;
93+
return finalValue instanceof InsertNode
94+
? (InsertNode) finalValue
9495
: walEntryPosition.readByteBufferOrInsertNodeViaCacheDirectly().getRight();
9596
} catch (Exception e) {
9697
logger.warn("Fail to get insert node via cache. {}", this, e);

0 commit comments

Comments
 (0)