Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleCacheObjectAdapter transformation
protected byte[] valueBytesFromValue(CacheObjectValueContext ctx) throws IgniteCheckedException {
    byte[] bytes = ctx.kernalContext().cacheObjects().marshal(ctx, val);

    return CacheObjectsTransformer.transformIfNecessary(bytes, ctx);
}


protected Object valueFromValueBytes(CacheObjectValueContext ctx, ClassLoader ldr) throws IgniteCheckedException {
    byte[] bytes = CacheObjectsTransformer.restoreIfNecessary(valBytes, ctx);

    return ctx.kernalContext().cacheObjects().unmarshal(ctx, bytes, ldr);
}

...

if (valBytes == null)
	valBytes = valueBytesFromValue(ctx);

...

if (val == null) 
    val = valueFromValueBytes(ctx, ldr);

BinaryObjects

BinaryObject(Impl)s have the different structure:

Code Block
languagejava
titleBinaryObjectImpl
private byte[] arr;
private Object obj;


Risks and Assumptions

Transformation requires additional memory allocation and subsequent GC work.

...