コード例 #1
0
 static Message makeVerb(TreeRequest request, int version) {
   try {
     ByteArrayOutputStream bos = new ByteArrayOutputStream();
     DataOutputStream dos = new DataOutputStream(bos);
     SERIALIZER.serialize(request, dos, version);
     return new Message(
         FBUtilities.getLocalAddress(),
         StorageService.Verb.TREE_REQUEST,
         bos.toByteArray(),
         version);
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #2
0
 static Message makeVerb(InetAddress local, Validator validator) {
   try {
     ByteArrayOutputStream bos = new ByteArrayOutputStream();
     DataOutputStream dos = new DataOutputStream(bos);
     SERIALIZER.serialize(
         validator, dos, Gossiper.instance.getVersion(validator.request.endpoint));
     return new Message(
         local,
         StorageService.Verb.TREE_RESPONSE,
         bos.toByteArray(),
         Gossiper.instance.getVersion(validator.request.endpoint));
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }