static Message makeVerb(TreeRequest request, int version) { try { FastByteArrayOutputStream bos = new FastByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(bos); SERIALIZER.serialize(request, dos, version); return new Message( FBUtilities.getBroadcastAddress(), StorageService.Verb.TREE_REQUEST, bos.toByteArray(), version); } catch (IOException e) { throw new RuntimeException(e); } }
static Message makeVerb(InetAddress local, Validator validator) { try { FastByteArrayOutputStream bos = new FastByteArrayOutputStream(); 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); } }