[infinispan-dev] Topology Id in Hotrod header

Mircea Markus mircea.markus at jboss.com
Fri Jul 16 05:10:35 EDT 2010


On 16 Jul 2010, at 09:11, Galder Zamarreño wrote:

> 
> On Jul 15, 2010, at 7:08 PM, Mircea Markus wrote:
> 
>> Hi,
>> 
>> The header for a request is composed of: 
>> 
>> Magic	Message Id	Version	Opcode	Cache Name Length	Cache Name	Flags	Client Intelligence	Topology Id
>> 
>> 
>> We send "Topology Id " even if the client is not topology aware. Wouldn't it be more effective to only expect it if the client's intelligence is 02 or 03 and not send it otherwise?
> 
> I think doing things like this starts to complicate protocol parsing.
If I'm not missing something, this would be solved through a single if statement:
topologyId = 0;
if (intelligence == 3) {
  topologyId = stream.readVint();
}
This increases performance as we don't send data that is not needed. I'm about to add transaction Id to operations as well, and I'd rather not add it if it is not needed. 
> Having optional fields that are present or not depending of contents is complicating things, particularly when we're talking about the header which is common to everyone.
> 
>> 
>> Cheers,
>> Mircea   
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
> 
> 
> _______________________________________________
> 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