org.apache.oozie.util
Class XLogStreamer

java.lang.Object
  extended by org.apache.oozie.util.XLogStreamer

public class XLogStreamer
extends Object

XLogStreamer streams the given log file to writer after applying the given filter.


Nested Class Summary
 class XLogStreamer.FileInfo
          File along with the modified time which will be used to sort later.
 
Field Summary
static Pattern gzTimePattern
          This pattern matches the end of a gzip filename to have a format like "-YYYY-MM-dd-HH.gz" with capturing groups for each part of the date
 
Constructor Summary
XLogStreamer(XLogFilter logFilter, String logPath, String logFile, long logRotationSecs)
           
 
Method Summary
 BufferedReader makeReader(Date startTime, Date endTime)
           
 void streamLog(Writer writer, Date startTime, Date endTime, int bufferLen)
          Gets the files that are modified between startTime and endTime in the given logPath and streams the log after applying the filters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gzTimePattern

public static final Pattern gzTimePattern
This pattern matches the end of a gzip filename to have a format like "-YYYY-MM-dd-HH.gz" with capturing groups for each part of the date

Constructor Detail

XLogStreamer

public XLogStreamer(XLogFilter logFilter,
                    String logPath,
                    String logFile,
                    long logRotationSecs)
Method Detail

streamLog

public void streamLog(Writer writer,
                      Date startTime,
                      Date endTime,
                      int bufferLen)
               throws IOException
Gets the files that are modified between startTime and endTime in the given logPath and streams the log after applying the filters.

Parameters:
writer -
startTime -
endTime -
Throws:
IOException

makeReader

public BufferedReader makeReader(Date startTime,
                                 Date endTime)
                          throws IOException
Throws:
IOException


Copyright © 2015 Apache Software Foundation. All Rights Reserved.