SteveYurongSu commented on code in PR #13364:
URL: https://github.com/apache/iotdb/pull/13364#discussion_r1837415740
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/SinglePageWholeChunkReader.java:
##########
@@ -101,16 +111,42 @@ public static ByteBuffer uncompressPageData(
+ pageHeader.getCompressedSize()
+ "page header: "
+ pageHeader
- + e.getMessage());
+ + e.getMessage(),
+ e);
}
- return ByteBuffer.wrap(uncompressedPageData);
+ return uncompressedPageData;
+ }
+
+ public static ByteBuffer decrypt(IDecryptor decryptor, ByteBuffer buffer) {
+ if (decryptor == null || decryptor.getEncryptionType() ==
EncryptionType.UNENCRYPTED) {
+ return buffer;
+ }
+ return ByteBuffer.wrap(
+ decryptor.decrypt(
+ buffer.array(), buffer.arrayOffset() + buffer.position(),
buffer.remaining()));
+ }
+
+ public static ByteBuffer decryptAndUncompressPageData(
+ PageHeader pageHeader,
+ IUnCompressor unCompressor,
+ ByteBuffer compressedPageData,
+ IDecryptor decryptor)
+ throws IOException {
+ ByteBuffer finalBuffer = decrypt(decryptor, compressedPageData);
+ finalBuffer = uncompressPageData(pageHeader, unCompressor, finalBuffer);
+ return finalBuffer;
Review Comment:
```suggestion
return uncompressPageData(pageHeader, unCompressor, decrypt(decryptor,
compressedPageData));
```
--
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]