ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [50/50] [abbrv] incubator-ignite git commit: # IGNITE-625: Finalization.
Date Fri, 10 Apr 2015 08:00:22 GMT
# IGNITE-625: Finalization.


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

Branch: refs/heads/ignite-625-1
Commit: 929195c8c7d43f4e2115a443f2e51e24ced88a77
Parents: e91b2e8
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Apr 10 10:59:33 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Apr 10 10:59:33 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsAsyncImpl.java |  4 +-
 .../ignite/internal/processors/igfs/IgfsEx.java |  4 +-
 .../internal/processors/igfs/IgfsImpl.java      | 65 ++++++++++----------
 .../internal/processors/igfs/IgfsProcessor.java |  2 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |  2 +-
 5 files changed, 39 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/929195c8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAsyncImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAsyncImpl.java
index 48a32f4..8099985 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAsyncImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAsyncImpl.java
@@ -102,8 +102,8 @@ public class IgfsAsyncImpl extends AsyncSupportAdapter<IgniteFileSystem>
impleme
     }
 
     /** {@inheritDoc} */
-    @Override public void stop() {
-        igfs.stop();
+    @Override public void stop(boolean cancel) {
+        igfs.stop(cancel);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/929195c8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
index 99f647e..7c1a837 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsEx.java
@@ -53,8 +53,10 @@ public interface IgfsEx extends IgniteFileSystem {
 
     /**
      * Stops IGFS cleaning all used resources.
+     *
+     * @param cancel Cancellation flag.
      */
-    public void stop();
+    public void stop(boolean cancel);
 
     /**
      * @return IGFS context.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/929195c8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 6eefde5..455327b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -234,7 +234,7 @@ public final class IgfsImpl implements IgfsEx {
     }
 
     /** {@inheritDoc} */
-    @Override public void stop() {
+    @Override public void stop(boolean cancel) {
         busyLock.block();
 
         // Clear interrupted flag temporarily.
@@ -484,8 +484,7 @@ public final class IgfsImpl implements IgfsEx {
         A.notNull(path, "path");
 
         return safeOp(new Callable<IgfsFile>() {
-            @Override
-            public IgfsFile call() throws Exception {
+            @Override public IgfsFile call() throws Exception {
                 if (log.isDebugEnabled())
                     log.debug("Get file info: " + path);
 
@@ -902,7 +901,8 @@ public final class IgfsImpl implements IgfsEx {
         A.notNull(path, "path");
 
         return safeOp(new Callable<Collection<IgfsFile>>() {
-            @Override public Collection<IgfsFile> call() throws Exception {
+            @Override
+            public Collection<IgfsFile> call() throws Exception {
                 if (log.isDebugEnabled())
                     log.debug("List directory details: " + path);
 
@@ -944,8 +944,7 @@ public final class IgfsImpl implements IgfsEx {
                             files.add(new IgfsFileImpl(p, e.getValue(), data.groupBlockSize()));
                         }
                     }
-                }
-                else if (mode == PRIMARY) {
+                } else if (mode == PRIMARY) {
                     checkConflictWithPrimary(path);
 
                     throw new IgfsPathNotFoundException("Failed to list files (path not found):
" + path);
@@ -1326,8 +1325,7 @@ public final class IgfsImpl implements IgfsEx {
     /** {@inheritDoc} */
     @Override public IgfsMetrics metrics() {
         return safeOp(new Callable<IgfsMetrics>() {
-            @Override
-            public IgfsMetrics call() throws Exception {
+            @Override public IgfsMetrics call() throws Exception {
                 IgfsPathSummary sum = new IgfsPathSummary();
 
                 summary0(ROOT_ID, sum);
@@ -1337,7 +1335,8 @@ public final class IgfsImpl implements IgfsEx {
                 if (secondaryFs != null) {
                     try {
                         secondarySpaceSize = secondaryFs.usedSpaceSize();
-                    } catch (IgniteException e) {
+                    }
+                    catch (IgniteException e) {
                         LT.warn(log, e, "Failed to get secondary file system consumed space
size.");
 
                         secondarySpaceSize = -1;
@@ -2091,34 +2090,34 @@ public final class IgfsImpl implements IgfsEx {
             throw new IllegalStateException("Failed to perform IGFS action because grid is
stopping.");
     }
 
-/**
- * IGFS thread factory.
- */
-@SuppressWarnings("NullableProblems")
-private static class IgfsThreadFactory implements ThreadFactory {
-    /** IGFS name. */
-    private final String name;
-
-    /** Counter. */
-    private final AtomicLong ctr = new AtomicLong();
-
     /**
-     * Constructor.
-     *
-     * @param name IGFS name.
+     * IGFS thread factory.
      */
-    private IgfsThreadFactory(String name) {
-        this.name = name;
-    }
+    @SuppressWarnings("NullableProblems")
+    private static class IgfsThreadFactory implements ThreadFactory {
+        /** IGFS name. */
+        private final String name;
 
-    /** {@inheritDoc} */
-    @Override public Thread newThread(Runnable r) {
-        Thread t = new Thread(r);
+        /** Counter. */
+        private final AtomicLong ctr = new AtomicLong();
+
+        /**
+         * Constructor.
+         *
+         * @param name IGFS name.
+         */
+        private IgfsThreadFactory(String name) {
+            this.name = name;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Thread newThread(Runnable r) {
+            Thread t = new Thread(r);
 
-        t.setName("igfs-<" + name + ">-batch-worker-thread-" + ctr.incrementAndGet());
-        t.setDaemon(true);
+            t.setName("igfs-<" + name + ">-batch-worker-thread-" + ctr.incrementAndGet());
+            t.setDaemon(true);
 
-        return t;
+            return t;
+        }
     }
 }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/929195c8/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index b17626c..af41ec4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -178,7 +178,7 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
                 mgr.stop(cancel);
             }
 
-            igfsCtx.igfs().stop();
+            igfsCtx.igfs().stop(cancel);
         }
 
         igfsCache.clear();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/929195c8/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index 1ebbf9e..e78ea68 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -1522,7 +1522,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest
{
 
         os.write(chunk);
 
-        igfs.stop();
+        igfs.stop(true);
 
         // Reset test state.
         afterTestsStopped();


Mime
View raw message