ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [21/27] ignite git commit: Inlined "isEmpty(String)" method.
Date Fri, 01 Jul 2016 12:11:04 GMT
Inlined "isEmpty(String)" method.


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

Branch: refs/heads/ignite-3185
Commit: 75601f86ae6486e231b95271bf9f8fb5daea9ac2
Parents: 97361b3
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Jun 28 13:15:37 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Jun 28 13:15:37 2016 +0300

----------------------------------------------------------------------
 .../processors/hadoop/HadoopClasspathUtils.java     | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/75601f86/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
index 632953f..c83231e 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClasspathUtils.java
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.internal.processors.hadoop;
 
-import org.apache.ignite.internal.util.typedef.F;
-
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
@@ -111,7 +109,7 @@ public class HadoopClasspathUtils {
         String mapredHome = systemOrEnv(MAPRED_HOME, EMPTY_STR);
 
         // If any composite location is defined, use only them.
-        if (!F.isEmpty(commonHome) || !F.isEmpty(hdfsHome) || !F.isEmpty(mapredHome)) {
+        if (!isEmpty(commonHome) || !isEmpty(hdfsHome) || !isEmpty(mapredHome)) {
             HadoopLocations res = new HadoopLocations(hadoopHome, commonHome, hdfsHome, mapredHome);
 
             if (res.valid())
@@ -123,7 +121,7 @@ public class HadoopClasspathUtils {
                     "[env=" + HDFS_HOME + ", value=" + hdfsHome + ", exists=" + res.hdfsExists()
+ "], " +
                     "[env=" + MAPRED_HOME + ", value=" + mapredHome + ", exists=" + res.mapredExists()
+ "]]");
         }
-        else if (!F.isEmpty(hadoopHome)) {
+        else if (!isEmpty(hadoopHome)) {
             // All further checks will be based on HADOOP_HOME, so check for it's existence.
             if (!exists(hadoopHome))
                 throw new IOException("Failed to resolve Hadoop classpath because " + HOME
+ " environment " +
@@ -225,6 +223,16 @@ public class HadoopClasspathUtils {
     }
 
     /**
+     * Check if string is empty.
+     *
+     * @param val Value.
+     * @return {@code True} if empty.
+     */
+    private static boolean isEmpty(String val) {
+        return val == null || val.isEmpty();
+    }
+
+    /**
      * Simple pair-like structure to hold directory name and a mask assigned to it.
      */
     private static class SearchDirectory {


Mime
View raw message