[infinispan-commits] Infinispan SVN: r2125 - in branches/4.1.x: server/hotrod/src/main/scala/org/infinispan/server/hotrod and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Jul 30 10:29:24 EDT 2010


Author: manik.surtani at jboss.com
Date: 2010-07-30 10:29:23 -0400 (Fri, 30 Jul 2010)
New Revision: 2125

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
Log:
[ISPN-554] (Transactional Hot Rod headers)

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-30 14:24:24 UTC (rev 2124)
+++ branches/4.1.x/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/HotRodOperation.java	2010-07-30 14:29:23 UTC (rev 2125)
@@ -35,8 +35,11 @@
    protected final byte[] cacheName;
 
    protected final AtomicInteger topologyId;
-   private static final byte[] NO_TX = new byte[]{};
+   
+   private static final byte NO_TX = 0;
+   private static final byte XA_TX = 1;
 
+
    protected HotRodOperation(Flag[] flags, byte[] cacheName, AtomicInteger topologyId) {
       this.flags = flags;
       this.cacheName = cacheName;
@@ -63,7 +66,7 @@
       transport.writeByte(CLIENT_INTELLIGENCE_HASH_DISTRIBUTION_AWARE);
       transport.writeVInt(topologyId.get());
       //todo change once TX support is added
-      transport.writeArray(NO_TX);
+      transport.writeByte(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-30 14:24:24 UTC (rev 2124)
+++ branches/4.1.x/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder10.scala	2010-07-30 14:29:23 UTC (rev 2125)
@@ -53,7 +53,9 @@
       val clientIntelligence = buffer.readUnsignedByte
       val topologyId = buffer.readUnsignedInt
       //todo use these once transaction support is added
-      val txId = buffer.readRangedBytes
+      val txId = buffer.readByte
+      if (txId != 0) throw new UnsupportedOperationException("Transaction types other than 0 (NO_TX) is not supported at this stage.  Saw TX_ID of " + txId)
+
       new HotRodHeader(op, messageId, cacheName, flag, clientIntelligence, topologyId, this)
    }
 
@@ -231,4 +233,4 @@
    type ProtocolFlag = Enumeration#Value
    val NoFlag = Value
    val ForceReturnPreviousValue = Value
-}
\ No newline at end of file
+}



More information about the infinispan-commits mailing list