org.apache.kafka.clients.producer.internals
Class Sender

java.lang.Object
  extended by org.apache.kafka.clients.producer.internals.Sender
All Implemented Interfaces:
java.lang.Runnable

public class Sender
extends java.lang.Object
implements java.lang.Runnable

The background thread that handles the sending of produce requests to the Kafka cluster. This thread makes metadata requests to renew its view of the cluster and then sends produce requests to the appropriate nodes.


Constructor Summary
Sender(KafkaClient client, Metadata metadata, RecordAccumulator accumulator, int maxRequestSize, short acks, int retries, int requestTimeout, Metrics metrics, Time time)
           
 
Method Summary
 void initiateClose()
          Start closing the sender (won't actually complete until all data is sent out)
 void run()
          The main run loop for the sender thread
 void run(long now)
          Run a single iteration of sending
 void wakeup()
          Wake up the selector associated with this send thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sender

public Sender(KafkaClient client,
              Metadata metadata,
              RecordAccumulator accumulator,
              int maxRequestSize,
              short acks,
              int retries,
              int requestTimeout,
              Metrics metrics,
              Time time)
Method Detail

run

public void run()
The main run loop for the sender thread

Specified by:
run in interface java.lang.Runnable

run

public void run(long now)
Run a single iteration of sending

Parameters:
now - The current POSIX time in milliseconds

initiateClose

public void initiateClose()
Start closing the sender (won't actually complete until all data is sent out)


wakeup

public void wakeup()
Wake up the selector associated with this send thread