[infinispan-dev] Hot Rod - pt3

Galder Zamarreno galder at redhat.com
Mon Dec 21 06:08:01 EST 2009


Hi all,

Re: http://community.jboss.org/wiki/HotRodProtocol

First, I've made the corresponding changes based on the feedback I got 
from pt2. This included reducing the response header since clients are 
already aware of what they sent, addition of topology view id to to non 
dumb requests and further specification in responses when topology 
changes have happened...etc.

I've also added flags to the request header that allow sending 
Infinispan flags like: skip cache store, zero lock acquisition 
timeout...etc.

Note that I've noted this as being N * 1 byte where each byte represents 
a flag. However, I think this could maybe be sent more efficiently by 
using XOR, i.e.

0x00 -> no flag
0x01 (0000 0001) -> zero lock acquisition
0x02 (0000 0010) -> cache mode local
0x03 (0000 0011) -> zero lock acquisition + cache mode local
0x04 (0000 0100) -> skip locking
...etc.

With 2 bytes, we could implement 16 Flags, we currently 11. However, we 
could use vint as well, making sure that the most significant bit does 
not mean anything flag wise. Iow, with vint, in 1 byte we'd be able to 
define 7 diff flags. Thoughts?

I've also added the quit command that disconnects clients.

Finally, as far as I'm concerned, the specification is complete. I'm 
leaving the quiet commands out of this initial scope (see 
http://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol). 
Remember that quiet commands could be used so that the server buffers 
responses and only when you send a non-quiet command, the server replies 
with all the pending answers.

As you can see at the bottom of the wiki, I've added a local only put 
request/response example so that readers get an idea of what a full 
command looks like. I had received some feedback from readers saying 
that it was difficult to understand how it all fit together.

I'll probably add a couple more examples for non-so-dumb and clever 
request/responses but I'll held them until we have a final round of 
feedback and people can indicate whether they want any other examples 
appearing in the wiki.

Cheers,
-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the infinispan-dev mailing list