falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject falcon git commit: FALCON-1733 Support for building falcon with JDK 1.8 also. Contributed by Narayan Periwal.
Date Tue, 19 Jan 2016 12:43:19 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 5869c0627 -> 0084c355c


FALCON-1733 Support for building falcon with JDK 1.8 also. Contributed by Narayan Periwal.


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

Branch: refs/heads/master
Commit: 0084c355cbfe234dc00253af2913e134a6b7814e
Parents: 5869c06
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Tue Jan 19 17:38:24 2016 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Tue Jan 19 18:12:53 2016 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +
 .../main/resources/falcon/findbugs-exclude.xml  |  4 ++
 .../org/apache/falcon/entity/v0/Frequency.java  |  2 +-
 .../apache/falcon/recipe/RecipeToolOptions.java |  8 +++-
 .../recipe/util/RecipeProcessBuilderUtils.java  |  2 +-
 .../org/apache/falcon/entity/FeedHelper.java    |  2 +-
 .../AuthenticationInitializationService.java    |  2 +-
 .../org/apache/falcon/util/HdfsClassLoader.java |  6 ++-
 docs/src/site/twiki/InstallationSteps.twiki     |  4 +-
 .../falcon/aspect/AbstractFalconAspect.java     |  2 +-
 .../org/apache/falcon/logging/JobLogMover.java  |  2 +-
 .../service/SharedLibraryHostingService.java    | 42 +++++++++++---------
 .../workflow/engine/OozieWorkflowEngine.java    | 10 ++---
 .../apache/oozie/client/ProxyOozieClient.java   |  4 +-
 pom.xml                                         |  2 +-
 .../java/org/apache/falcon/FalconServer.java    |  4 +-
 .../falcon/resource/AbstractEntityManager.java  |  3 --
 .../service/FeedSLAMonitoringService.java       |  8 ++--
 .../falcon/replication/FeedReplicator.java      |  4 +-
 .../falcon/workflow/engine/OozieDAGEngine.java  |  2 +-
 .../falcon/listener/HadoopStartupListener.java  | 11 +++--
 .../org/apache/falcon/util/OozieTestUtils.java  |  7 +++-
 22 files changed, 77 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d3834e1..43c7b81 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -59,6 +59,8 @@ Proposed Release Version: 0.9
     FALCON-1213 Base framework of the native scheduler(Pallavi Rao)
 
   IMPROVEMENTS
+    FALCON-1733 Support for building falcon with JDK 1.8 also(Narayan Periwal via Ajay Yadava)
+
     FALCON-1662 Ensure entity can be scheduled on multiple clusters on same colo (Pallavi
Rao)
 
     FALCON-1545 Add documentation for Hive replication job counters(Peeyush Bishnoi via Ajay
Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/checkstyle/src/main/resources/falcon/findbugs-exclude.xml b/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
index e1a5a2e..78f2fd0 100644
--- a/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
+++ b/checkstyle/src/main/resources/falcon/findbugs-exclude.xml
@@ -46,4 +46,8 @@
         <Class name="org.apache.falcon.state.store.jdbc.InstanceBean" />
         <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
     </Match>
+
+    <Match>
+        <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
+    </Match>
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/client/src/main/java/org/apache/falcon/entity/v0/Frequency.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/entity/v0/Frequency.java b/client/src/main/java/org/apache/falcon/entity/v0/Frequency.java
index a9e4b90..f423df6 100644
--- a/client/src/main/java/org/apache/falcon/entity/v0/Frequency.java
+++ b/client/src/main/java/org/apache/falcon/entity/v0/Frequency.java
@@ -85,7 +85,7 @@ public class Frequency {
     }
 
     public int getFrequencyAsInt() {
-        return Integer.valueOf(frequency);
+        return Integer.parseInt(frequency);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/client/src/main/java/org/apache/falcon/recipe/RecipeToolOptions.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/recipe/RecipeToolOptions.java b/client/src/main/java/org/apache/falcon/recipe/RecipeToolOptions.java
index cebf968..2a7a7a0 100644
--- a/client/src/main/java/org/apache/falcon/recipe/RecipeToolOptions.java
+++ b/client/src/main/java/org/apache/falcon/recipe/RecipeToolOptions.java
@@ -51,13 +51,17 @@ public enum RecipeToolOptions {
     private final String description;
     private final boolean isRequired;
 
-    public static final Map<String, RecipeToolOptions> OPTIONSMAP = new HashMap<>();
+    private static Map<String, RecipeToolOptions> optionsMap = new HashMap<>();
     static {
         for (RecipeToolOptions c : RecipeToolOptions.values()) {
-            OPTIONSMAP.put(c.getName(), c);
+            optionsMap.put(c.getName(), c);
         }
     }
 
+    public static Map<String, RecipeToolOptions> getOptionsMap() {
+        return optionsMap;
+    }
+
     RecipeToolOptions(String name, String description) {
         this(name, description, true);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/client/src/main/java/org/apache/falcon/recipe/util/RecipeProcessBuilderUtils.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/recipe/util/RecipeProcessBuilderUtils.java
b/client/src/main/java/org/apache/falcon/recipe/util/RecipeProcessBuilderUtils.java
index 7caacb5..550ca1b 100644
--- a/client/src/main/java/org/apache/falcon/recipe/util/RecipeProcessBuilderUtils.java
+++ b/client/src/main/java/org/apache/falcon/recipe/util/RecipeProcessBuilderUtils.java
@@ -232,7 +232,7 @@ public final class RecipeProcessBuilderUtils {
         List<Property> propertyList = new ArrayList<>();
 
         for (Map.Entry<Object, Object> recipeProperty : recipeProperties.entrySet())
{
-            if (RecipeToolOptions.OPTIONSMAP.get(recipeProperty.getKey().toString()) == null)
{
+            if (RecipeToolOptions.getOptionsMap().get(recipeProperty.getKey().toString())
== null) {
                 addProperty(propertyList, (String) recipeProperty.getKey(), (String) recipeProperty.getValue());
             }
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
index 575ceb3..8aa97ec 100644
--- a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
+++ b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
@@ -454,7 +454,7 @@ public final class FeedHelper {
 
             int value;
             try {
-                value = Integer.valueOf(path.substring(pad.length(), pad.length() + pathVar.getValueSize()));
+                value = Integer.parseInt(path.substring(pad.length(), pad.length() + pathVar.getValueSize()));
             } catch (NumberFormatException e) {
                 //Not a valid number for variable
                 return null;

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/common/src/main/java/org/apache/falcon/security/AuthenticationInitializationService.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/security/AuthenticationInitializationService.java
b/common/src/main/java/org/apache/falcon/security/AuthenticationInitializationService.java
index cf27408..f7b2155 100644
--- a/common/src/main/java/org/apache/falcon/security/AuthenticationInitializationService.java
+++ b/common/src/main/java/org/apache/falcon/security/AuthenticationInitializationService.java
@@ -84,7 +84,7 @@ public class AuthenticationInitializationService implements FalconService
{
             long validateFrequency;
             try {
                 validateFrequency = (StringUtils.isNotEmpty(authTokenValidity))
-                        ? Long.valueOf(authTokenValidity) : 86400;
+                        ? Long.parseLong(authTokenValidity) : 86400;
             } catch (NumberFormatException nfe) {
                 throw new FalconException("Invalid value provided for startup property \""
                         + AUTH_TOKEN_VALIDITY_SECONDS + "\", please provide a valid long
number", nfe);

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/common/src/main/java/org/apache/falcon/util/HdfsClassLoader.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/HdfsClassLoader.java b/common/src/main/java/org/apache/falcon/util/HdfsClassLoader.java
index 3f9091f..786ffea 100644
--- a/common/src/main/java/org/apache/falcon/util/HdfsClassLoader.java
+++ b/common/src/main/java/org/apache/falcon/util/HdfsClassLoader.java
@@ -144,8 +144,10 @@ public class HdfsClassLoader extends URLClassLoader {
                 }
             });
 
-            for (File jarFile : jarFiles) {
-                urls.add(jarFile.toURI().toURL());
+            if (jarFiles != null) {
+                for (File jarFile : jarFiles) {
+                    urls.add(jarFile.toURI().toURL());
+                }
             }
 
             if (!fileURL.toString().endsWith("/")) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/docs/src/site/twiki/InstallationSteps.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/InstallationSteps.twiki b/docs/src/site/twiki/InstallationSteps.twiki
index e8c76f7..a5ee2cc 100644
--- a/docs/src/site/twiki/InstallationSteps.twiki
+++ b/docs/src/site/twiki/InstallationSteps.twiki
@@ -5,7 +5,7 @@
 
 ---+++Prerequisites
 
-   * JDK 1.7
+   * JDK 1.7/1.8
    * Maven 3.2.x
 
 
@@ -30,7 +30,7 @@ It builds and installs the package into the local repository, for use as
a depen
 *NOTE:* Falcon drops support for Hadoop-1 and only supports Hadoop-2 from Falcon 0.6 onwards
 [optionally -Doozie.version=<<oozie version>> can be appended to build with a
specific version of Oozie. Oozie versions
 >= 4 are supported]
-NOTE: Falcon builds with JDK 1.7 using -noverify option
+NOTE: Falcon builds with JDK 1.7/1.8 using -noverify option
       To compile Falcon with Hive Replication, optionally "-P hadoop-2,hivedr" can be appended.
For this Hive >= 1.2.0
       and Oozie >= 4.2.0 should be available.
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/metrics/src/main/java/org/apache/falcon/aspect/AbstractFalconAspect.java
----------------------------------------------------------------------
diff --git a/metrics/src/main/java/org/apache/falcon/aspect/AbstractFalconAspect.java b/metrics/src/main/java/org/apache/falcon/aspect/AbstractFalconAspect.java
index b24292c..6919c9d 100644
--- a/metrics/src/main/java/org/apache/falcon/aspect/AbstractFalconAspect.java
+++ b/metrics/src/main/java/org/apache/falcon/aspect/AbstractFalconAspect.java
@@ -84,7 +84,7 @@ public abstract class AbstractFalconAspect {
 
         Integer timeTakenArg = ResourcesReflectionUtil.getResourceTimeTakenName(methodName);
         return timeTakenArg == null ? new ResourceMessage(action, dimensions, status, executionTime)
-            : new ResourceMessage(action, dimensions, status, Long.valueOf(args[timeTakenArg].toString()));
+            : new ResourceMessage(action, dimensions, status, Long.parseLong(args[timeTakenArg].toString()));
     }
 
     public abstract void publishMessage(ResourceMessage message);

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/oozie/src/main/java/org/apache/falcon/logging/JobLogMover.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/logging/JobLogMover.java b/oozie/src/main/java/org/apache/falcon/logging/JobLogMover.java
index 830641e..64596c6 100644
--- a/oozie/src/main/java/org/apache/falcon/logging/JobLogMover.java
+++ b/oozie/src/main/java/org/apache/falcon/logging/JobLogMover.java
@@ -55,7 +55,7 @@ public class JobLogMover {
     private static final String YARN = "yarn";
     private static final String MAPREDUCE_FRAMEWORK = "mapreduce.framework.name";
 
-    public static final Set<String> FALCON_ACTIONS =
+    private static final Set<String> FALCON_ACTIONS =
         new HashSet<String>(Arrays.asList(new String[]{"eviction", "replication", }));
 
     private Configuration getConf() {

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/oozie/src/main/java/org/apache/falcon/service/SharedLibraryHostingService.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/service/SharedLibraryHostingService.java
b/oozie/src/main/java/org/apache/falcon/service/SharedLibraryHostingService.java
index 49fb4f7..c15d6b9 100644
--- a/oozie/src/main/java/org/apache/falcon/service/SharedLibraryHostingService.java
+++ b/oozie/src/main/java/org/apache/falcon/service/SharedLibraryHostingService.java
@@ -120,31 +120,35 @@ public class SharedLibraryHostingService implements ConfigurationChangeListener
         for(String srcPaths : src.split(",")) {
             File srcFile = new File(srcPaths);
             File[] srcFiles = new File[] { srcFile };
-            if (srcFile.isDirectory()) {
-                srcFiles = srcFile.listFiles();
+            if (srcFiles != null) {
+                if (srcFile.isDirectory()) {
+                    srcFiles = srcFile.listFiles();
+                }
             }
 
-            for (File file : srcFiles) {
-                Path path = new Path(file.getAbsolutePath());
-                String jarName = StringUtils.removeEnd(path.getName(), ".jar");
-                if (pathFilter != null) {
-                    if (!pathFilter.accept(path)) {
-                        continue;
+            if (srcFiles != null) {
+                for (File file : srcFiles) {
+                    Path path = new Path(file.getAbsolutePath());
+                    String jarName = StringUtils.removeEnd(path.getName(), ".jar");
+                    if (pathFilter != null) {
+                        if (!pathFilter.accept(path)) {
+                            continue;
+                        }
+                        jarName = pathFilter.getJarName(path);
                     }
-                    jarName = pathFilter.getJarName(path);
-                }
 
-                Path targetFile = new Path(target, jarName + ".jar");
-                if (fs.exists(targetFile)) {
-                    FileStatus fstat = fs.getFileStatus(targetFile);
-                    if (fstat.getLen() == file.length()) {
-                        continue;
+                    Path targetFile = new Path(target, jarName + ".jar");
+                    if (fs.exists(targetFile)) {
+                        FileStatus fstat = fs.getFileStatus(targetFile);
+                        if (fstat.getLen() == file.length()) {
+                            continue;
+                        }
                     }
+                    fs.copyFromLocalFile(false, true, new Path(file.getAbsolutePath()), targetFile);
+                    fs.setPermission(targetFile, HadoopClientFactory.READ_EXECUTE_PERMISSION);
+                    LOG.info("Copied {} to {} in {}",
+                            file.getAbsolutePath(), targetFile.toString(), fs.getUri());
                 }
-                fs.copyFromLocalFile(false, true, new Path(file.getAbsolutePath()), targetFile);
-                fs.setPermission(targetFile, HadoopClientFactory.READ_EXECUTE_PERMISSION);
-                LOG.info("Copied {} to {} in {}",
-                        file.getAbsolutePath(), targetFile.toString(), fs.getUri());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
b/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
index f4bb406..72c029c 100644
--- a/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
+++ b/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
@@ -97,7 +97,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
                 WorkflowJob.Status.FAILED);
     private static final List<WorkflowJob.Status> WF_SUSPEND_PRECOND = Arrays.asList(WorkflowJob.Status.RUNNING);
     private static final List<WorkflowJob.Status> WF_RESUME_PRECOND = Arrays.asList(WorkflowJob.Status.SUSPENDED);
-    public static final List<WorkflowJob.Status> WF_RERUN_PRECOND =
+    private static final List<WorkflowJob.Status> WF_RERUN_PRECOND =
         Arrays.asList(WorkflowJob.Status.FAILED, WorkflowJob.Status.KILLED, WorkflowJob.Status.SUCCEEDED);
     private static final List<CoordinatorAction.Status> COORD_RERUN_PRECOND =
         Arrays.asList(CoordinatorAction.Status.TIMEDOUT, CoordinatorAction.Status.FAILED);
@@ -1045,7 +1045,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
                 getApplicableCoords(client, start, end, bundles, lifeCycles);
             List<CoordinatorAction> actions = new ArrayList<CoordinatorAction>();
             int maxRetentionInstancesCount =
-                Integer.valueOf(RuntimeProperties.get().getProperty("retention.instances.displaycount",
"2"));
+                Integer.parseInt(RuntimeProperties.get().getProperty("retention.instances.displaycount",
"2"));
             int retentionInstancesCount = 0;
 
             for (CoordinatorJob coord : applicableCoords) {
@@ -1061,7 +1061,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
                 Date iterEnd = ((nextMaterializedTime.before(end) || retentionCoord) ? nextMaterializedTime
: end);
                 Calendar endCal = Calendar.getInstance(EntityUtil.getTimeZone(coord.getTimeZone()));
                 endCal.setTime(EntityUtil.getNextStartTime(coord.getStartTime(), freq, tz,
iterEnd));
-                endCal.add(freq.getTimeUnit().getCalendarUnit(), -(Integer.valueOf((coord.getFrequency()))));
+                endCal.add(freq.getTimeUnit().getCalendarUnit(), -(Integer.parseInt((coord.getFrequency()))));
 
                 while (start.compareTo(endCal.getTime()) <= 0) {
                     if (retentionCoord) {
@@ -1074,7 +1074,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
                     int sequence = EntityUtil.getInstanceSequence(coord.getStartTime(), freq,
tz, endCal.getTime());
                     String actionId = coord.getId() + "@" + sequence;
                     addCoordAction(client, actions, actionId);
-                    endCal.add(freq.getTimeUnit().getCalendarUnit(), -(Integer.valueOf((coord.getFrequency()))));
+                    endCal.add(freq.getTimeUnit().getCalendarUnit(), -(Integer.parseInt((coord.getFrequency()))));
                 }
             }
             actionsMap.put(cluster, actions);
@@ -1507,7 +1507,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
         int retryCount;
         String retry = RuntimeProperties.get().getProperty(WORKFLOW_STATUS_RETRY_COUNT, "30");
         try {
-            retryCount = Integer.valueOf(retry);
+            retryCount = Integer.parseInt(retry);
         } catch (NumberFormatException nfe) {
             throw new FalconException("Invalid value provided for runtime property \""
                     + WORKFLOW_STATUS_RETRY_COUNT + "\". Please provide an integer value.");

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/oozie/src/main/java/org/apache/oozie/client/ProxyOozieClient.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/oozie/client/ProxyOozieClient.java b/oozie/src/main/java/org/apache/oozie/client/ProxyOozieClient.java
index fcd8ca7..eaf3ede 100644
--- a/oozie/src/main/java/org/apache/oozie/client/ProxyOozieClient.java
+++ b/oozie/src/main/java/org/apache/oozie/client/ProxyOozieClient.java
@@ -80,11 +80,11 @@ public class ProxyOozieClient extends AuthOozieClient {
                 public HttpURLConnection run() throws Exception {
                     HttpURLConnection conn = ProxyOozieClient.super.createConnection(decoratedUrl,
method);
 
-                    int connectTimeout = Integer.valueOf(
+                    int connectTimeout = Integer.parseInt(
                             RuntimeProperties.get().getProperty("oozie.connect.timeout",
"1000"));
                     conn.setConnectTimeout(connectTimeout);
 
-                    int readTimeout = Integer.valueOf(
+                    int readTimeout = Integer.parseInt(
                             RuntimeProperties.get().getProperty("oozie.read.timeout", "45000"));
                     conn.setReadTimeout(readTimeout);
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 39ee9ac..a80822f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1228,7 +1228,7 @@
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>findbugs-maven-plugin</artifactId>
-                    <version>2.5.2</version>
+                    <version>3.0.3</version>
                 </plugin>
                 <!-- Source code metrics: mvn javancss:report or mvn site -->
                 <plugin>

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/prism/src/main/java/org/apache/falcon/FalconServer.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/FalconServer.java b/prism/src/main/java/org/apache/falcon/FalconServer.java
index d50ebe5..ea341b3 100644
--- a/prism/src/main/java/org/apache/falcon/FalconServer.java
+++ b/prism/src/main/java/org/apache/falcon/FalconServer.java
@@ -105,7 +105,7 @@ public final class FalconServer {
     private static int getApplicationPort(CommandLine cmd, String enableTLSFlag) {
         final int appPort;
         if (cmd.hasOption(APP_PORT)) {
-            appPort = Integer.valueOf(cmd.getOptionValue(APP_PORT));
+            appPort = Integer.parseInt(cmd.getOptionValue(APP_PORT));
         } else {
             // default : falcon.enableTLS is true
             appPort = StringUtils.isEmpty(enableTLSFlag)
@@ -125,7 +125,7 @@ public final class FalconServer {
         boolean startActiveMq = Boolean.valueOf(System.getProperty("falcon.embeddedmq", "true"));
         if (startActiveMq) {
             String dataDir = System.getProperty("falcon.embeddedmq.data", "target/");
-            int mqport = Integer.valueOf(System.getProperty("falcon.embeddedmq.port", "61616"));
+            int mqport = Integer.parseInt(System.getProperty("falcon.embeddedmq.port", "61616"));
             LOG.info("Starting ActiveMQ at port {} with data dir {}", mqport, dataDir);
 
             broker = new BrokerService();

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
index c32123d..3ebe612 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
@@ -339,9 +339,6 @@ public abstract class AbstractEntityManager {
 
     private void obtainEntityLocks(Entity entity, String command, List<Entity> tokenList)
         throws FalconException {
-        if (tokenList == null) {
-            tokenList = new ArrayList<>();
-        }
         //first obtain lock for the entity for which update is issued.
         if (memoryLocks.acquireLock(entity, command)) {
             tokenList.add(entity);

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/prism/src/main/java/org/apache/falcon/service/FeedSLAMonitoringService.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/service/FeedSLAMonitoringService.java b/prism/src/main/java/org/apache/falcon/service/FeedSLAMonitoringService.java
index 8ffecd8..b720c77 100644
--- a/prism/src/main/java/org/apache/falcon/service/FeedSLAMonitoringService.java
+++ b/prism/src/main/java/org/apache/falcon/service/FeedSLAMonitoringService.java
@@ -236,16 +236,16 @@ public final class FeedSLAMonitoringService implements ConfigurationChangeListen
         fileSystem = initializeFileSystem();
 
         String freq = StartupProperties.get().getProperty("feed.sla.serialization.frequency.millis",
ONE_HOUR);
-        serializationFrequencyMillis = Integer.valueOf(freq);
+        serializationFrequencyMillis = Integer.parseInt(freq);
 
         freq = StartupProperties.get().getProperty("feed.sla.statusCheck.frequency.seconds",
"600");
-        statusCheckFrequencySeconds = Integer.valueOf(freq);
+        statusCheckFrequencySeconds = Integer.parseInt(freq);
 
         freq = StartupProperties.get().getProperty("feed.sla.lookAheadWindow.millis", "900000");
-        lookAheadWindowMillis = Integer.valueOf(freq);
+        lookAheadWindowMillis = Integer.parseInt(freq);
 
         String size = StartupProperties.get().getProperty("feed.sla.queue.size", "288");
-        queueSize = Integer.valueOf(size);
+        queueSize = Integer.parseInt(size);
 
         try {
             if (fileSystem.exists(filePath)) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
----------------------------------------------------------------------
diff --git a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
index e97e84e..bbf7321 100644
--- a/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
+++ b/replication/src/main/java/org/apache/falcon/replication/FeedReplicator.java
@@ -191,8 +191,8 @@ public class FeedReplicator extends Configured implements Tool {
 
         DistCpOptions distcpOptions = new DistCpOptions(srcPaths, new Path(trgPath));
         distcpOptions.setBlocking(true);
-        distcpOptions.setMaxMaps(Integer.valueOf(cmd.getOptionValue("maxMaps")));
-        distcpOptions.setMapBandwidth(Integer.valueOf(cmd.getOptionValue("mapBandwidth")));
+        distcpOptions.setMaxMaps(Integer.parseInt(cmd.getOptionValue("maxMaps")));
+        distcpOptions.setMapBandwidth(Integer.parseInt(cmd.getOptionValue("mapBandwidth")));
 
         String overwrite = cmd.getOptionValue(ReplicationDistCpOption.DISTCP_OPTION_OVERWRITE.getName());
         if (StringUtils.isNotEmpty(overwrite) && overwrite.equalsIgnoreCase(Boolean.TRUE.toString()))
{

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
----------------------------------------------------------------------
diff --git a/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
b/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
index 4266118..b5a3500 100644
--- a/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
+++ b/scheduler/src/main/java/org/apache/falcon/workflow/engine/OozieDAGEngine.java
@@ -431,7 +431,7 @@ public class OozieDAGEngine implements DAGEngine {
         int retryCount;
         String retry = RuntimeProperties.get().getProperty(WORKFLOW_STATUS_RETRY_COUNT, "30");
         try {
-            retryCount = Integer.valueOf(retry);
+            retryCount = Integer.parseInt(retry);
         } catch (NumberFormatException nfe) {
             throw new DAGEngineException("Invalid value provided for runtime property \""
                     + WORKFLOW_STATUS_RETRY_COUNT + "\". Please provide an integer value.");

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/test-tools/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
----------------------------------------------------------------------
diff --git a/test-tools/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
b/test-tools/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
index 7bee592..e2cc816 100644
--- a/test-tools/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
+++ b/test-tools/hadoop-webapp/src/main/java/org/apache/falcon/listener/HadoopStartupListener.java
@@ -127,9 +127,14 @@ public class HadoopStartupListener implements ServletContextListener
{
         StringBuilder libActionDirectories = new StringBuilder();
         File f = new File(shareLibPath);
 
-        for(File libDir : f.listFiles()) {
-            if (libDir.isDirectory()) {
-                libActionDirectories.append(libDir.getName()).append("\t");
+        if (f != null) {
+            File[] files = f.listFiles();
+            if (files != null) {
+                for (File libDir : files) {
+                    if (libDir != null && libDir.isDirectory()) {
+                        libActionDirectories.append(libDir.getName()).append("\t");
+                    }
+                }
             }
         }
         String actionDirectories = libActionDirectories.toString();

http://git-wip-us.apache.org/repos/asf/falcon/blob/0084c355/webapp/src/test/java/org/apache/falcon/util/OozieTestUtils.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/util/OozieTestUtils.java b/webapp/src/test/java/org/apache/falcon/util/OozieTestUtils.java
index 056c0a1..63e67b8 100644
--- a/webapp/src/test/java/org/apache/falcon/util/OozieTestUtils.java
+++ b/webapp/src/test/java/org/apache/falcon/util/OozieTestUtils.java
@@ -27,7 +27,6 @@ import org.apache.falcon.resource.TestContext;
 import org.apache.falcon.resource.UnitTestContext;
 import org.apache.falcon.workflow.WorkflowExecutionContext;
 import org.apache.falcon.workflow.engine.OozieClientFactory;
-import org.apache.falcon.workflow.engine.OozieWorkflowEngine;
 import org.apache.hadoop.fs.Path;
 import org.apache.oozie.client.BundleJob;
 import org.apache.oozie.client.CoordinatorJob;
@@ -48,6 +47,10 @@ import java.util.Set;
  */
 public final class OozieTestUtils {
 
+    // todo refactor to reuse it from OozieWorkflowEngine
+    private static final List<WorkflowJob.Status> WF_RERUN_PRECOND =
+            Arrays.asList(WorkflowJob.Status.FAILED, WorkflowJob.Status.KILLED, WorkflowJob.Status.SUCCEEDED);
+
     private OozieTestUtils() {
     }
 
@@ -109,7 +112,7 @@ public final class OozieTestUtils {
         for (int i = 0; i < 50; i++) {
             WorkflowJob job = ozClient.getJobInfo(jobId);
             lastStatus = job.getStatus().name();
-            if (OozieWorkflowEngine.WF_RERUN_PRECOND.contains(job.getStatus())) {
+            if (WF_RERUN_PRECOND.contains(job.getStatus())) {
                 return;
             }
             System.out.println("Waiting for workflow to start");


Mime
View raw message