ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/4] ignite git commit: Minor imports refactoring.
Date Fri, 18 Mar 2016 12:31:27 GMT
Minor imports refactoring.


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

Branch: refs/heads/ignite-igfs-refactoring
Commit: 3f248536b277a8e9530a5d564b4dc905548d6a6d
Parents: fef06b0
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Mar 18 15:05:31 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Mar 18 15:05:31 2016 +0300

----------------------------------------------------------------------
 .../processors/igfs/IgfsMetaManager.java        | 51 +++++++++++---------
 1 file changed, 28 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3f248536/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 91fd21d..ef2bffb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -57,6 +57,8 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
 import org.jetbrains.annotations.Nullable;
 
 import javax.cache.processor.EntryProcessor;
@@ -84,10 +86,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
 
-import static org.apache.ignite.events.EventType.*;
-import static org.apache.ignite.internal.processors.igfs.IgfsFileInfo.*;
-import static org.apache.ignite.transactions.TransactionConcurrency.*;
-import static org.apache.ignite.transactions.TransactionIsolation.*;
+import static org.apache.ignite.internal.processors.igfs.IgfsFileInfo.builder;
 
 /**
  * Cache based structure (meta data) manager.
@@ -1736,9 +1735,10 @@ public class IgfsMetaManager extends IgfsManager {
                         tx.commit();
 
                         // Generate events.
-                        if (evts.isRecordable(EVT_IGFS_DIR_CREATED)) {
+                        if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) {
                             for (IgfsPath createdPath : createdPaths)
-                                IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
EVT_IGFS_DIR_CREATED);
+                                IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
+                                    EventType.EVT_IGFS_DIR_CREATED);
                         }
 
                         // We are done.
@@ -1982,11 +1982,12 @@ public class IgfsMetaManager extends IgfsManager {
                                 parentInfo = synchronize(fs, parentPath, parentInfo, parent0,
true, null);
 
                                 // Fire notification about missing directories creation.
-                                if (evts.isRecordable(EVT_IGFS_DIR_CREATED)) {
+                                if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) {
                                     IgfsPath evtPath = parent0;
 
                                     while (!parentPath.equals(evtPath)) {
-                                        pendingEvts.addFirst(new IgfsEvent(evtPath, locNode,
EVT_IGFS_DIR_CREATED));
+                                        pendingEvts.addFirst(new IgfsEvent(evtPath, locNode,
+                                            EventType.EVT_IGFS_DIR_CREATED));
 
                                         evtPath = evtPath.parent();
 
@@ -2032,8 +2033,8 @@ public class IgfsMetaManager extends IgfsManager {
                             }
 
                             // Record CREATE event if needed.
-                            if (evts.isRecordable(EVT_IGFS_FILE_CREATED))
-                                pendingEvts.add(new IgfsEvent(path, locNode, EVT_IGFS_FILE_CREATED));
+                            if (evts.isRecordable(EventType.EVT_IGFS_FILE_CREATED))
+                                pendingEvts.add(new IgfsEvent(path, locNode, EventType.EVT_IGFS_FILE_CREATED));
 
                             return new IgfsSecondaryOutputStreamDescriptor(parentInfo.id(),
newInfo, out);
                         }
@@ -2307,11 +2308,11 @@ public class IgfsMetaManager extends IgfsManager {
 
                         synchronize(fs, parentPath, parentPathInfo, path, true, null);
 
-                        if (evts.isRecordable(EVT_IGFS_DIR_CREATED)) {
+                        if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) {
                             IgfsPath evtPath = path;
 
                             while (!parentPath.equals(evtPath)) {
-                                pendingEvts.addFirst(new IgfsEvent(evtPath, locNode, EVT_IGFS_DIR_CREATED));
+                                pendingEvts.addFirst(new IgfsEvent(evtPath, locNode, EventType.EVT_IGFS_DIR_CREATED));
 
                                 evtPath = evtPath.parent();
 
@@ -2408,15 +2409,15 @@ public class IgfsMetaManager extends IgfsManager {
 
                         // Record event if needed.
                         if (srcInfo.isFile()) {
-                            if (evts.isRecordable(EVT_IGFS_FILE_RENAMED))
+                            if (evts.isRecordable(EventType.EVT_IGFS_FILE_RENAMED))
                                 pendingEvts.add(new IgfsEvent(
                                     src,
                                     destInfo == null ? dest : new IgfsPath(dest, src.name()),
                                     locNode,
-                                    EVT_IGFS_FILE_RENAMED));
+                                    EventType.EVT_IGFS_FILE_RENAMED));
                         }
-                        else if (evts.isRecordable(EVT_IGFS_DIR_RENAMED))
-                            pendingEvts.add(new IgfsEvent(src, dest, locNode, EVT_IGFS_DIR_RENAMED));
+                        else if (evts.isRecordable(EventType.EVT_IGFS_DIR_RENAMED))
+                            pendingEvts.add(new IgfsEvent(src, dest, locNode, EventType.EVT_IGFS_DIR_RENAMED));
 
                         return true;
                     }
@@ -2918,7 +2919,7 @@ public class IgfsMetaManager extends IgfsManager {
      * @return Transaction.
      */
     private IgniteInternalTx startTx() {
-        return metaCache.txStartEx(PESSIMISTIC, REPEATABLE_READ);
+        return metaCache.txStartEx(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
     }
 
     /**
@@ -3515,12 +3516,13 @@ public class IgfsMetaManager extends IgfsManager {
                             tx.commit();
 
                             // Generate events.
-                            if (evts.isRecordable(EVT_IGFS_DIR_CREATED)) {
+                            if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) {
                                 for (IgfsPath createdPath : createdPaths)
-                                    IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
EVT_IGFS_DIR_CREATED);
+                                    IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
+                                        EventType.EVT_IGFS_DIR_CREATED);
                             }
 
-                            IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EVT_IGFS_FILE_CREATED);
+                            IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EventType.EVT_IGFS_FILE_CREATED);
                             IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EventType.EVT_IGFS_FILE_OPENED_WRITE);
 
                             return t2;
@@ -3539,6 +3541,8 @@ public class IgfsMetaManager extends IgfsManager {
         }
     }
 
+    private
+
     /**
      * Create a new file.
      *
@@ -3708,12 +3712,13 @@ public class IgfsMetaManager extends IgfsManager {
                             tx.commit();
 
                             // Generate events.
-                            if (evts.isRecordable(EVT_IGFS_DIR_CREATED)) {
+                            if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) {
                                 for (IgfsPath createdPath : createdPaths)
-                                    IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
EVT_IGFS_DIR_CREATED);
+                                    IgfsUtils.sendEvents(igfsCtx.kernalContext(), createdPath,
+                                        EventType.EVT_IGFS_DIR_CREATED);
                             }
 
-                            IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EVT_IGFS_FILE_CREATED);
+                            IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EventType.EVT_IGFS_FILE_CREATED);
                             IgfsUtils.sendEvents(igfsCtx.kernalContext(), path, EventType.EVT_IGFS_FILE_OPENED_WRITE);
 
                             return t2;


Mime
View raw message