[infinispan-commits] Infinispan SVN: r2090 - in trunk: 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
Wed Jul 21 07:06:24 EDT 2010
Author: mircea.markus
Date: 2010-07-21 07:06:23 -0400 (Wed, 21 Jul 2010)
New Revision: 2090
Modified:
trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java
trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
Log:
merged from trunk - added tx_id to the header
Modified: trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java
===================================================================
--- trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java 2010-07-21 06:55:43 UTC (rev 2089)
+++ trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java 2010-07-21 11:06:23 UTC (rev 2090)
@@ -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: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala 2010-07-21 06:55:43 UTC (rev 2089)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala 2010-07-21 11:06:23 UTC (rev 2090)
@@ -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: trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala
===================================================================
--- trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala 2010-07-21 06:55:43 UTC (rev 2089)
+++ trunk/server/hotrod/src/test/scala/org/infinispan/server/hotrod/test/HotRodClient.scala 2010-07-21 11:06:23 UTC (rev 2090)
@@ -35,7 +35,7 @@
* @since 4.1
*/
class HotRodClient(host: String, port: Int, defaultCacheName: String, rspTimeoutSeconds: Int) extends Logging {
- val idToOp = new ConcurrentHashMap[Long, Op]
+ val idToOp = new ConcurrentHashMap[Long, Op]
private lazy val ch: Channel = {
val factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool, Executors.newCachedThreadPool)
@@ -50,7 +50,7 @@
assertTrue(connectFuture.isSuccess)
ch
}
-
+
def stop = ch.disconnect
def put(k: Array[Byte], lifespan: Int, maxIdle: Int, v: Array[Byte]): TestResponse =
@@ -90,12 +90,12 @@
def putIfAbsent(k: Array[Byte], lifespan: Int, maxIdle: Int, v: Array[Byte], flags: Int): TestResponse =
execute(0xA0, 0x05, defaultCacheName, k, lifespan, maxIdle, v, 0, flags)
-
+
def replace(k: Array[Byte], lifespan: Int, maxIdle: Int, v: Array[Byte]): TestResponse =
execute(0xA0, 0x07, defaultCacheName, k, lifespan, maxIdle, v, 0, 1 ,0)
def replace(k: Array[Byte], lifespan: Int, maxIdle: Int, v: Array[Byte], flags: Int): TestResponse =
- execute(0xA0, 0x07, defaultCacheName, k, lifespan, maxIdle, v, 0, flags)
+ execute(0xA0, 0x07, defaultCacheName, k, lifespan, maxIdle, v, 0, flags)
def replaceIfUnmodified(k: Array[Byte], lifespan: Int, maxIdle: Int, v: Array[Byte], version: Long): TestResponse =
execute(0xA0, 0x09, defaultCacheName, k, lifespan, maxIdle, v, version, 1 ,0)
@@ -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