Ejemplo n.º 1
0
 public Message getMessage() {
   DataOutputBuffer dob = new DataOutputBuffer();
   try {
     serializer.serialize(this, dob);
   } catch (IOException e) {
     throw new IOError(e);
   }
   return new Message(
       FBUtilities.getLocalAddress(),
       StorageService.Verb.INDEX_SCAN,
       Arrays.copyOf(dob.getData(), dob.getLength()));
 }
Ejemplo n.º 2
0
 public static IndexScanCommand read(Message message) throws IOException {
   byte[] bytes = message.getMessageBody();
   FastByteArrayInputStream bis = new FastByteArrayInputStream(bytes);
   return serializer.deserialize(new DataInputStream(bis), message.getVersion());
 }