ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [7/8] incubator-ignite git commit: # sprint-51
Date Wed, 04 Mar 2015 08:20:46 GMT
# sprint-51


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

Branch: refs/heads/ignite-51
Commit: dd13b744ff63cbcb84b1df3ecfa91f304d9c1715
Parents: 43753a8
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Mar 4 11:00:58 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Mar 4 11:00:58 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 21 ++------------------
 .../processors/cache/GridCacheContext.java      |  4 ++--
 .../dataload/IgniteDataLoaderImpl.java          | 11 +++++-----
 .../portable/GridPortableProcessor.java         |  2 +-
 .../portable/os/GridOsPortableProcessor.java    |  7 +------
 5 files changed, 12 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd13b744/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index cd8052d..203eee5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -3399,20 +3399,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         if (keyCheck)
             validateCacheKeys(keys);
 
-        Collection<K> pKeys = null;
-
-        if (ctx.portableEnabled()) {
-            pKeys = new ArrayList<>(keys.size());
-
-            for (K key : keys)
-                pKeys.add((K)ctx.marshalToPortable(key));
-        }
-
-        final Collection<K> pKeys0 = pKeys;
-
         syncOp(new SyncInOp(keys.size() == 1) {
             @Override public void inOp(IgniteTxLocalAdapter tx) throws IgniteCheckedException
{
-                tx.removeAllAsync(ctx, pKeys0 != null ? pKeys0 : keys, null, false, filter).get();
+                tx.removeAllAsync(ctx, keys, null, false, filter).get();
             }
 
             @Override public String toString() {
@@ -4139,15 +4128,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         long topVer,
         boolean replicate,
         long ttl) {
-        if (p != null && !p.apply(key, val))
+        if (p != null && !p.apply(key.value(ctx, false), val))
             return;
 
-// TODO IGNITE-51.
-//        if (ctx.portableEnabled()) {
-//            key = (K)ctx.marshalToPortable(key);
-//            val = (V)ctx.marshalToPortable(val);
-//        }
-
         CacheObject cacheVal = ctx.toCacheObject(val);
 
         GridCacheEntryEx entry = entryEx(key, false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd13b744/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index bcf0f0c..fd9c76b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -296,8 +296,6 @@ public class GridCacheContext<K, V> implements Externalizable {
         hasPeekArr = new IgnitePredicate[]{F.cacheHasPeekValue()};
         trueArr = new IgnitePredicate[]{F.alwaysTrue()};
 
-        cacheObjCtx = new CacheObjectContext(ctx);
-
         // Create unsafe memory only if writing values
         unsafeMemory = (cacheCfg.getMemoryMode() == OFFHEAP_VALUES || cacheCfg.getMemoryMode()
== OFFHEAP_TIERED) ?
             new GridUnsafeMemory(cacheCfg.getOffHeapMaxMemory()) : null;
@@ -306,6 +304,8 @@ public class GridCacheContext<K, V> implements Externalizable {
 
         cacheName = cacheCfg.getName();
 
+        cacheObjCtx = ctx.portable().contextForCache(null, cacheName);
+
         if (cacheName != null) {
             int hash = cacheName.hashCode();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd13b744/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index ab9b29b..4b4621d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@ -170,17 +170,18 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K,
V>, Delay
 
         this.ctx = ctx;
         this.cacheObjProc = ctx.portable();
-        this.cacheObjCtx = new CacheObjectContext(ctx);
-        this.cacheName = cacheName;
-        this.flushQ = flushQ;
-
-        log = U.logger(ctx, logRef, IgniteDataLoaderImpl.class);
 
         ClusterNode node = F.first(ctx.grid().cluster().forCacheNodes(cacheName).nodes());
 
         if (node == null)
             throw new IllegalStateException("Cache doesn't exist: " + cacheName);
 
+        this.cacheObjCtx = ctx.portable().contextForCache(node, cacheName);
+        this.cacheName = cacheName;
+        this.flushQ = flushQ;
+
+        log = U.logger(ctx, logRef, IgniteDataLoaderImpl.class);
+
         discoLsnr = new GridLocalEventListener() {
             @Override public void onEvent(Event evt) {
                 assert evt.type() == EVT_NODE_FAILED || evt.type() == EVT_NODE_LEFT;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd13b744/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
index 5da5ee9..35f6760 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
@@ -152,7 +152,7 @@ public interface GridPortableProcessor extends GridProcessor {
      * @param cacheName Cache name.
      * @return Cache object context.
      */
-    public CacheObjectContext dataLoadContext(@Nullable String cacheName);
+    public CacheObjectContext contextForCache(ClusterNode node, @Nullable String cacheName);
 
     /**
      * @param obj Object.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd13b744/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
index 414c292..77ba7ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
@@ -125,12 +125,7 @@ public class GridOsPortableProcessor extends IgniteCacheObjectProcessorAdapter
{
     }
 
     /** {@inheritDoc} */
-    @Override public CacheObjectContext dataLoadContext(@Nullable String cacheName) {
-        ClusterNode node = F.first(ctx.grid().cluster().forCacheNodes(cacheName).nodes());
-
-        if (node == null)
-            throw new IllegalStateException("Cache doesn't exist: " + cacheName);
-
+    @Override public CacheObjectContext contextForCache(ClusterNode node, @Nullable String
cacheName) {
         return new CacheObjectContext(ctx);
     }
 


Mime
View raw message