[infinispan-dev] vint for key/value size

Galder Zamarreno galder at redhat.com
Tue Mar 23 03:25:54 EDT 2010


Hi Mircea,

Sorry hadn't replied earlier to this.

On Fri, 12 Mar 2010 12:59:34 +0100, Mircea Markus  
<mircea.markus at jboss.com> wrote:

> Hi Galder,
>
> Currently the size of a key (value) is an 5 bytes vint.
> The max size of an int (4byte) in java is 2^31 -1. So the max size of an  
> byte array is  (2^31 -1).
> An 5 bytes vint can be > 2^31, e.g. vint (10000000, 10000000, 10000000,  
> 10000000, 01000000) == 2^34 > greater than Integer.MAX_VALUE. This means  
> that if a client will sends a message with this size(2^34 or greater) we  
> won't be able to put it on a single byte array.
> Not sure that will happen, as 2^31 is already 2048MB which is a lot  
> already :), but for correctness sake I guess we can specify that the key  
> size is an 5 bytes vint, but not bigger than 2^31-1.
>
> Similar for the longs we use.
>
> Wdyt?

+1. I'll add a note on this to the wiki.

>
> 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




More information about the infinispan-dev mailing list