timoninmaxim commented on a change in pull request #9269:
URL: https://github.com/apache/ignite/pull/9269#discussion_r689423973
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/EncryptedFileIO.java
##########
@@ -67,15 +67,15 @@
* @param plainFileIO Underlying file.
* @param groupId Group id.
* @param pageSize Size of plain data page in bytes.
- * @param headerSize Size of file header in bytes.
+ * @param plainHeader Size of file header in bytes which is never
encrypted.
Review comment:
Let's rename `plainHeader` to `plainHeaderSize`.
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/EncryptedFileIO.java
##########
@@ -109,7 +109,7 @@
/** {@inheritDoc} */
@Override public int read(ByteBuffer destBuf) throws IOException {
- assert position() == 0;
+ assert position() == 0 && headerSize > 0;
return plainFileIO.read(destBuf);
Review comment:
If the `read()` method is forbidden, so what is a reason to change it?
Could we throw an exception there instead?
--
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]