ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/22] incubator-ignite git commit: #ignite-51: IgniteTxEntry implements Message.
Date Wed, 04 Mar 2015 13:26:38 GMT
#ignite-51: IgniteTxEntry implements Message.


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

Branch: refs/heads/ignite-51
Commit: e1cf7527ed0c4a861b4cd87d9d3f461819df02fc
Parents: ac04da2
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Mar 3 18:28:14 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Mar 3 18:28:14 2015 +0300

----------------------------------------------------------------------
 .../managers/communication/GridIoMessageFactory.java      |  3 +++
 .../cache/distributed/dht/GridDhtTxPrepareRequest.java    |  9 +++++----
 .../cache/distributed/near/GridNearTxPrepareResponse.java | 10 ++++++----
 .../processors/cache/transactions/IgniteTxEntry.java      |  1 -
 .../processors/cache/transactions/IgniteTxKey.java        |  3 ---
 5 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1cf7527/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
index ccf8395..5b0f7dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java
@@ -533,14 +533,17 @@ public class GridIoMessageFactory implements MessageFactory {
                 msg = new CacheContinuousQueryEntry();
 
                 break;
+
             case 97:
                 msg = new IgniteTxEntry();
 
                 break;
+
             case 98:
                 msg = new IgniteTxEntry.TxEntryValueHolder();
 
                 break;
+
             case 99:
                 msg = new GridNearTxPrepareResponse.OwnedValue();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1cf7527/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index de812c9..19533eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -58,7 +58,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
 
     /** Near writes. */
     @GridToStringInclude
-    @GridDirectTransient
+    @GridDirectCollection(IgniteTxEntry.class)
     private Collection<IgniteTxEntry> nearWrites;
 
     /** Owned versions by key. */
@@ -67,9 +67,11 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
     private Map<IgniteTxKey, GridCacheVersion> owned;
 
     /** Owned keys. */
+    @GridDirectCollection(IgniteTxKey.class)
     private Collection<IgniteTxKey> ownedKeys;
 
     /** Owned values. */
+    @GridDirectCollection(GridCacheVersion.class)
     private Collection<GridCacheVersion> ownedVals;
 
     /** Near transaction ID. */
@@ -294,10 +296,10 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
         super.finishUnmarshal(ctx, ldr);
 
         if (ownedKeys != null && owned == null) {
-            owned = new HashMap<>();
-
             assert ownedKeys.size() == ownedVals.size();
 
+            owned = U.newHashMap(ownedKeys.size());
+
             Iterator<IgniteTxKey> keyIter = ownedKeys.iterator();
 
             Iterator<GridCacheVersion> valIter = ownedVals.iterator();
@@ -313,7 +315,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
         }
 
         unmarshalTx(nearWrites, true, ctx, ldr);
-
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1cf7527/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index e30f89c..22efce4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -174,9 +174,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
         if (ownedVals == null)
             ownedVals = new HashMap<>();
 
-        OwnedValue oVal = new OwnedValue();
-
-        oVal.init(ver, val);
+        OwnedValue oVal = new OwnedValue(ver, val);
 
         ownedVals.put(key, oVal);
     }
@@ -486,13 +484,17 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
         /** Cache object. */
         private CacheObject obj;
 
+        public OwnedValue() {
+            // No-op.
+        }
+
         /**
          * Initialize OwnedValues.
          *
           * @param vers Cache version.
          * @param obj Cache object.
          */
-        void init(GridCacheVersion vers, CacheObject obj) {
+        OwnedValue(GridCacheVersion vers, CacheObject obj) {
             this.vers = vers;
             this.obj = obj;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1cf7527/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index e763444..03f70db 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.transactions;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.tostring.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e1cf7527/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
index 7d10a66..eb0fee8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxKey.java
@@ -31,9 +31,6 @@ import java.nio.*;
  * for multiple caches.
  */
 public class IgniteTxKey implements Message {
-    /** */
-    private static final long serialVersionUID = 0L;
-
     /** Key. */
     @GridToStringInclude
     private KeyCacheObject key;


Mime
View raw message