hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/4] Lint/style fixes and removal of unused code
Date Fri, 05 Sep 2014 17:43:28 GMT
Repository: hadoop
Updated Branches:
  refs/heads/MR-2841 00322161b -> 19bd6659a


http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTest.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTest.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTest.java
index 2258726..f81d94f 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTest.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTest.java
@@ -74,13 +74,14 @@ public class NonSortTest {
   public void startUp() throws Exception {
     Assume.assumeTrue(NativeCodeLoader.isNativeCodeLoaded());
     Assume.assumeTrue(NativeRuntime.isNativeLibraryLoaded());
-    final ScenarioConfiguration configuration = new ScenarioConfiguration();
-    configuration.addNonSortTestConf();
-    final FileSystem fs = FileSystem.get(configuration);
+    final ScenarioConfiguration conf = new ScenarioConfiguration();
+    conf.addNonSortTestConf();
+    final FileSystem fs = FileSystem.get(conf);
     final Path path = new Path(TestConstants.NATIVETASK_NONSORT_TEST_INPUTDIR);
     if (!fs.exists(path)) {
-      new TestInputFile(configuration.getInt(TestConstants.NATIVETASK_NONSORTTEST_FILESIZE,
10000000), Text.class.getName(),
-          Text.class.getName(), configuration).createSequenceTestFile(path.toString());
+      int filesize = conf.getInt(TestConstants.NATIVETASK_NONSORTTEST_FILESIZE, 10000000);
+      new TestInputFile(filesize, Text.class.getName(),
+          Text.class.getName(), conf).createSequenceTestFile(path.toString());
     }
     fs.close();
   }
@@ -93,7 +94,8 @@ public class NonSortTest {
   }
 
 
-  private Job getJob(Configuration conf, String jobName, String inputpath, String outputpath)
throws IOException {
+  private Job getJob(Configuration conf, String jobName,
+                     String inputpath, String outputpath) throws IOException {
     final FileSystem fs = FileSystem.get(conf);
     if (fs.exists(new Path(outputpath))) {
       fs.delete(new Path(outputpath), true);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTestMR.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTestMR.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTestMR.java
index 4ca2449..4092e5f 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTestMR.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/nonsorttest/NonSortTestMR.java
@@ -36,7 +36,8 @@ public class NonSortTestMR {
     private final Text word = new Text();
 
     @Override
-    public void map(Object key, Text value, Context context) throws IOException, InterruptedException
{
+    public void map(Object key, Text value, Context context)
+      throws IOException, InterruptedException {
       final String line = value.toString();
       final StringTokenizer tokenizer = new StringTokenizer(line);
       while (tokenizer.hasMoreTokens()) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestKVSerializer.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestKVSerializer.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestKVSerializer.java
index 004e8b8..fd5b100 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestKVSerializer.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestKVSerializer.java
@@ -79,13 +79,15 @@ public class TestKVSerializer extends TestCase {
     final DataOutputStream dataOut = Mockito.mock(DataOutputStream.class);
 
     Mockito.when(dataOut.hasUnFlushedData()).thenReturn(true);
-    Mockito.when(dataOut.shortOfSpace(key.length + value.length + Constants.SIZEOF_KV_LENGTH)).thenReturn(true);
+    Mockito.when(dataOut.shortOfSpace(key.length + value.length +
+                                      Constants.SIZEOF_KV_LENGTH)).thenReturn(true);
     final int written = serializer.serializeKV(dataOut, key, value);
 
     // flush once, write 4 int, and 2 byte array
     Mockito.verify(dataOut, Mockito.times(1)).flush();
     Mockito.verify(dataOut, Mockito.times(4)).writeInt(Matchers.anyInt());
-    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class), Matchers.anyInt(),
Matchers.anyInt());
+    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class),
+                                                    Matchers.anyInt(), Matchers.anyInt());
 
     Assert.assertEquals(written, key.length + value.length + Constants.SIZEOF_KV_LENGTH);
   }
@@ -101,7 +103,8 @@ public class TestKVSerializer extends TestCase {
     // flush 0, write 4 int, and 2 byte array
     Mockito.verify(dataOut, Mockito.times(0)).flush();
     Mockito.verify(dataOut, Mockito.times(4)).writeInt(Matchers.anyInt());
-    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class), Matchers.anyInt(),
Matchers.anyInt());
+    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class),
+                                                    Matchers.anyInt(), Matchers.anyInt());
 
     Assert.assertEquals(written, key.length + value.length + Constants.SIZEOF_KV_LENGTH);
   }
@@ -112,14 +115,16 @@ public class TestKVSerializer extends TestCase {
     Mockito.when(dataOut.hasUnFlushedData()).thenReturn(true);
     Mockito.when(
         dataOut
-        .shortOfSpace(key.length + value.length + Constants.SIZEOF_KV_LENGTH + Constants.SIZEOF_PARTITION_LENGTH))
+        .shortOfSpace(key.length + value.length +
+                      Constants.SIZEOF_KV_LENGTH + Constants.SIZEOF_PARTITION_LENGTH))
         .thenReturn(true);
     final int written = serializer.serializePartitionKV(dataOut, 100, key, value);
 
     // flush once, write 4 int, and 2 byte array
     Mockito.verify(dataOut, Mockito.times(1)).flush();
     Mockito.verify(dataOut, Mockito.times(5)).writeInt(Matchers.anyInt());
-    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class), Matchers.anyInt(),
Matchers.anyInt());
+    Mockito.verify(dataOut, Mockito.times(2)).write(Matchers.any(byte[].class),
+                                                    Matchers.anyInt(), Matchers.anyInt());
 
     Assert.assertEquals(written, key.length + value.length + Constants.SIZEOF_KV_LENGTH
         + Constants.SIZEOF_PARTITION_LENGTH);
@@ -137,6 +142,7 @@ public class TestKVSerializer extends TestCase {
     Assert.assertTrue(serializer.deserializeKV(in, key, value) > 0);
 
     Mockito.verify(in, Mockito.times(4)).readInt();
-    Mockito.verify(in, Mockito.times(2)).readFully(Matchers.any(byte[].class), Matchers.anyInt(),
Matchers.anyInt());
+    Mockito.verify(in, Mockito.times(2)).readFully(Matchers.any(byte[].class),
+                                                   Matchers.anyInt(), Matchers.anyInt());
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestNativeSerialization.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestNativeSerialization.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestNativeSerialization.java
index 4b67454..cf708a1 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestNativeSerialization.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/serde/TestNativeSerialization.java
@@ -93,7 +93,8 @@ public class TestNativeSerialization extends TestCase {
   public static class NonWritableValue {
   }
 
-  public static class ComparableKeySerializer implements INativeComparable, INativeSerializer<WritableKey>
{
+  public static class ComparableKeySerializer
+    implements INativeComparable, INativeSerializer<WritableKey> {
 
     @Override
     public int getLength(WritableKey w) throws IOException {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/EnforceNativeOutputCollectorDelegator.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/EnforceNativeOutputCollectorDelegator.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/EnforceNativeOutputCollectorDelegator.java
index 18ca629..7212236 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/EnforceNativeOutputCollectorDelegator.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/EnforceNativeOutputCollectorDelegator.java
@@ -23,7 +23,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.mapred.nativetask.NativeMapOutputCollectorDelegator;
 
-public class EnforceNativeOutputCollectorDelegator<K, V> extends NativeMapOutputCollectorDelegator<K,
V> {
+public class EnforceNativeOutputCollectorDelegator<K, V>
+  extends NativeMapOutputCollectorDelegator<K, V> {
   private static final Log LOG = LogFactory.getLog(EnforceNativeOutputCollectorDelegator.class);
   private boolean nativetaskloaded = false;
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/ResultVerifier.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/ResultVerifier.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/ResultVerifier.java
index 8a7916b..5749691 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/ResultVerifier.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/ResultVerifier.java
@@ -35,11 +35,8 @@ public class ResultVerifier {
   /**
    * verify the result
    * 
-   * @param sample
-   *          :nativetask output
-   * @param source
-   *          :yuanwenjian
-   * @throws Exception
+   * @param sample the path to correct results
+   * @param source the path to the results from the native implementation
    */
   public static boolean verify(String sample, String source) throws Exception {
     FSDataInputStream sourcein = null;
@@ -76,8 +73,9 @@ public class ResultVerifier {
         }
       }
       if (samplepath == null) {
-        throw new Exception("cound not found file " + samplepaths[0].getParent() + "/" +
sourcepath.getName()
-            + " , as sourcepaths has such file");
+        throw new Exception("cound not find file " +
+                            samplepaths[0].getParent() + "/" + sourcepath.getName()
+                            + " , as sourcepaths has such file");
       }
 
       // compare
@@ -141,7 +139,8 @@ public class ResultVerifier {
     return true;
   }
 
-  public static void verifyCounters(Job normalJob, Job nativeJob, boolean hasCombiner) throws
IOException {
+  public static void verifyCounters(Job normalJob, Job nativeJob, boolean hasCombiner)
+      throws IOException {
     Counters normalCounters = normalJob.getCounters();
     Counters nativeCounters = nativeJob.getCounters();
     assertEquals("Counter MAP_OUTPUT_RECORDS should be equal",

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19bd6659/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/TestInput.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/TestInput.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/TestInput.java
index 6713a4a..23fb1ef 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/TestInput.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/testutil/TestInput.java
@@ -29,10 +29,11 @@ public class TestInput {
     public V value;
   }
 
-  public static char[] CHAR_SET = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N',
-    'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
-    'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0',
'1', '2', '3', '4', '5',
-    '6', '7', '8', '9', '*', '/' };
+  public static char[] CHAR_SET = new char[] {
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
+    'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+    'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
+    'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '/' };
 
   public static KV[] getMapInputs(int size) {
 


Mime
View raw message