org.apache.kafka.common.network
Interface Receive

All Known Implementing Classes:
ByteBufferReceive, NetworkReceive

public interface Receive

This interface models the in-progress reading of data from a channel to a source identified by an integer id


Method Summary
 boolean complete()
          Are we done receiving data?
 long readFrom(java.nio.channels.ScatteringByteChannel channel)
          Read bytes into this receive from the given channel
 java.nio.ByteBuffer[] reify()
          Turn this receive into ByteBuffer instances, if possible (otherwise returns null).
 int source()
          The numeric id of the source from which we are receiving data.
 

Method Detail

source

int source()
The numeric id of the source from which we are receiving data.


complete

boolean complete()
Are we done receiving data?


reify

java.nio.ByteBuffer[] reify()
Turn this receive into ByteBuffer instances, if possible (otherwise returns null).


readFrom

long readFrom(java.nio.channels.ScatteringByteChannel channel)
              throws java.io.IOException
Read bytes into this receive from the given channel

Parameters:
channel - The channel to read from
Returns:
The number of bytes read
Throws:
java.io.IOException - If the reading fails