ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [19/50] [abbrv] incubator-ignite git commit: IGNITE-61 - Direct marshalling
Date Tue, 10 Feb 2015 04:09:50 GMT
IGNITE-61 - Direct marshalling


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

Branch: refs/heads/sprint-1
Commit: 3b721e304576f63ef773ea3317b0f4723a5f58e6
Parents: 46ea0dd
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Sun Feb 8 16:00:41 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Sun Feb 8 16:00:41 2015 -0800

----------------------------------------------------------------------
 .../ignite/codegen/CommunicationMessageCodeGenerator.java       | 4 +++-
 .../java/org/apache/ignite/internal/GridJobExecuteRequest.java  | 2 +-
 .../apache/ignite/internal/direct/DirectByteBufferStream.java   | 4 ++--
 .../org/apache/ignite/internal/direct/DirectMessageReader.java  | 5 +++--
 .../internal/managers/communication/GridIoUserMessage.java      | 2 +-
 .../internal/managers/deployment/GridDeploymentInfoBean.java    | 2 +-
 .../internal/managers/eventstorage/GridEventStorageMessage.java | 2 +-
 .../processors/cache/distributed/near/GridNearGetRequest.java   | 2 +-
 .../processors/clock/GridClockDeltaSnapshotMessage.java         | 2 +-
 .../internal/processors/dataload/GridDataLoadRequest.java       | 2 +-
 .../ignite/internal/processors/fs/GridGgfsBlocksMessage.java    | 2 +-
 .../processors/streamer/GridStreamerExecutionRequest.java       | 2 +-
 .../ignite/plugin/extensions/communication/MessageReader.java   | 2 +-
 13 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
b/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
index a367437..f4c8d94 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
@@ -622,8 +622,10 @@ public class CommunicationMessageCodeGenerator {
             assert mapKeyType != null;
             assert mapValType != null;
 
+            boolean linked = type.equals(LinkedHashMap.class);
+
             returnFalseIfReadFailed(name, "reader.readMap", field, mapKeyType.getSimpleName()
+ ".class",
-                mapValType.getSimpleName() + ".class");
+                mapValType.getSimpleName() + ".class", linked ? "true" : "false");
         }
         else
             throw new IllegalStateException("Unsupported type: " + type);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
index 4631000..004b995 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
@@ -676,7 +676,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 state++;
 
             case 9:
-                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class);
+                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class,
false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
index fe8d2b8..e35ab69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectByteBufferStream.java
@@ -1001,7 +1001,7 @@ public class DirectByteBufferStream {
     }
 
     @SuppressWarnings("unchecked")
-    public <M extends Map<K, V>, K, V> M readMap(Class<K> keyCls, Class<V>
valCls) {
+    public <M extends Map<K, V>, K, V> M readMap(Class<K> keyCls, Class<V>
valCls, boolean linked) {
         if (readSize == -1) {
             int size = readInt();
 
@@ -1013,7 +1013,7 @@ public class DirectByteBufferStream {
 
         if (readSize >= 0) {
             if (map == null)
-                map = U.newHashMap(readSize);
+                map = linked ? U.newLinkedHashMap(readSize) : U.newHashMap(readSize);
 
             Type keyType = type(keyCls);
             Type valType = type(valCls);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
index 1bc3d50..71b9e63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
@@ -263,8 +263,9 @@ public class DirectMessageReader implements MessageReader {
     }
 
     /** {@inheritDoc} */
-    @Override public <M extends Map<K, V>, K, V> M readMap(String name, Class<K>
keyCls, Class<V> valCls) {
-        M map = stream.readMap(keyCls, valCls);
+    @Override public <M extends Map<K, V>, K, V> M readMap(String name, Class<K>
keyCls, Class<V> valCls,
+        boolean linked) {
+        M map = stream.readMap(keyCls, valCls, linked);
 
         lastRead = stream.lastFinished();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
index 0bc81d4..05ff2df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
@@ -327,7 +327,7 @@ public class GridIoUserMessage extends MessageAdapter {
                 state++;
 
             case 4:
-                ldrParties = reader.readMap("ldrParties", UUID.class, IgniteUuid.class);
+                ldrParties = reader.readMap("ldrParties", UUID.class, IgniteUuid.class, false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
index 4907c56..a84d049 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
@@ -237,7 +237,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements
GridDeploy
                 state++;
 
             case 3:
-                participants = reader.readMap("participants", UUID.class, IgniteUuid.class);
+                participants = reader.readMap("participants", UUID.class, IgniteUuid.class,
false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
index 352d360..058ac8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
@@ -415,7 +415,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 state++;
 
             case 6:
-                ldrParties = reader.readMap("ldrParties", UUID.class, IgniteUuid.class);
+                ldrParties = reader.readMap("ldrParties", UUID.class, IgniteUuid.class, false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git 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
index 0e96170..9c4ef10 100644
--- 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
@@ -399,7 +399,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K,
V> implements
                 state++;
 
             case 6:
-                keyBytes = reader.readMap("keyBytes", byte[].class, boolean.class);
+                keyBytes = reader.readMap("keyBytes", byte[].class, boolean.class, true);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
index 8063d2a..5afd5a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
@@ -126,7 +126,7 @@ public class GridClockDeltaSnapshotMessage extends MessageAdapter {
 
         switch (state) {
             case 0:
-                deltas = reader.readMap("deltas", UUID.class, long.class);
+                deltas = reader.readMap("deltas", UUID.class, long.class, false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
index 15721f9..169fe46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
@@ -371,7 +371,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 state++;
 
             case 6:
-                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class);
+                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class,
false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsBlocksMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsBlocksMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsBlocksMessage.java
index 7740066..a99de9f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsBlocksMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/GridGgfsBlocksMessage.java
@@ -153,7 +153,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage
{
 
         switch (state) {
             case 0:
-                blocks = reader.readMap("blocks", GridGgfsBlockKey.class, byte[].class);
+                blocks = reader.readMap("blocks", GridGgfsBlockKey.class, byte[].class, false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
index 90e7163..a4bc2bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
@@ -271,7 +271,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 state++;
 
             case 4:
-                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class);
+                ldrParticipants = reader.readMap("ldrParticipants", UUID.class, IgniteUuid.class,
false);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3b721e30/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
index 5ae2f2a..5584ae7 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
@@ -76,7 +76,7 @@ public interface MessageReader {
 
     public <C extends Collection<T>, T> C readCollection(String name, Class<T>
itemCls);
 
-    public <M extends Map<K, V>, K, V> M readMap(String name, Class<K>
keyCls, Class<V> valCls);
+    public <M extends Map<K, V>, K, V> M readMap(String name, Class<K>
keyCls, Class<V> valCls, boolean linked);
 
     public boolean isLastRead();
 }


Mime
View raw message