THUMarkLau commented on code in PR #12476:
URL: https://github.com/apache/iotdb/pull/12476#discussion_r1642261996


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/WALEntryPosition.java:
##########
@@ -135,6 +136,26 @@ public FileChannel openReadFileChannel() throws 
IOException {
     }
   }
 
+  public WALInputStream openReadFileStream() throws IOException {
+    if (isInSealedFile()) {
+      walFile = walNode.getWALFile(walFileVersionId);
+      return new WALInputStream(walFile);
+    } else {
+      try {
+        walFile = walNode.getWALFile(walFileVersionId);
+        return new WALInputStream(walFile);
+      } catch (IOException e) {
+        // unsealed file may be renamed after sealed, so we should try again
+        if (isInSealedFile()) {
+          walFile = walNode.getWALFile(walFileVersionId);
+          return new WALInputStream(walFile);
+        } else {
+          throw e;
+        }
+      }
+    }

Review Comment:
   Done



-- 
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