tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-1905. Fix findbugs warnings in tez-tests. (hitesh)
Date Thu, 15 Jan 2015 19:20:32 GMT
Repository: tez
Updated Branches:
  refs/heads/master 61bb0f8a0 -> b723a05da


TEZ-1905. Fix findbugs warnings in tez-tests. (hitesh)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/b723a05d
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/b723a05d
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/b723a05d

Branch: refs/heads/master
Commit: b723a05da8093acb353b26b90feee51635991aa7
Parents: 61bb0f8
Author: Hitesh Shah <hitesh@apache.org>
Authored: Thu Jan 15 11:20:07 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Thu Jan 15 11:20:07 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 tez-tests/findbugs-exclude.xml                            | 10 ++++++++++
 .../mapreduce/examples/BroadcastAndOneToOneExample.java   |  1 -
 .../org/apache/tez/mapreduce/examples/RPCLoadGen.java     |  7 ++++---
 .../org/apache/tez/mapreduce/examples/SecondarySort.java  |  2 +-
 .../examples/helpers/SplitsInClientOptionParser.java      |  2 +-
 6 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 97f9e1d..dd183a0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ Release 0.7.0: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-1905. Fix findbugs warnings in tez-tests.
   TEZ-1945. Remove 2 GB memlimit restriction in MergeManager.
   TEZ-1913. Reduce deserialize cost in ValuesIterator.
   TEZ-1917. Examples should extend TezExampleBase.

http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/tez-tests/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/tez-tests/findbugs-exclude.xml b/tez-tests/findbugs-exclude.xml
index 5b11308..2bff0ae 100644
--- a/tez-tests/findbugs-exclude.xml
+++ b/tez-tests/findbugs-exclude.xml
@@ -13,4 +13,14 @@
 -->
 <FindBugsFilter>
 
+  <Match>
+    <Class name="org.apache.tez.mapreduce.examples.SecondarySort$FirstGroupingComparator"
/>
+    <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
+  </Match>
+
+  <Match>
+    <Class name="org.apache.tez.mapreduce.examples.SecondarySort$IntPair$Comparator" />
+    <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
+  </Match>
+
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/BroadcastAndOneToOneExample.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/BroadcastAndOneToOneExample.java
b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/BroadcastAndOneToOneExample.java
index 69711d0..96dff26 100644
--- a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/BroadcastAndOneToOneExample.java
+++ b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/BroadcastAndOneToOneExample.java
@@ -186,7 +186,6 @@ public class BroadcastAndOneToOneExample extends Configured implements
Tool {
     }
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     UserGroupInformation.setConfiguration(tezConf);
-    String user = UserGroupInformation.getCurrentUser().getShortUserName();
 
     // staging dir
     FileSystem fs = FileSystem.get(tezConf);

http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/RPCLoadGen.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/RPCLoadGen.java b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/RPCLoadGen.java
index 67cf328..9caab18 100644
--- a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/RPCLoadGen.java
+++ b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/RPCLoadGen.java
@@ -60,6 +60,7 @@ public class RPCLoadGen extends TezExampleBase {
   private static final byte VIA_HDFS_DIST_CACHE_BYTE = (byte) 0x01;
   private static final String VIA_HDFS_DIRECT_READ = "viaHdfsDirectRead";
   private static final byte VIA_HDFS_DIRECT_READ_BYTE = (byte) 0x02;
+  private static final Random random = new Random();
 
   private static final String DISK_PAYLOAD_NAME = RPCLoadGen.class.getSimpleName() + "_payload";
 
@@ -137,7 +138,7 @@ public class RPCLoadGen extends TezExampleBase {
         payloadSize = 5; // To Configure the processor
       }
       byte[] payloadBytes = new byte[payloadSize];
-      new Random().nextBytes(payloadBytes);
+      random.nextBytes(payloadBytes);
       payload = ByteBuffer.wrap(payloadBytes);
       payload.put(4, VIA_RPC_BYTE); // ViaRPC
     } else {
@@ -147,7 +148,7 @@ public class RPCLoadGen extends TezExampleBase {
 
       // Disk payload
       byte[] diskPayload = new byte[payloadSize];
-      new Random().nextBytes(diskPayload);
+      random.nextBytes(diskPayload);
       fs = FileSystem.get(conf);
       resourcePath = new Path(Path.SEPARATOR + "tmp", DISK_PAYLOAD_NAME);
       System.err.println("ZZZ: HDFSPath: " + resourcePath);
@@ -188,7 +189,7 @@ public class RPCLoadGen extends TezExampleBase {
     @Override
     public void run() throws Exception {
       Stopwatch sw = new Stopwatch().start();
-      long sleepTime = new Random().nextInt(sleepTimeMax);
+      long sleepTime = random.nextInt(sleepTimeMax);
       if (modeByte == VIA_RPC_BYTE) {
         LOG.info("Received via RPC.");
       } else if (modeByte == VIA_HDFS_DIST_CACHE_BYTE) {

http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/SecondarySort.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/SecondarySort.java
b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/SecondarySort.java
index cdae905..869a77d 100644
--- a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/SecondarySort.java
+++ b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/SecondarySort.java
@@ -217,7 +217,7 @@ public class SecondarySort extends Configured implements Tool {
     if (otherArgs.length != 2) {
       System.err.println("Usage: secondarysort <in> <out>");
       ToolRunner.printGenericCommandUsage(System.out);
-      System.exit(2);
+      return 2;
     }
     Job job = new Job(conf, "secondary sort");
     job.setJarByClass(SecondarySort.class);

http://git-wip-us.apache.org/repos/asf/tez/blob/b723a05d/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/helpers/SplitsInClientOptionParser.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/helpers/SplitsInClientOptionParser.java
b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/helpers/SplitsInClientOptionParser.java
index 93ec860..cabc3c4 100644
--- a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/helpers/SplitsInClientOptionParser.java
+++ b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/helpers/SplitsInClientOptionParser.java
@@ -42,7 +42,7 @@ public class SplitsInClientOptionParser {
   public String[] getRemainingArgs() {
     Preconditions.checkState(parsed,
         "Cannot get remaining args without parsing");
-    return otherArgs;
+    return otherArgs.clone();
   }
 
   @SuppressWarnings("static-access")


Mime
View raw message