rdblue commented on a change in pull request #107: Integrate encryption into 
datasource
URL: https://github.com/apache/incubator-iceberg/pull/107#discussion_r261716650
 
 

 ##########
 File path: 
core/src/main/java/com/netflix/iceberg/encryption/PlaintextEncryptionManager.java
 ##########
 @@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.netflix.iceberg.encryption;
+
+import com.netflix.iceberg.io.InputFile;
+import com.netflix.iceberg.io.OutputFile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.ByteBuffer;
+
+public class PlaintextEncryptionManager implements EncryptionManager {
+  private static final Logger LOG = 
LoggerFactory.getLogger(PlaintextEncryptionManager.class);
+
+  @Override
+  public InputFile decrypt(EncryptedInputFile encrypted) {
+    if (encrypted.keyMetadata().keyMetadata() != null) {
 
 Review comment:
   Not part of this commit, but this is awkward: 
`encrypted.keyMetadata().keyMetadata()`.
   
   @mccheah, what about renaming `EncryptionKeyMetadata.keyMetadata()` to 
`EncryptionKeyMetadata.buffer()`? That's descriptive and makes it more clear 
what is happening in places like this.
   
   We may also want to introduce a singleton like 
`EncryptionKeyMetdata.empty()` to avoid creating a lot of empty objects.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to