You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/08/12 15:19:00 UTC

[GitHub] [ignite] Vladsz83 commented on a change in pull request #9269: IGNITE-15159 : Manual encrypted snapshots.

Vladsz83 commented on a change in pull request #9269:
URL: https://github.com/apache/ignite/pull/9269#discussion_r687829823



##########
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:
       We don't decrypt because implementation on this FileIO deprecated chipered reads for data with offsets 0. You can notice `assert position() == 0` before this PR. Same here, we deprecate chipered reads. Why? This question is about design of EncryptedFileIO. Surely, it requires some refactoring, revising all its methods. See
   ```
   @Override public int read(byte[] buf, int off, int len) throws IOException {
           throw new UnsupportedOperationException("Encrypted File doesn't support this operation");
       }
   ```
   Same here. However, refactoring of EncriptedFileIO is definitely out of scope of this ticket. 




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org