ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject incubator-ignite git commit: # IGNITE-494: Review.
Date Fri, 27 Mar 2015 13:44:18 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-494b 4329e3918 -> 1e8e9318f


# IGNITE-494: Review.


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

Branch: refs/heads/ignite-494b
Commit: 1e8e9318fb219ec9f5cd75aec18553d85d17798c
Parents: 4329e39
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Mar 27 16:44:22 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Mar 27 16:44:22 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/hadoop/HadoopClassLoader.java | 4 +++-
 .../ignite/internal/processors/hadoop/v2/HadoopDaemon.java   | 8 +++++++-
 .../ignite/internal/processors/hadoop/v2/HadoopV2Job.java    | 6 ++++++
 3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e8e9318/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
index cc011ae..75d10ef 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
@@ -63,6 +63,7 @@ public class HadoopClassLoader extends URLClassLoader {
     private static final Map<String, byte[]> bytesCache = new ConcurrentHashMap8<>();
 
     /** Diagnostic name of this class loader. */
+    @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
     private final String name;
 
     /**
@@ -467,7 +468,8 @@ public class HadoopClassLoader extends URLClassLoader {
      */
     private static void addUrls(Collection<URL> res, File dir, final String startsWith)
throws Exception {
         File[] files = dir.listFiles(new FilenameFilter() {
-            @Override public boolean accept(File dir, String name) {
+            @Override
+            public boolean accept(File dir, String name) {
                 return startsWith == null || name.startsWith(startsWith);
             }
         });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e8e9318/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopDaemon.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopDaemon.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopDaemon.java
index b7b7af4..67de076 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopDaemon.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopDaemon.java
@@ -27,10 +27,12 @@ import java.util.concurrent.*;
  * that do not die automatically in Hadoop.
  *
  * A thread that has called {@link Thread#setDaemon(boolean) } with true. */
+@SuppressWarnings("UnusedDeclaration")
 public class HadoopDaemon extends Thread {
     /** Lock object used for synchronization. */
     private static final Object lock = new Object();
 
+    // TODO: To non-concurrent collection.
     /** Queue to hold the threads to be stopped. */
     private static Queue<HadoopDaemon> daemonQueue = new ConcurrentLinkedQueue<>();
 
@@ -61,6 +63,7 @@ public class HadoopDaemon extends Thread {
         enqueueIfNeeded();
     }
 
+    // TODO: JavaDoc styling.
     /** Construct a daemon thread to be part of a specified thread group. */
     public HadoopDaemon(ThreadGroup group, Runnable runnable) {
         super(group, runnable);
@@ -74,6 +77,7 @@ public class HadoopDaemon extends Thread {
 
     /**
      * Getter for the runnable. May return this.
+     *
      * @return the runnable
      */
     public Runnable getRunnable() {
@@ -82,6 +86,7 @@ public class HadoopDaemon extends Thread {
 
     /**
      * if the runnable is a Hadoop org.apache.hadoop.hdfs.PeerCache Runnable.
+     *
      * @param r the runnable.
      * @return true if it is.
      */
@@ -92,7 +97,8 @@ public class HadoopDaemon extends Thread {
     }
 
     /**
-     * Checks top see if the Runnable loaded with the same classloader that this class.
+     * Checks to see if the Runnable loaded with the same classloader that this class.
+     *
      * @param x the runnable.
      * @return true if it is.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e8e9318/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
index 8a61c6a..ed17be4 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
@@ -267,6 +267,7 @@ public class HadoopV2Job implements HadoopJob {
 
             // Stop the daemon threads that have been created
             // with the task class loaders:
+            // TODO: Move to finally.
             while (true) {
                 Class<?> c = fullCtxClsQueue.poll();
 
@@ -279,6 +280,7 @@ public class HadoopV2Job implements HadoopJob {
         finally {
             taskCtxClsPool.clear();
 
+            // TODO: Assert instead of clear.
             fullCtxClsQueue.clear();
         }
     }
@@ -300,16 +302,20 @@ public class HadoopV2Job implements HadoopJob {
             U.delete(locDir);
     }
 
+    // TODO: JavaDoc format.
     /** Clear the daemon threads that belong to the classloader of the given class. */
     private void clearDaemons(Class<?> clazz) throws IgniteCheckedException {
         try {
             Class<?> c = clazz.getClassLoader().loadClass(HadoopClassLoader.HADOOP_DAEMON_CLASS_NAME);
+
             // Of coarse, org.apache.hadoop.util.Daemon does not have method dequeueAndStopAll,
             // but we replaced this class with another class HadoopDaemon, which does:
             Method m = c.getMethod("dequeueAndStopAll");
+
             m.invoke(null);
         }
         catch (Throwable t) {
+            // TODO: Do not fail other.
             throw U.cast(t);
         }
     }


Mime
View raw message