com.netflix.suro.sink.kafka
Class KafkaSink

java.lang.Object
  extended by java.lang.Thread
      extended by com.netflix.suro.sink.QueuedSink
          extended by com.netflix.suro.sink.kafka.KafkaSink
All Implemented Interfaces:
com.netflix.suro.sink.Sink, java.lang.Runnable

public class KafkaSink
extends com.netflix.suro.sink.QueuedSink
implements com.netflix.suro.sink.Sink

Kafka 0.8 Sink


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  long msgId
           
protected  com.netflix.suro.sink.kafka.KafkaProducer producer
           
static java.lang.String TYPE
           
 
Fields inherited from class com.netflix.suro.sink.QueuedSink
isRunning, queue4Sink
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
KafkaSink(com.netflix.suro.queue.MessageQueue4Sink queue4Sink, java.lang.String clientId, java.lang.String brokerList, java.lang.String codec, int sendBufferBytes, int batchSize, int batchTimeout, int requestTimeout, java.lang.Integer acks, int maxRetries, int retryBackoff, java.util.Properties metricsProps)
           
 
Method Summary
protected  void beforePolling()
           
 java.lang.String getStat()
           
protected  void innerClose()
           
 void open()
           
 java.lang.String recvNotice()
           
protected  void send(java.util.List<com.netflix.suro.message.Message> msgList)
           
protected  void write(java.util.List<com.netflix.suro.message.Message> msgList)
           
 void writeTo(com.netflix.suro.message.MessageContainer message)
           
 
Methods inherited from class com.netflix.suro.sink.QueuedSink
close, getQueueSize, initialize, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.netflix.suro.sink.Sink
close
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

producer

protected final com.netflix.suro.sink.kafka.KafkaProducer producer

msgId

protected long msgId
Constructor Detail

KafkaSink

public KafkaSink(com.netflix.suro.queue.MessageQueue4Sink queue4Sink,
                 java.lang.String clientId,
                 java.lang.String brokerList,
                 java.lang.String codec,
                 int sendBufferBytes,
                 int batchSize,
                 int batchTimeout,
                 int requestTimeout,
                 java.lang.Integer acks,
                 int maxRetries,
                 int retryBackoff,
                 java.util.Properties metricsProps)
Method Detail

writeTo

public void writeTo(com.netflix.suro.message.MessageContainer message)
Specified by:
writeTo in interface com.netflix.suro.sink.Sink

open

public void open()
Specified by:
open in interface com.netflix.suro.sink.Sink

beforePolling

protected void beforePolling()
                      throws java.io.IOException
Specified by:
beforePolling in class com.netflix.suro.sink.QueuedSink
Throws:
java.io.IOException

write

protected void write(java.util.List<com.netflix.suro.message.Message> msgList)
              throws java.io.IOException
Specified by:
write in class com.netflix.suro.sink.QueuedSink
Throws:
java.io.IOException

innerClose

protected void innerClose()
                   throws java.io.IOException
Specified by:
innerClose in class com.netflix.suro.sink.QueuedSink
Throws:
java.io.IOException

recvNotice

public java.lang.String recvNotice()
Specified by:
recvNotice in interface com.netflix.suro.sink.Sink

getStat

public java.lang.String getStat()
Specified by:
getStat in interface com.netflix.suro.sink.Sink

send

protected void send(java.util.List<com.netflix.suro.message.Message> msgList)