ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [10/44] incubator-ignite git commit: IGNITE-52 - Merge branch sprint-1 into ignite-52
Date Sat, 14 Feb 2015 11:09:50 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index d7a2fde,0c8fa66..c0d99b9
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@@ -1363,9 -1419,28 +1358,25 @@@ public abstract class GridCacheMapEntry
  
              GridCacheValueBytes oldBytes = valueBytesUnlocked();
  
 -            boolean readThrough = false;
 -
 -            if (needVal && old == null &&
 -                (cctx.readThrough() && (op == GridCacheOperation.TRANSFORM || cctx.loadPreviousValue())))
{
 -                old = readThrough(null, key, false, CU.<K, V>empty(), subjId, taskName);
 +            if (needVal && old == null && (cctx.readThrough() &&
(op == GridCacheOperation.TRANSFORM || cctx.loadPreviousValue()))) {
 +                old = readThrough(null, key, false, subjId, taskName);
  
+                 long ttl = 0;
+                 long expireTime = 0;
+ 
+                 if (expiryPlc != null && old != null) {
+                     ttl = CU.toTtl(expiryPlc.getExpiryForCreation());
+ 
+                     if (ttl == CU.TTL_ZERO) {
+                         ttl = 1;
+                         expireTime = U.currentTimeMillis() - 1;
+                     }
+                     else if (ttl == CU.TTL_NOT_CHANGED)
+                         ttl = 0;
+                     else
+                         expireTime = CU.toExpireTime(ttl);
+                 }
+ 
                  // Detach value before index update.
                  if (cctx.portableEnabled())
                      old = (V)cctx.kernalContext().portable().detachPortable(old);
@@@ -1770,9 -1852,13 +1788,13 @@@
  
              GridCacheValueBytes oldBytes = valueBytesUnlocked();
  
+             boolean readThrough = false;
+ 
              if (needVal && old == null && (cctx.readThrough() &&
(op == GridCacheOperation.TRANSFORM || cctx.loadPreviousValue()))) {
 -                old = readThrough(null, key, false, CU.<K, V>empty(), subjId, taskName);
 +                old = readThrough(null, key, false, subjId, taskName);
  
+                 readThrough = true;
+ 
                  // Detach value before index update.
                  if (cctx.portableEnabled())
                      old = (V)cctx.kernalContext().portable().detachPortable(old);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index b9286d8,c5fa33e..000b790
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@@ -429,7 -442,12 +433,7 @@@ public abstract class GridNearCacheAdap
      }
  
      /** {@inheritDoc} */
-     @Override public boolean evict(K key, @Nullable IgnitePredicate<CacheEntry<K,
V>>[] filter) {
 -    @Override public boolean containsKey(K key, IgnitePredicate<Cache.Entry<K, V>>
filter) {
 -        return super.containsKey(key, filter) || dht().containsKey(key, filter);
 -    }
 -
 -    /** {@inheritDoc} */
+     @Override public boolean evict(K key, @Nullable IgnitePredicate<Cache.Entry<K,
V>>[] filter) {
          // Use unary 'and' to make sure that both sides execute.
          return super.evict(key, filter) & dht().evict(key, filter);
      }
@@@ -687,11 -705,11 +691,11 @@@
          }
  
          /** {@inheritDoc} */
-         @NotNull @Override public Iterator<CacheEntry<K, V>> iterator() {
+         @NotNull @Override public Iterator<Cache.Entry<K, V>> iterator() {
              return new EntryIterator(nearSet.iterator(),
-                 F.iterator0(dhtSet, false, new P1<CacheEntry<K, V>>() {
-                     @Override public boolean apply(CacheEntry<K, V> e) {
+                 F.iterator0(dhtSet, false, new P1<Cache.Entry<K, V>>() {
+                     @Override public boolean apply(Cache.Entry<K, V> e) {
 -                        return !GridNearCacheAdapter.super.containsKey(e.getKey(), null);
 +                        return !GridNearCacheAdapter.super.containsKey(e.getKey());
                      }
                  }));
          }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index 6aec9cf,1c18112..31b8798
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
@@@ -70,8 -68,14 +71,7 @@@ public class GridNearGetRequest<K, V> e
      /** Topology version. */
      private long topVer;
  
 -    /** Filters. */
 -    @GridDirectTransient
 -    private IgnitePredicate<Cache.Entry<K, V>>[] filter;
 -
      /** Subject ID. */
-     @GridDirectVersion(1)
      private UUID subjId;
  
      /** Task name hash. */
@@@ -278,111 -286,80 +277,85 @@@
          if (!super.writeTo(buf))
              return false;
  
-         if (!commState.typeWritten) {
-             if (!commState.putByte(directType()))
+         if (!typeWritten) {
+             if (!writer.writeByte(null, directType()))
                  return false;
  
-             commState.typeWritten = true;
+             typeWritten = true;
          }
  
-         switch (commState.idx) {
+         switch (state) {
              case 3:
-                 if (!commState.putLong(accessTtl))
+                 if (!writer.writeLong("accessTtl", accessTtl))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 4:
-                 if (!commState.putGridUuid(futId))
+                 if (!writer.writeObjectArray("filterBytes", filterBytes, byte[].class))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 5:
-                 if (keyBytes != null) {
-                     if (commState.it == null) {
-                         if (!commState.putInt(keyBytes.size()))
-                             return false;
- 
-                         commState.it = keyBytes.entrySet().iterator();
-                     }
- 
-                     while (commState.it.hasNext() || commState.cur != NULL) {
-                         if (commState.cur == NULL)
-                             commState.cur = commState.it.next();
- 
-                         Map.Entry<byte[], Boolean> e = (Map.Entry<byte[], Boolean>)commState.cur;
- 
-                         if (!commState.keyDone) {
-                             if (!commState.putByteArray(e.getKey()))
-                                 return false;
- 
-                             commState.keyDone = true;
-                         }
- 
-                         if (!commState.putBoolean(e.getValue()))
-                             return false;
- 
-                         commState.keyDone = false;
- 
-                         commState.cur = NULL;
-                     }
- 
-                     commState.it = null;
-                 } else {
-                     if (!commState.putInt(-1))
-                         return false;
-                 }
+                 if (!writer.writeIgniteUuid("futId", futId))
+                     return false;
  
-                 commState.idx++;
+                 state++;
  
              case 6:
-                 if (!commState.putGridUuid(miniId))
+                 if (!writer.writeMap("keyBytes", keyBytes, byte[].class, boolean.class))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 7:
-                 if (!commState.putBoolean(readThrough))
+                 if (!writer.writeIgniteUuid("miniId", miniId))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 8:
-                 if (!commState.putBoolean(reload))
+                 if (!writer.writeBoolean("readThrough", readThrough))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 9:
-                 if (!commState.putLong(topVer))
+                 if (!writer.writeBoolean("reload", reload))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 10:
-                 if (!commState.putCacheVersion(ver))
+                 if (!writer.writeUuid("subjId", subjId))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 11:
-                 if (!commState.putUuid(subjId))
+                 if (!writer.writeInt("taskNameHash", taskNameHash))
                      return false;
  
-                 commState.idx++;
+                 state++;
  
              case 12:
-                 if (!commState.putInt(taskNameHash))
+                 if (!writer.writeLong("topVer", topVer))
                      return false;
  
-                 commState.idx++;
+                 state++;
+ 
+             case 13:
+                 if (!writer.writeMessage("ver", ver))
+                     return false;
+ 
+                 state++;
  
 +            case 13:
 +                if (!commState.putBoolean(skipVals))
 +                    return false;
 +
 +                commState.idx++;
          }
  
          return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 1206284,9f1e5d1..6763f54
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@@ -1722,9 -1743,9 +1726,9 @@@ public abstract class IgniteTxLocalAdap
                  }
              }
              else {
 -                assert optimistic() || readCommitted() || groupLock();
 +                assert optimistic() || readCommitted() || groupLock() || skipVals;
  
-                 final Collection<K> redos = new LinkedList<>();
+                 final Collection<K> redos = new ArrayList<>();
  
                  if (!missed.isEmpty()) {
                      if (!readCommitted())

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81b19c4d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------


Mime
View raw message