liujiawinds commented on code in PR #19844:
URL: https://github.com/apache/flink/pull/19844#discussion_r927577711


##########
flink-formats/flink-orc/src/main/java/org/apache/flink/orc/writer/EncryptionProvider.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * 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 org.apache.flink.orc.writer;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.orc.OrcFile;
+import org.apache.orc.TypeDescription;
+import org.apache.orc.impl.CryptoUtils;
+import org.apache.orc.impl.HadoopShims;
+import org.apache.orc.impl.KeyProvider;
+import org.apache.orc.impl.writer.WriterEncryptionKey;
+import org.apache.orc.impl.writer.WriterEncryptionVariant;
+
+import java.io.IOException;
+import java.security.SecureRandom;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * Copy encryption variants generation code from org.apache.orc:orc-core:1.7.2 
{@link
+ * org.apache.orc.impl.WriterImpl}. It's used to get encryption variants which 
are same as {@link
+ * org.apache.orc.impl.WriterImpl} generated.
+ *
+ * <p>NOTE: This class will be removed after ORC-1200 is merged.
+ */
+public class EncryptionProvider {
+
+    private final SortedMap<String, WriterEncryptionKey> keys = new 
TreeMap<>();
+
+    private final OrcFile.WriterOptions opts;
+
+    public EncryptionProvider(OrcFile.WriterOptions opts) {
+        this.opts = opts;
+    }
+
+    public WriterEncryptionVariant[] getEncryptionVariants() throws 
IOException {

Review Comment:
   done



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to