public void serialize(TreeRequest request, DataOutputStream 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);
 }
示例#2
0
 private void sendRequest(long objectId, long requestId, Request r) throws IOException {
   DataOutputStream out = newFlusher();
   out.writeByte(REQUEST);
   out.writeLong(objectId);
   out.writeLong(requestId);
   r.serialize(out);
   out.writeBoolean(false);
   out.flush();
 }
示例#3
0
 private void sendResponse(long requestId, Object value, Class<?> declaredType)
     throws IOException {
   DataOutputStream out = newFlusher();
   out.writeByte(RESPONSE);
   out.writeLong(requestId);
   if (value == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     Class<?> clazz = value.getClass();
     out.writeUTF(clazz.getName());
     Serializer<Object> s = serializerFor(clazz, declaredType);
     s.serialize(out, value);
   }
   out.writeBoolean(false);
   out.flush();
 }
 public void serialize(Validator v, DataOutputStream dos, int version) throws IOException {
   TreeRequestVerbHandler.SERIALIZER.serialize(v.request, dos, version);
   MerkleTree.serializer.serialize(v.tree, dos, version);
   dos.flush();
 }