Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15350

Refactor EncryptedFileIO

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • Docs Required, Release Notes Required

    Description

      Current EncryptedFileIO has wierd implementations of several methods. Like

      @Override public int write(byte[] buf, int off, int len) throws IOException {
              throw new UnsupportedOperationException("Encrypted File doesn't support this operation");
          }
      
          @Override public int read(byte[] buf, int off, int len) throws IOException {
              throw new UnsupportedOperationException("Encrypted File doesn't support this operation");
          }
      

      Why not supported?

      Or:

      @Override public int read(ByteBuffer destBuf) throws IOException {
              assert position() == 0;
      
              return plainFileIO.read(destBuf);
          }
      

      Why encrypted reading is not supported beyond the header? Why `assert position() == 0`

      The class contains several writes and reading implemented differently. Some of them are not supported.

      Suggestion: Make one write(...) and one read(...) implementation and call them passing correct arguments. Read/write the header without encryption. Read/write everything beyond the header with encryption.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladsz83 Vladimir Steshin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: