[Fwd: [Dev] memcached option to always use non-serialized
primitive types?]
Evan Martin
martine at danga.com
Mon Dec 13 20:38:07 PST 2004
On Sun, Dec 12, 2004 at 10:28:39PM -0800, Kevin A. Burton wrote:
> [snip]
>
> If we assume the basic types are interned we could use the first byte as
> the type with the remaining bytes as the value. Then on get() we could
> read the first byte to determine the type and then construct the correct
> object for it. This would prevent the ClassCastException I talked about
> above.
You can also use the memcached per-item flags to specially store a few
sorts of types: n bits allows for 2^n different representations. Byte,
int, and string ought to be enough for most uses.
--
Evan Martin
martine at danga.com
http://neugierig.org
More information about the memcached
mailing list