public class XLogStreamer extends Object
Modifier and Type | Class and Description |
---|---|
class |
XLogStreamer.FileInfo
File along with the modified time which will be used to sort later.
|
Modifier and Type | Field and Description |
---|---|
protected int |
bufferLen |
protected static String |
CONF_PREFIX |
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
|
protected XLogFilter |
logFilter |
static String |
STREAM_BUFFER_LEN |
protected int |
totalDataWritten |
Constructor and Description |
---|
XLogStreamer(Map<String,String[]> params) |
XLogStreamer(XLogFilter logFilter) |
XLogStreamer(XLogFilter logFilter,
Map<String,String[]> params) |
XLogStreamer(XLogFilter logFilter,
String logPath,
String logFile,
long logRotationSecs) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateAndValidateDateRange(Date startTime,
Date endTime) |
int |
getBufferLen() |
String |
getLogDisableMessage() |
String |
getLogType() |
Map<String,String[]> |
getRequestParam() |
XLogFilter |
getXLogFilter() |
boolean |
isLogEnabled() |
BufferedReader |
makeReader(Date startTime,
Date endTime) |
boolean |
shouldFlushOutput(int writtenBytes) |
void |
streamLog(Writer writer,
Date startTime,
Date endTime)
Gets the files that are modified between startTime and endTime in the given logPath and streams the log after
applying the filters.
|
void |
streamLog(Writer writer,
Date startTime,
Date endTime,
boolean appendDebug)
Gets the files that are modified between startTime and endTime in the given logPath and streams the log after
applying the filters
|
protected static final String CONF_PREFIX
public static final String STREAM_BUFFER_LEN
protected XLogFilter logFilter
protected int totalDataWritten
protected int bufferLen
public static final Pattern gzTimePattern
public XLogStreamer(XLogFilter logFilter, String logPath, String logFile, long logRotationSecs)
public XLogStreamer(XLogFilter logFilter)
public XLogStreamer(XLogFilter logFilter, Map<String,String[]> params)
public XLogStreamer(Map<String,String[]> params) throws CommandException
CommandException
public void streamLog(Writer writer, Date startTime, Date endTime) throws IOException
writer
- the target writerstartTime
- the start timeendTime
- the end timeIOException
- Signals that an I/O exception has occurred.public void streamLog(Writer writer, Date startTime, Date endTime, boolean appendDebug) throws IOException
writer
- the writerstartTime
- the start timeendTime
- the end timeappendDebug
- the append debugIOException
- Signals that an I/O exception has occurred.protected void calculateAndValidateDateRange(Date startTime, Date endTime) throws IOException
IOException
public BufferedReader makeReader(Date startTime, Date endTime) throws IOException
IOException
public boolean isLogEnabled()
public String getLogType()
public XLogFilter getXLogFilter()
public String getLogDisableMessage()
public Map<String,String[]> getRequestParam()
public boolean shouldFlushOutput(int writtenBytes)
public int getBufferLen()
Copyright © 2018 Apache Software Foundation. All rights reserved.