[infinispan-commits] Infinispan SVN: r2084 - in branches/4.1.x: server/hotrod/src/main/scala/org/infinispan/server/hotrod and 1 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Tue Jul 20 11:32:38 EDT 2010
Author: mircea.markus
Date: 2010-07-20 11:32:38 -0400 (Tue, 20 Jul 2010)
New Revision: 2084
Modified:
branches/4.1.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java
branches/4.1.x/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
branches/4.1.x/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
Log:
add tx support in the HotRod header
Modified: branches/4.1.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java
===================================================================
--- branches/4.1.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java 2010-07-20 15:29:52 UTC (rev 2083)
+++ branches/4.1.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java 2010-07-20 15:32:38 UTC (rev 2084)
@@ -35,6 +35,7 @@
protected final byte[] cacheName;
protected final AtomicInteger topologyId;
+ private static final byte[] NO_TX = new byte[]{};
protected HotRodOperation(Flag[] flags, byte[] cacheName, AtomicInteger topologyId) {
this.flags = flags;
@@ -61,6 +62,8 @@
transport.writeVInt(flagInt);
transport.writeByte(CLIENT_INTELLIGENCE_HASH_DISTRIBUTION_AWARE);
transport.writeVInt(topologyId.get());
+ //todo change once TX support is added
+ transport.writeArray(NO_TX);
if (log.isTraceEnabled()) {
log.trace("wrote header for message " + messageId + ". Operation code: " + operationCode + ". Flags: " + Integer.toHexString(flagInt));
}
Modified: branches/4.1.x/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
===================================================================
--- branches/4.1.x/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala 2010-07-20 15:29:52 UTC (rev 2083)
+++ branches/4.1.x/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala 2010-07-20 15:32:38 UTC (rev 2084)
@@ -52,6 +52,8 @@
}
val clientIntelligence = buffer.readUnsignedByte
val topologyId = buffer.readUnsignedInt
+ //todo use these once transaction support is added
+ val txId = buffer.readRangedBytes
new HotRodHeader(op, messageId, cacheName, flag, clientIntelligence, topologyId, this)
}
Modified: branches/4.1.x/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
===================================================================
--- branches/4.1.x/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala 2010-07-20 15:29:52 UTC (rev 2083)
+++ branches/4.1.x/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala 2010-07-20 15:32:38 UTC (rev 2084)
@@ -245,6 +245,7 @@
buffer.writeUnsignedInt(op.flags) // flags
buffer.writeByte(op.clientIntel) // client intelligence
buffer.writeUnsignedInt(op.topologyId) // topology id
+ buffer.writeRangedBytes(new Array[Byte](0))
if (op.code != 0x13 && op.code != 0x15 && op.code != 0x17 && op.code != 0x19) { // if it's a key based op...
buffer.writeRangedBytes(op.key) // key length + key
if (op.value != null) {
More information about the infinispan-commits
mailing list