use of org.apache.oozie.util.XLogErrorStreamer in project oozie by apache.
the class TestZKXLogStreamingService method doStreamLog.
protected String doStreamLog(XLogFilter xf, Map<String, String[]> param, boolean isErrorLog, Date startTime, Date endTime) throws Exception {
StringWriter w = new StringWriter();
ZKXLogStreamingService zkxlss = new ZKXLogStreamingService();
try {
Services services = Services.get();
services.setService(ZKJobsConcurrencyService.class);
zkxlss.init(services);
// Sleep to allow ZKUtils ServiceCache to update
sleep(1000);
if (isErrorLog) {
zkxlss.streamLog(new XLogErrorStreamer(xf, param), startTime, endTime, w);
} else {
zkxlss.streamLog(new XLogStreamer(xf, param), startTime, endTime, w);
}
} finally {
zkxlss.destroy();
}
String wStr = w.toString();
System.out.println("\ndoStreamLog:\n" + wStr + "\n");
return wStr;
}
Aggregations