[infinispan-dev] Hotrod client intelligence

Mircea Markus mircea.markus at jboss.com
Tue Jul 20 09:15:28 EDT 2010


On 20 Jul 2010, at 12:37, Manik Surtani wrote:

> 
> On 20 Jul 2010, at 12:19, Mircea Markus wrote:
> 
>>> 
>>> What if the field was missing?
>> I don't know how can we read the optional field form the socket: we read it byte by byte, so if a byte is missing we block on read. Something like InputStream.available() would be useful, but even that one returns "an *estimate* of the number of bytes that can be read" - so it's not "good enough". 
> 
> Ah yes, what I meant was the field is unset.  E.g., contains a 0 or a -1 as a tx id which assumes either no tx in progress or a client that doesn't support txs.
The transaction would be sent as follows:   
[tx_id_length:vint] [tx_id: byte array]. 
if tx_id == 0, no tx.  
>  So I presume this was to optimise away the extra, unset field?  How big is this field anyway?
It would be a vint, so for non-tx request 1 byte - not much. 
Important: If we go for this approach we'd have to add the field now, before "freezing" the spec.
> 
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
> 
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev




More information about the infinispan-dev mailing list