Examples of XLogStreamer


Examples of org.apache.oozie.util.XLogStreamer

            for (ServiceInstance<Map> oozie : oozies) {
                Map<String, String> oozieMeta = oozie.getPayload();
                String otherId = oozieMeta.get(ZKUtils.ZKMetadataKeys.OOZIE_ID);
                // If it's this server, we can just get them directly
                if (otherId.equals(zk.getZKId())) {
                    BufferedReader reader = new XLogStreamer(filter, xLogService.getOozieLogPath(), xLogService.getOozieLogName(),
                                                             xLogService.getOozieLogRotation()).makeReader(startTime, endTime);
                    parsers.add(new TimestampedMessageParser(reader, filter));
                }
                // If it's another server, we'll have to use the REST API
                else {
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer

        gzout.write(buf, 0, buf.length);
        gzout.finish();
        gzout.close();

        StringWriter sw = new StringWriter();
        XLogStreamer str = new XLogStreamer(xf, sw, getTestCaseDir(), "oozie.log", 1);
        str.streamLog(new Date(currTime - 10000), new Date(currTime - 5000));
        String[] out = sw.toString().split("\n");
        assertEquals(5, out.length);
        assertEquals(true, out[0].contains("_L8_"));
        assertEquals(true, out[1].contains("_L9_"));
        assertEquals(true, out[2].contains("_L1_"));
        assertEquals(true, out[3].contains("_L2_"));
        assertEquals(true, out[4].contains("_L4_"));

        StringWriter sw1 = new StringWriter();
        XLogStreamer str1 = new XLogStreamer(xf, sw1, getTestCaseDir(), "oozie.log", 1);
        str1.streamLog(null, null);
        out = sw1.toString().split("\n");
        assertEquals(6, out.length);
        assertEquals(true, out[0].contains("_L8_"));
        assertEquals(true, out[1].contains("_L9_"));
        assertEquals(true, out[2].contains("_L1_"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.