public void serialize(TreeRequest request, DataOutput dos, int version) throws IOException { dos.writeUTF(request.sessionid); CompactEndpointSerializationHelper.serialize(request.endpoint, dos); dos.writeUTF(request.cf.left); dos.writeUTF(request.cf.right); if (version > MessagingService.VERSION_07) AbstractBounds.serializer().serialize(request.range, dos, version); }
public void writeTo(DataOutput out) throws Exception { out.writeByte(type.ordinal()); // We can't use Util.writeObject since it's size is limited to 2^15-1 try { if (object instanceof Streamable) { out.writeShort(-1); Util.writeGenericStreamable((Streamable) object, out); } else { byte[] bytes = Util.objectToByteBuffer(object); out.writeInt(bytes.length); out.write(bytes); } } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException("Exception encountered while serializing execution request", e); } out.writeLong(request); }
@Override public void writeTo(DataOutput out) throws Exception { super.writeTo(out); out.writeLong(threadId); }