ctubbsii commented on a change in pull request #499: Implement new Encryption 
interface
URL: https://github.com/apache/accumulo/pull/499#discussion_r190425241
 
 

 ##########
 File path: 
core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
 ##########
 @@ -403,20 +355,13 @@ public void close() throws IOException {
           long offsetIndexMeta = out.position();
           metaIndex.write(out);
 
-          if (cryptoParams.getCipherSuite() == null || 
cryptoParams.getCipherSuite()
-              .equals(Property.CRYPTO_CIPHER_SUITE.getDefaultValue())) {
-            out.writeLong(offsetIndexMeta);
-            API_VERSION_1.write(out);
-          } else {
-            long offsetCryptoParameters = out.position();
-            cryptoParams.write(out);
-
-            // Meta Index, crypto params offsets and the trailing section are 
written out directly.
-            out.writeLong(offsetIndexMeta);
-            out.writeLong(offsetCryptoParameters);
-            API_VERSION.write(out);
-          }
+          long offsetCryptoParameter = out.position();
+          String es = this.encryptionStrategy.getClass().getName();
+          out.writeUTF(es);
 
 Review comment:
   I don't think the overall encryption strategy should be serialized into the 
files. The pluggable encryption strategy could change, and the current strategy 
should be required to be able to interpret anything previously written. So, I 
don't think it's necessary to serialize the name of the strategy here... but 
perhaps we should permit it some opportunity write some magic values/parameters 
that it (or its future replacement, if swapped out) could recognize?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to