@Override protected byte[] getRawBytes() { // TODO:Asif: Optimize the serialization of byte[][], by identifying the // size of total bytes needed and avoiding using // EntryEventImpl which uses HeapDataOutput // we need to serialize the byte[][] return EntryEventImpl.serialize(this); }
@Override protected byte[] getRawBytes() { // TODO:Asif: Optimize the serialization of byte[][], by identifying the // size of total bytes needed and avoiding using // EntryEventImpl which uses HeapDataOutput // we need to serialize the byte[][] return EntryEventImpl.serialize(this); }
/** * Serialize an object into a <code>byte[]</code> * * @throws IllegalArgumentException * If <code>obj</code> should not be serialized */ public static byte[] serialize(Object obj) { return serialize(obj, (Version)null); }
/** * @param object */ public StoreAllCachedDeserializable(Object object) { this.objValue = object; this.value = EntryEventImpl.serialize(object); }
/** * Serialize an object into a <code>byte[]</code> * * @throws IllegalArgumentException * If <code>obj</code> should not be serialized */ public static byte[] serialize(Object obj) { return serialize(obj, null); }
@Override protected byte[] getRawBytes() { // TODO:Asif: Optimize the serialization of byte[][], by identifying the // size of total bytes needed and avoiding using // EntryEventImpl which uses HeapDataOutput // we need to serialize the byte[][] return EntryEventImpl.serialize(this); }
/** * Return the serialized value as a byte[] */ public byte[] getSerializedValue() { Object v = this.value; if (v instanceof byte[]) return (byte[])v; return EntryEventImpl.serialize(v); }
/** * Return the serialized value as a byte[] */ public byte[] getSerializedValue() { Object v = this.value; if (v instanceof byte[]) return (byte[])v; return EntryEventImpl.serialize(v); }
/** * @param object */ public StoreAllCachedDeserializable(Object object) { this.objValue = object; this.value = EntryEventImpl.serialize(object); }
public PreferBytesCachedDeserializable(Object object) { this.value = EntryEventImpl.serialize(object); }
private byte[] getBytes(Object o) { if(o instanceof byte[]) { return (byte[]) o; } if(o instanceof CachedDeserializable) { return ((CachedDeserializable) o).getSerializedValue(); } else { return EntryEventImpl.serialize(o); } }
private byte[] getBytes(Object o) { if(o instanceof byte[]) { return (byte[]) o; } if(o instanceof CachedDeserializable) { return ((CachedDeserializable) o).getSerializedValue(); } else { return EntryEventImpl.serialize(o); } }
static byte[] encodedAddressToBytes(long addr) { byte[] result = encodedAddressToBytes(addr, true); boolean isSerialized = (addr & SERIALIZED_BIT) != 0; if (!isSerialized) { result = EntryEventImpl.serialize(result); } return result; }
static byte[] decodeAddressToBytes(long addr) { byte[] result = decodeAddressToBytes(addr, true, false); boolean isSerialized = (addr & SERIALIZED_BIT) != 0; if (!isSerialized) { result = EntryEventImpl.serialize(result); } return result; }
@Override public byte[] getSerializedValue() { byte [] result = getRawBytes(); if (!isSerialized()) { // The object is a byte[]. So we need to make it look like a serialized byte[] in our result result = EntryEventImpl.serialize(result); } return result; }
@Override public void remove(Object indexKey, Object regionKey) { map.remove(new Pair(indexKey, EntryEventImpl.serialize(regionKey))); }
@Override public final byte[] getSerializedValue() { byte [] result = getRawBytes(); if (!isSerialized()) { // The object is a byte[]. So we need to make it look like a serialized byte[] in our result result = EntryEventImpl.serialize(result); } return result; }
@Override public void remove(Object indexKey, Object regionKey) { map.remove(new Pair(indexKey, EntryEventImpl.serialize(regionKey))); }
/** * Creates a new {@link CompressedCachedDeserializable} with an unserialized value. * @param obj a region entry value. */ public CompressedCachedDeserializable(final Object obj) { if (obj == null) throw new NullPointerException(LocalizedStrings.PreferBytesCachedDeserializable_VALUE_MUST_NOT_BE_NULL.toLocalizedString()); this.value = getCompressor().compress(EntryEventImpl.serialize(obj)); }
/** * Creates a new {@link CompressedCachedDeserializable} with an unserialized value. * @param obj a region entry value. */ public CompressedCachedDeserializable(final Object obj) { if (obj == null) throw new NullPointerException(LocalizedStrings.PreferBytesCachedDeserializable_VALUE_MUST_NOT_BE_NULL.toLocalizedString()); this.value = getCompressor().compress(EntryEventImpl.serialize(obj)); }