Selaa lähdekoodia

Merge -c 1306984 from branch-1 to branch-1.0 to fix HADOOP-5528. Ensure BinaryPartitioner is present in mapred libs. Contributed by Klaas Bosteels.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0@1306985 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 13 vuotta sitten
vanhempi
commit
c2afb12b25
2 muutettua tiedostoa jossa 42 lisäystä ja 0 poistoa
  1. 3 0
      CHANGES.txt
  2. 39 0
      src/mapred/org/apache/hadoop/mapred/lib/BinaryPartitioner.java

+ 3 - 0
CHANGES.txt

@@ -25,6 +25,9 @@ Release 1.0.3 - unreleased
     MAPREDUCE-3377. Ensure OutputCommitter.checkOutputSpecs is called prior to
     copying job.xml. (Jane Chen via acmurthy)
 
+    HADOOP-5528. Ensure BinaryPartitioner is present in mapred libs. (Klaas
+    Bosteels via acmurthy)
+
 Release 1.0.2 - 2012.03.24
 
   NEW FEATURES

+ 39 - 0
src/mapred/org/apache/hadoop/mapred/lib/BinaryPartitioner.java

@@ -0,0 +1,39 @@
+/**
+ * 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.hadoop.mapred.lib;
+
+import org.apache.hadoop.io.BinaryComparable;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.Partitioner;
+
+/**
+ * Partition {@link BinaryComparable} keys using a configurable part of 
+ * the bytes array returned by {@link BinaryComparable#getBytes()}. 
+ * 
+ * @see org.apache.hadoop.mapreduce.lib.partition.BinaryPartitioner
+ */
+public class BinaryPartitioner<V>  
+  extends org.apache.hadoop.mapreduce.lib.partition.BinaryPartitioner<V>
+  implements Partitioner<BinaryComparable, V> {
+  
+  public void configure(JobConf job) {
+    super.setConf(job);
+  }
+  
+}