org.apache.oozie.service
Class ZKXLogStreamingService

java.lang.Object
  extended by org.apache.oozie.service.XLogStreamingService
      extended by org.apache.oozie.service.ZKXLogStreamingService
All Implemented Interfaces:
Service, Instrumentable

public class ZKXLogStreamingService
extends XLogStreamingService
implements Service, Instrumentable

Service that performs streaming of log files over Web Services if enabled in XLogService and collates logs from other Oozie servers. Requires that a ZooKeeper ensemble is available.


Field Summary
 
Fields inherited from class org.apache.oozie.service.XLogStreamingService
bufferLen, STREAM_BUFFER_LEN
 
Fields inherited from interface org.apache.oozie.service.Service
CONF_PREFIX, DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
ZKXLogStreamingService()
           
 
Method Summary
 void destroy()
          Destroy the log streaming service.
 void init(Services services)
          Initialize the log streaming service.
 void instrument(Instrumentation instr)
          Instruments the log streaming service.
 void streamLog(XLogFilter filter, Date startTime, Date endTime, Writer writer, Map<String,String[]> params)
          Stream the log of a job.
 
Methods inherited from class org.apache.oozie.service.XLogStreamingService
getBufferLen, getInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.oozie.service.Service
getInterface
 

Constructor Detail

ZKXLogStreamingService

public ZKXLogStreamingService()
Method Detail

init

public void init(Services services)
          throws ServiceException
Initialize the log streaming service.

Specified by:
init in interface Service
Overrides:
init in class XLogStreamingService
Parameters:
services - services instance.
Throws:
ServiceException - thrown if the log streaming service could not be initialized.

destroy

public void destroy()
Destroy the log streaming service.

Specified by:
destroy in interface Service
Overrides:
destroy in class XLogStreamingService

instrument

public void instrument(Instrumentation instr)
Instruments the log streaming service.

Specified by:
instrument in interface Instrumentable
Overrides:
instrument in class XLogStreamingService
Parameters:
instr - instrumentation to use.

streamLog

public void streamLog(XLogFilter filter,
                      Date startTime,
                      Date endTime,
                      Writer writer,
                      Map<String,String[]> params)
               throws IOException
Stream the log of a job. It contacts any other running Oozie servers to collate relevant logs while streaming.

Overrides:
streamLog in class XLogStreamingService
Parameters:
filter - log streamer filter.
startTime - start time for log events to filter.
endTime - end time for log events to filter.
writer - writer to stream the log to.
params - additional parameters from the request
Throws:
IOException - thrown if the log cannot be streamed.


Copyright © 2015 Apache Software Foundation. All Rights Reserved.