public static Object deserialize(byte[] blob) throws IOException, ClassNotFoundException { return deserialize(blob, false); }
public static Object deserialize(byte[] blob) throws IOException, ClassNotFoundException { return deserialize(blob, false); }
public Object getObject(boolean unzip) throws IOException, ClassNotFoundException { if (isBytes()) { return this.part; } else { if (this.version != null) { return CacheServerHelper.deserialize((byte[])this.part, this.version, unzip); } else { return CacheServerHelper.deserialize((byte[])this.part, unzip); } } } public Object getObject() throws IOException, ClassNotFoundException {
public Object getObject(boolean unzip) throws IOException, ClassNotFoundException { if (isBytes()) { return this.part; } else { return CacheServerHelper.deserialize((byte[])this.part, unzip); } } public Object getObject() throws IOException, ClassNotFoundException {
public Object getValue() { if(isDeserialized || value == null) { return value; } try { value = CacheServerHelper.deserialize((byte[])value); } catch(IOException ioe) { throw new RuntimeException(LocalizedStrings.InterestEvent_IOEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), ioe); } catch(ClassNotFoundException cnfe) { throw new RuntimeException(LocalizedStrings.InterestEvent_CLASSNOTFOUNDEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), cnfe); } isDeserialized = true; return value; }
public Object getValue() { if(isDeserialized || value == null) { return value; } try { value = CacheServerHelper.deserialize((byte[])value); } catch(IOException ioe) { throw new RuntimeException(LocalizedStrings.InterestEvent_IOEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), ioe); } catch(ClassNotFoundException cnfe) { throw new RuntimeException(LocalizedStrings.InterestEvent_CLASSNOTFOUNDEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), cnfe); } isDeserialized = true; return value; }
public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.hasKeys = in.readBoolean(); if (this.hasKeys) { this.keys = new ArrayList(); } int numObjects = in.readInt(); if (numObjects > 0) { for (int index = 0; index < numObjects; ++index) { if (this.hasKeys) { Object key = DataSerializer.readObject(in); this.keys.add(key); } boolean isException = in.readBoolean(); Object value; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); } } }
public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.hasKeys = in.readBoolean(); if (this.hasKeys) { this.keys = new ArrayList(); } int numObjects = in.readInt(); if (numObjects > 0) { for (int index = 0; index < numObjects; ++index) { if (this.hasKeys) { Object key = DataSerializer.readObject(in); this.keys.add(key); } boolean isException = in.readBoolean(); Object value; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); } } }
if (objectType==EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes);
if (objectType==EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes);
if (objectType==EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes);
if (objectType==EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes);
private void readObject(int index, DataInput in) throws IOException, ClassNotFoundException { Object value; this.objectTypeArray[index] = in.readByte(); if (logger.isTraceEnabled(LogMarker.VERSIONED_OBJECT_LIST)) { logger.trace(LogMarker.VERSIONED_OBJECT_LIST, "reading object {} of type {}", index, objectTypeArray[index]); } boolean isException = this.objectTypeArray[index] == EXCEPTION; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else if (this.serializeValues) { value = DataSerializer.readByteArray(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); }
private void readObject(int index, DataInput in, LogWriterI18n log) throws IOException, ClassNotFoundException { Object value; this.objectTypeArray[index] = in.readByte(); if (DEBUG) { log.info(LocalizedStrings.DEBUG, "reading object " + index + " of type " + objectTypeArray[index]); } boolean isException = this.objectTypeArray[index] == EXCEPTION; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else if (this.serializeValues) { value = DataSerializer.readByteArray(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); }
iter.next(); currentkeyStartPos = cursorPos; currentKey = ((String)CacheServerHelper.deserialize(iter.getKey())); cursorPos = (int)iter.getPosition(); if (iter.syncSeen()){
for (int i = 0; i < noOfParts - 1; i = i + 3) { instantiatorClassName = (String) CacheServerHelper .deserialize(msg.getPart(i).getSerializedForm()); String instantiatedClassName = (String) CacheServerHelper .deserialize(msg.getPart(i + 1).getSerializedForm()); int id = msg.getPart(i + 2).getInt(); InternalInstantiator.register(instantiatorClassName, instantiatedClassName, id,
try { String dataSerializerClassName = (String) CacheServerHelper .deserialize(msg.getPart(i).getSerializedForm()); int id = msg.getPart(i + 1).getInt(); InternalDataSerializer.register(dataSerializerClassName, false, eventId, null/* context */, id); int j = 0; for (; j < numOfClasses; j++) { String className = (String)CacheServerHelper.deserialize(msg .getPart(i + 3 + j).getSerializedForm()); InternalDataSerializer.updateSupportedClassesMap(
public void readSequenceFile(FileSystem inputFS, Path sequenceFileName, HashMap<String, String> entriesMap) throws IOException { SequenceFileHoplog hoplog = new SequenceFileHoplog(inputFS, sequenceFileName, null); HoplogIterator<byte[], byte[]> iter = hoplog.getReader().scan(); try { while (iter.hasNext()) { iter.next(); PersistedEventImpl te = UnsortedHoplogPersistedEvent.fromBytes(iter.getValue()); String stringkey = ((String)CacheServerHelper.deserialize(iter.getKey())); String value = (String) te.getDeserializedValue(); entriesMap.put(value, stringkey); if (getCache().getLoggerI18n().fineEnabled()) getCache().getLoggerI18n().fine("Key: " + stringkey + " value: " + value + " path " + sequenceFileName.getName()); } } catch (Exception e) { assertTrue(e.toString(), false); } iter.close(); hoplog.close(); } });
iter.next(); PersistedEventImpl te = UnsortedHoplogPersistedEvent.fromBytes(iter.getValue()); String stringkey = ((String)CacheServerHelper.deserialize(iter.getKey())); assertTrue("Expected key: key-" + index + ". Actual key: " + stringkey , ((String)stringkey).equals("key-" + index)); index++;
iter.next(); PersistedEventImpl te = UnsortedHoplogPersistedEvent.fromBytes((iter.getValue())); String stringkey = ((String)CacheServerHelper.deserialize(iter.getKey()));