Search in sources :

Example 1 with Header

use of org.apache.cassandra.net.Header in project eiger by wlloyd.

the class FileStreamTask method receiveReply.

private void receiveReply() throws IOException {
    MessagingService.validateMagic(input.readInt());
    int msheader = input.readInt();
    assert MessagingService.getBits(msheader, 3, 1) == 0 : "Stream received before stream reply";
    int version = MessagingService.getBits(msheader, 15, 8);
    // Read total size
    input.readInt();
    String id = input.readUTF();
    Header header = Header.serializer().deserialize(input, version);
    int bodySize = input.readInt();
    byte[] body = new byte[bodySize];
    input.readFully(body);
    Message message = new Message(header, body, version);
    assert message.getVerb() == StorageService.Verb.STREAM_REPLY : "Non-reply message received on stream socket";
    handler.doVerb(message, id);
}
Also used : Header(org.apache.cassandra.net.Header) Message(org.apache.cassandra.net.Message)

Aggregations

Header (org.apache.cassandra.net.Header)1 Message (org.apache.cassandra.net.Message)1