tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject tez git commit: TEZ-1883. Change findbugs version to 3.x. (sseth)
Date Thu, 28 May 2015 21:24:03 GMT
Repository: tez
Updated Branches:
  refs/heads/master 17b6aba9c -> b9056657a


TEZ-1883. Change findbugs version to 3.x. (sseth)


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

Branch: refs/heads/master
Commit: b9056657a101b33c96195655079b1eb03ebb3c95
Parents: 17b6aba
Author: Siddharth Seth <sseth@apache.org>
Authored: Thu May 28 14:23:43 2015 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Thu May 28 14:23:43 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 build-tools/test-patch.sh                                     | 2 +-
 pom.xml                                                       | 4 ++--
 .../src/main/java/org/apache/tez/dag/records/TezDAGID.java    | 2 +-
 tez-dag/findbugs-exclude.xml                                  | 7 +++++++
 .../src/main/java/org/apache/tez/dag/app/DAGAppMaster.java    | 2 +-
 tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java     | 7 ++++---
 .../apache/tez/dag/utils/Simple2LevelVersionComparator.java   | 2 +-
 .../apache/hadoop/mapred/split/TezMapredSplitsGrouper.java    | 3 +--
 .../hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java     | 2 +-
 .../java/org/apache/tez/mapreduce/hadoop/IDConverter.java     | 2 +-
 tez-runtime-library/findbugs-exclude.xml                      | 6 ++++++
 .../apache/tez/runtime/library/processor/SleepProcessor.java  | 2 +-
 .../tez/mapreduce/examples/BroadcastAndOneToOneExample.java   | 2 +-
 .../java/org/apache/tez/mapreduce/examples/MRRSleepJob.java   | 2 +-
 15 files changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ef9a839..ece14a3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@ INCOMPATIBLE CHANGES
   TEZ-2468. Change the minimum Java version to Java 7.
 
 ALL CHANGES:
+  TEZ-1883. Change findbugs version to 3.x.
   TEZ-2440. Sorter should check for indexCacheList.size() in flush().
   TEZ-2490. TEZ-2450 breaks Hadoop 2.2 and 2.4 compatability.
   TEZ-2450. support async http clients in ordered & unordered inputs.

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/build-tools/test-patch.sh
----------------------------------------------------------------------
diff --git a/build-tools/test-patch.sh b/build-tools/test-patch.sh
index 7218b87..0ac2bac 100755
--- a/build-tools/test-patch.sh
+++ b/build-tools/test-patch.sh
@@ -525,7 +525,7 @@ buildAndInstall () {
 ###############################################################################
 ### Check there are no changes in the number of Findbugs warnings
 checkFindbugsWarnings () {
-  findbugs_version=`${FINDBUGS_HOME}/bin/findbugs -version`
+  findbugs_version=$(${AWK} 'match($0, /findbugs-maven-plugin:[^:]*:findbugs/) { print substr($0,
RSTART + 22, RLENGTH - 31); exit }' "${PATCH_DIR}/patchFindBugsOutput${module_suffix}.txt")
   echo ""
   echo ""
   echo "======================================================================"

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2922cab..cafba97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -629,7 +629,7 @@
       <dependency>
         <groupId>com.google.code.findbugs</groupId>
         <artifactId>jsr305</artifactId>
-        <version>2.0.3</version>
+        <version>3.0.0</version>
       </dependency>
       <dependency>
         <groupId>com.sun.jersey</groupId>
@@ -781,7 +781,7 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>findbugs-maven-plugin</artifactId>
-          <version>2.5.2</version>
+          <version>3.0.1</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-common/src/main/java/org/apache/tez/dag/records/TezDAGID.java
----------------------------------------------------------------------
diff --git a/tez-common/src/main/java/org/apache/tez/dag/records/TezDAGID.java b/tez-common/src/main/java/org/apache/tez/dag/records/TezDAGID.java
index 0fe1d44..27cc751 100644
--- a/tez-common/src/main/java/org/apache/tez/dag/records/TezDAGID.java
+++ b/tez-common/src/main/java/org/apache/tez/dag/records/TezDAGID.java
@@ -99,7 +99,7 @@ public class TezDAGID extends TezID {
 
   
   private TezDAGID(String yarnRMIdentifier, int appId, int id) {
-    this(ApplicationId.newInstance(Long.valueOf(yarnRMIdentifier),
+    this(ApplicationId.newInstance(Long.parseLong(yarnRMIdentifier),
         appId), id);
   }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-dag/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/tez-dag/findbugs-exclude.xml b/tez-dag/findbugs-exclude.xml
index 57c0aca..c89a9d2 100644
--- a/tez-dag/findbugs-exclude.xml
+++ b/tez-dag/findbugs-exclude.xml
@@ -142,6 +142,13 @@
       <Field name="taskSchedulerEventHandler"/>
       <Field name="versionMismatch"/>
       <Field name="versionMismatchDiagnostics"/>
+      <Field name="containers"/>
+      <Field name="currentRecoveryDataDir"/>
+      <Field name="execService"/>
+      <Field name="historyEventHandler"/>
+      <Field name="nodes"/>
+      <Field name="recoveryEnabled"/>
+      <Field name="isLocal"/>
     </Or>
     <Bug pattern="IS2_INCONSISTENT_SYNC"/>
   </Match>

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index 0fadcfa..3805b6c 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -2000,7 +2000,7 @@ public class DAGAppMaster extends AbstractService {
       String maxAppAttemptsEnv = System.getenv(
           ApplicationConstants.MAX_APP_ATTEMPTS_ENV);
       if (maxAppAttemptsEnv != null) {
-        maxAppAttempts = Integer.valueOf(maxAppAttemptsEnv);
+        maxAppAttempts = Integer.parseInt(maxAppAttemptsEnv);
       }
 
       validateInputParam(appSubmitTimeStr,

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java b/tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java
index cc9033d..6de9c59 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/utils/Graph.java
@@ -230,9 +230,10 @@ public class Graph {
   }
 
   public void save(String filePath) throws IOException {
-    FileOutputStream fout = new FileOutputStream(filePath);
-    fout.write(generateGraphViz().getBytes("UTF-8"));
-    fout.close();
+    try (FileOutputStream fout = new FileOutputStream(filePath)){
+      fout.write(generateGraphViz().getBytes("UTF-8"));
+      fout.close();
+    }
   }
 
   public static List<Edge> combineEdges(List<Edge> edges) {

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-dag/src/main/java/org/apache/tez/dag/utils/Simple2LevelVersionComparator.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/utils/Simple2LevelVersionComparator.java
b/tez-dag/src/main/java/org/apache/tez/dag/utils/Simple2LevelVersionComparator.java
index ef0ad29..b54187c 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/utils/Simple2LevelVersionComparator.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/utils/Simple2LevelVersionComparator.java
@@ -53,7 +53,7 @@ public class Simple2LevelVersionComparator {
           continue;
         }
         try {
-          int i = Integer.valueOf(token);
+          int i = Integer.parseInt(token);
           if (index == 0) {
             majorVersion = i;
           } else if (index == 1) {

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-mapreduce/src/main/java/org/apache/hadoop/mapred/split/TezMapredSplitsGrouper.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/hadoop/mapred/split/TezMapredSplitsGrouper.java
b/tez-mapreduce/src/main/java/org/apache/hadoop/mapred/split/TezMapredSplitsGrouper.java
index 29b5e1e..2194551 100644
--- a/tez-mapreduce/src/main/java/org/apache/hadoop/mapred/split/TezMapredSplitsGrouper.java
+++ b/tez-mapreduce/src/main/java/org/apache/hadoop/mapred/split/TezMapredSplitsGrouper.java
@@ -33,7 +33,6 @@ import org.apache.hadoop.classification.InterfaceAudience.Public;
 import org.apache.hadoop.classification.InterfaceStability.Evolving;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapred.InputSplit;
-import org.apache.hadoop.mapred.split.SplitSizeEstimator;
 import org.apache.hadoop.mapreduce.split.TezMapReduceSplitsGrouper;
 import org.apache.hadoop.yarn.util.RackResolver;
 import org.apache.tez.dag.api.TezUncheckedException;
@@ -109,6 +108,7 @@ public class TezMapredSplitsGrouper {
       InputSplit[] originalSplits, int desiredNumSplits,
       String wrappedInputFormatName, SplitSizeEstimator estimator) throws IOException {
     LOG.info("Grouping splits in Tez");
+    Preconditions.checkArgument(originalSplits != null, "Splits must be specified");
 
     int configNumSplits = conf.getInt(TezMapReduceSplitsGrouper.TEZ_GROUPING_SPLIT_COUNT,
0);
     if (configNumSplits > 0) {
@@ -122,7 +122,6 @@ public class TezMapredSplitsGrouper {
     }
 
     if (! (configNumSplits > 0 || 
-          originalSplits == null || 
           originalSplits.length == 0) ) {
       // numSplits has not been overridden by config
       // numSplits has been set at runtime

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
b/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
index 88b9845..4be3931 100644
--- a/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
+++ b/tez-mapreduce/src/main/java/org/apache/hadoop/mapreduce/split/TezMapReduceSplitsGrouper.java
@@ -169,6 +169,7 @@ public class TezMapReduceSplitsGrouper {
       List<InputSplit> originalSplits, int desiredNumSplits,
       String wrappedInputFormatName, SplitSizeEstimator estimator) throws IOException, InterruptedException
{
     LOG.info("Grouping splits in Tez");
+    Preconditions.checkArgument(originalSplits != null, "Splits must be specified");
 
     int configNumSplits = conf.getInt(TEZ_GROUPING_SPLIT_COUNT, 0);
     if (configNumSplits > 0) {
@@ -182,7 +183,6 @@ public class TezMapReduceSplitsGrouper {
     }
 
     if (! (configNumSplits > 0 || 
-          originalSplits == null || 
           originalSplits.size() == 0)) {
       // numSplits has not been overridden by config
       // numSplits has been set at runtime

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/IDConverter.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/IDConverter.java
b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/IDConverter.java
index a528098..0f1b56d 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/IDConverter.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/IDConverter.java
@@ -60,7 +60,7 @@ public class IDConverter {
   public static TezDAGID fromMRJobId(
       org.apache.hadoop.mapreduce.JobID jobId) {
     return TezDAGID.getInstance(ApplicationId.newInstance(
-        Long.valueOf(jobId.getJtIdentifier()), jobId.getId()), 1);
+        Long.parseLong(jobId.getJtIdentifier()), jobId.getId()), 1);
   }
 
   // FIXME hack alert converting objects with hard coded id

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-runtime-library/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/tez-runtime-library/findbugs-exclude.xml b/tez-runtime-library/findbugs-exclude.xml
index 919e1e3..9866ba4 100644
--- a/tez-runtime-library/findbugs-exclude.xml
+++ b/tez-runtime-library/findbugs-exclude.xml
@@ -122,4 +122,10 @@
     <Bug pattern="NN_NAKED_NOTIFY"/>
   </Match>
 
+  <Match>
+    <Class name="org.apache.tez.runtime.library.common.shuffle.ShuffleUtils"/>
+    <Method name="getHttpConnectionParams" params="org.apache.hadoop.conf.Configuration"
return="org.apache.tez.http.HttpConnectionParams"/>
+    <Bug pattern="DC_PARTIALLY_CONSTRUCTED"/>
+  </Match>
+
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
index 1122bbe..91dcb6d 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/processor/SleepProcessor.java
@@ -120,7 +120,7 @@ public class SleepProcessor extends AbstractLogicalIOProcessor {
     }
 
     public void fromUserPayload(UserPayload userPayload) throws CharacterCodingException
{
-      timeToSleepMS = Integer.valueOf(charSet.newDecoder().decode(userPayload.getPayload()).toString()).intValue();
+      timeToSleepMS = Integer.parseInt(charSet.newDecoder().decode(userPayload.getPayload()).toString());
     }
 
     public int getTimeToSleepMS() {

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/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 96dff26..9dd9b59 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
@@ -114,7 +114,7 @@ public class BroadcastAndOneToOneExample extends Configured implements
Tool {
       if (doLocalityCheck) {
         ObjectRegistry objectRegistry = getContext().getObjectRegistry();
         String index = (String) objectRegistry.get(String.valueOf(getContext().getTaskIndex()));
-        if (index == null || Integer.valueOf(index).intValue() != getContext().getTaskIndex())
{
+        if (index == null || Integer.parseInt(index) != getContext().getTaskIndex()) {
           String msg = "Did not find expected local producer "
               + getContext().getTaskIndex() + " in the same JVM";
           System.out.println(msg);

http://git-wip-us.apache.org/repos/asf/tez/blob/b9056657/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
index 9342668..0a6d9a1 100644
--- a/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
+++ b/tez-tests/src/main/java/org/apache/tez/mapreduce/examples/MRRSleepJob.java
@@ -235,7 +235,7 @@ public class MRRSleepJob extends Configured implements Tool {
         }
         if (!found) {
           for (String taskId : taskIds) {
-            if (Integer.valueOf(taskId).intValue() ==
+            if (Integer.parseInt(taskId) ==
                 taId.getTaskID().getId()) {
               found = true;
               break;


Mime
View raw message