yanghua commented on a change in pull request #8034: [FLINK-11733] Provide 
HadoopMapFunction for org.apache.hadoop.mapreduce.Mapper
URL: https://github.com/apache/flink/pull/8034#discussion_r276623123
 
 

 ##########
 File path: 
flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapreduce/wrapper/HadoopProxyMapper.java
 ##########
 @@ -0,0 +1,399 @@
+/*
+ * 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.hadoopcompatibility.mapreduce.wrapper;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.util.Collector;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.RawComparator;
+import org.apache.hadoop.mapreduce.Counter;
+import org.apache.hadoop.mapreduce.InputFormat;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.JobID;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.OutputCommitter;
+import org.apache.hadoop.mapreduce.OutputFormat;
+import org.apache.hadoop.mapreduce.Partitioner;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.TaskAttemptID;
+import org.apache.hadoop.security.Credentials;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.URI;
+
+/**
+ * This is a proxy maps a Hadoop Mapper (mapreduce API) which use reflection 
to get and invoke some method.
+ */
+public class HadoopProxyMapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> extends 
Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
 
 Review comment:
   @fhueske Actually, I also do not want to introduce a `HadoopProxyMapper`, 
But we should define a subclass of `Mapper<KEYIN, VALUEIN, KEYOUT, 
VALUEOUT>.Context` it's an inner class (non-static). If we just define a 
sperate class will report an error.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to