ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [16/17] incubator-ignite git commit: IGNITE-884 - Spring autowiring
Date Thu, 18 Jun 2015 02:25:41 GMT
IGNITE-884 - Spring autowiring


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

Branch: refs/heads/ignite-884
Commit: aaa7818e03b182744960ec3babfb215d306d5878
Parents: e011011
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Wed Jun 17 18:45:17 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Wed Jun 17 18:45:17 2015 -0700

----------------------------------------------------------------------
 .../cache/DynamicCacheChangeRequest.java           | 17 +++++++++++++++++
 .../processors/cache/GridCacheProcessor.java       | 16 +++++++++++-----
 .../optimized/OptimizedClassDescriptor.java        |  2 +-
 3 files changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aaa7818e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
index c08a179..cfe61c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
@@ -63,6 +63,9 @@ public class DynamicCacheChangeRequest implements Serializable {
     /** Template configuration flag. */
     private boolean template;
 
+    /** Start context. */
+    private transient CacheStartContext startCtx;
+
     /**
      * Constructor creates cache stop request.
      *
@@ -220,6 +223,20 @@ public class DynamicCacheChangeRequest implements Serializable {
         this.failIfExists = failIfExists;
     }
 
+    /**
+     * @return Start context.
+     */
+    public CacheStartContext startContext() {
+        return startCtx;
+    }
+
+    /**
+     * @param startCtx Start context.
+     */
+    public void startContext(CacheStartContext startCtx) {
+        this.startCtx = startCtx;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(DynamicCacheChangeRequest.class, this, "cacheName", cacheName());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aaa7818e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index a86738f..441f0f2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -226,7 +226,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         }
 
         if (cfg.getCacheStoreFactory() == null) {
-            Factory<CacheLoader> ldrFactory = cfg.isReadThrough() ? cfg.getCacheLoaderFactory()
: null;
+            Factory<CacheLoader> ldrFactory = cfg.getCacheLoaderFactory();
             Factory<CacheWriter> writerFactory = cfg.isWriteThrough() ? cfg.getCacheWriterFactory()
: null;
 
             if (ldrFactory != null || writerFactory != null)
@@ -1994,7 +1994,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             return new GridFinishedFuture<>(e);
         }
 
-        startCtxs.putIfAbsent(maskNull(cacheName), new CacheStartContext(ctx, cfg));
+        req.startContext(new CacheStartContext(ctx, cfg));
 
         return F.first(initiateCacheChanges(F.asList(req), failIfExists));
     }
@@ -2026,8 +2026,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             DynamicCacheStartFuture fut = new DynamicCacheStartFuture(req.cacheName(), req.deploymentId(),
req);
 
             try {
+                String masked = maskNull(req.cacheName());
+
                 if (req.stop()) {
-                    DynamicCacheDescriptor desc = registeredCaches.get(maskNull(req.cacheName()));
+                    DynamicCacheDescriptor desc = registeredCaches.get(masked);
 
                     if (desc == null)
                         // No-op.
@@ -2046,8 +2048,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 if (fut.isDone())
                     continue;
 
-                DynamicCacheStartFuture old = (DynamicCacheStartFuture)pendingFuts.putIfAbsent(
-                    maskNull(req.cacheName()), fut);
+                DynamicCacheStartFuture old = (DynamicCacheStartFuture)pendingFuts.putIfAbsent(masked,
fut);
 
                 if (old != null) {
                     if (req.start()) {
@@ -2074,6 +2075,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         continue;
                     }
                 }
+                else {
+                    CacheStartContext oldStartCtx = startCtxs.put(masked, req.startContext());
+
+                    assert oldStartCtx == null;
+                }
 
                 if (fut.isDone())
                     continue;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aaa7818e/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedClassDescriptor.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedClassDescriptor.java
index b66de27..05ef534 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedClassDescriptor.java
@@ -531,7 +531,7 @@ class OptimizedClassDescriptor {
      */
     @SuppressWarnings("ForLoopReplaceableByForEach")
     void write(OptimizedObjectOutputStream out, Object obj) throws IOException {
-        out.writeByte(type);
+        out.write(type);
 
         switch (type) {
             case BYTE:


Mime
View raw message