[infinispan-dev] Stream encoding of Flags and future compatibility

Sanne Grinovero sanne at infinispan.org
Fri May 11 12:23:30 EDT 2012


On 11 May 2012 16:37, Galder Zamarreño <galder at redhat.com> wrote:
> Quickly tried this and caused no issues:
> https://github.com/galderz/infinispan/commit/7718926e5a4a6763506250362d7bd5cbdccd2931

Looks good! I'm sure this doesn't solve all future migration problems,
but if we could keep this kind of tricks around it should improve
odds.
IMHO, this is a kind of sensitivity that we should apply across all
areas (not just flags).

On a totally different page, why are we serializing Flags one-by-one ?
We mostly need to serialize EnumSets right?
An EnumSet can be encoded by using the bits of a couple of bytes.
Three bytes looks like enough for all our needs.. we could even be
clever and reserve a special Externalizer-ID for the empty set, to
avoid 3 bytes where none are needed.
While currently we need an integer (4 bytes) to encode the header for
"EnumSet", plus (4 bytes header + 1 byte value) * each flag -> a lot.

>
> On May 9, 2012, at 2:56 PM, Sanne Grinovero wrote:
>
>> I'm having an interesting "chat" with Galder on github after a pull request:
>> https://github.com/galderz/infinispan/commit/74b065d4f520d4a22dfa6ef78ae80e7aa19621d3#commitcomment-1310043
>>
>> The pull request itself was resolved, but we ended up brainstorming
>> about how we should encode some objects (Flags in this case) to make
>> sure we don't make it highly unlikely to be able to support rolling
>> upgrades in the future.. which is something we really have to think
>> about today imho.
>>
>> Cheers,
>> Sanne
>> _______________________________________________
>> 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