com.twitter.common.logging
Class ScribeLog

java.lang.Object
  extended by com.twitter.common.logging.ScribeLog
All Implemented Interfaces:
Log<LogEntry,ResultCode>

public class ScribeLog
extends Object
implements Log<LogEntry,ResultCode>

Implementation of the scribe client, logs message directly to scribe.


Field Summary
static Predicate<ResultCode> RETRY_FILTER
           
 
Constructor Summary
ScribeLog(List<InetSocketAddress> hosts)
          Creats a new scribe client, connecting to the given hosts on the given port.
 
Method Summary
 void flush()
          Flushes the log, attempting to purge any state that is only stored locally.
 ResultCode log(List<LogEntry> entries)
          Submits a log message.
 ResultCode log(LogEntry entry)
          Submits a log message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRY_FILTER

public static final Predicate<ResultCode> RETRY_FILTER
Constructor Detail

ScribeLog

public ScribeLog(List<InetSocketAddress> hosts)
          throws ThriftFactory.ThriftFactoryException
Creats a new scribe client, connecting to the given hosts on the given port.

Parameters:
hosts - Thrift servers to connect to.
Throws:
ThriftFactory.ThriftFactoryException - If the client could not be created.
Method Detail

log

public ResultCode log(LogEntry entry)
Description copied from interface: Log
Submits a log message.

Specified by:
log in interface Log<LogEntry,ResultCode>
Parameters:
entry - Entry to log.
Returns:
The result of the log request.

log

public ResultCode log(List<LogEntry> entries)
Description copied from interface: Log
Submits a log message.

Specified by:
log in interface Log<LogEntry,ResultCode>
Parameters:
entries - Entry to log.
Returns:
The result of the log request.

flush

public void flush()
Description copied from interface: Log
Flushes the log, attempting to purge any state that is only stored locally.

Specified by:
flush in interface Log<LogEntry,ResultCode>