Examples of XLogFilter


Examples of org.apache.oozie.util.XLogFilter

        setLogFile();
        String logLevel = XLogUserFilterParam.LOG_LEVEL + "=ERROR";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { logLevel });

        XLogFilter xf = new XLogFilter(new XLogUserFilterParam(paramMap));
        String out = doStreamLog(xf);
        int count = 0;
        for (String line : out.split(System.getProperty("line.separator"))) {
            assertFalse(line.contains("DEBUG"));
            assertFalse(line.contains("INFO"));
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        setLogFile();

        String logLevel = XLogUserFilterParam.LOG_LEVEL + "=DEBUG|INFO";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { logLevel });
        XLogFilter xf = new XLogFilter(new XLogUserFilterParam(paramMap));
        String out = doStreamLog(xf);

        String lines[] = out.split(System.getProperty("line.separator"));

        assertEquals(lines.length, 4);
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        setLogFile();
        String logLevel = XLogUserFilterParam.LOG_LEVEL + "=ERROR;" + XLogUserFilterParam.LIMIT + "=1";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { logLevel });

        XLogFilter xf = new XLogFilter(new XLogUserFilterParam(paramMap));
        String out = doStreamLog(xf);
        String lines[] = out.split(System.getProperty("line.separator"));

        assertEquals(lines.length, 1);
    }
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        setLogFile();

        String logLevel = XLogUserFilterParam.LIMIT + "=1";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { logLevel });
        XLogFilter xf = new XLogFilter(new XLogUserFilterParam(paramMap));
        String out = doStreamLog(xf);
        String lines[] = out.split(System.getProperty("line.separator"));

        assertEquals(lines.length, 1);
    }
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

    }

    // Test text search
    public void testTextSearch() throws Exception {
        setLogFile();
        XLogFilter filter = new XLogFilter();

        String param = XLogUserFilterParam.SEARCH_TEXT + "=substitution;" + XLogUserFilterParam.LIMIT + "=2";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });

        XLogUserFilterParam logUtil = new XLogUserFilterParam(paramMap);
        filter.setUserLogFilter(logUtil);
        String out = doStreamLog(filter);
        String lines[] = out.split(System.getProperty("line.separator"));
        assertEquals(lines.length, 2);

        assertTrue(lines[0].contains("E0803: IO error, Variable substitution depth too large: 20 ${dniInputDir}"));
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        setLogFile();
        String param = XLogUserFilterParam.SEARCH_TEXT + "=substitution;" + XLogUserFilterParam.LOG_LEVEL + "=DEBUG";
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });

        XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
        String out = doStreamLog(filter);
        String lines[] = out.split(System.getProperty("line.separator"));
        assertEquals(lines.length, 1);

        assertTrue(lines[0]
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        new Services().init();
        Services.get().getConf().setInt(XLogFilter.MAX_SCAN_DURATION, 10);
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] {});
        XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
        Date startDate = new Date();
        Date endDate = new Date(startDate.getTime() + 60 * 60 * 1000 * 11);

        try {
            doStreamLog(filter, startDate, endDate);
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        Services.get().getConf().setInt(XLogFilter.MAX_SCAN_DURATION, 10);
        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        String param = XLogUserFilterParam.RECENT_LOG_OFFSET + "=9";

        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });
        XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
        Date startDate = new Date();
        Date endDate = new Date(startDate.getTime() + 60 * 60 * 1000 * 15);

        try {
            doStreamLog(filter, startDate, endDate);
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        XLogFilter.reset();

        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        String param = "start=14-02-20 02:06:25,499;end=14-02-27 02:06:47,550;debug;loglevel=ERROR|WARN;recent=3m";
        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });
        XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
        // Param date will be overwritten by user param
        String out = doStreamLog(filter, new Date(), new Date());
        assertEquals(out.split(System.getProperty("line.separator")).length, 1);
        assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log start time = Tue Feb 27 02:03:47"));
        assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log end time = Tue Feb 27 02:06:47"));
View Full Code Here

Examples of org.apache.oozie.util.XLogFilter

        Map<String, String[]> paramMap = new HashMap<String, String[]>();
        String param = "start=14-02-20 02:06:25,499;end=3m;debug";

        paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });

        XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
        // Param date will be overwritten by user param
        String out = doStreamLog(filter, dt.parse("14-02-20 02:06:25,499"), new Date());
        assertEquals(out.split(System.getProperty("line.separator")).length, 1);
        assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log start time = Tue Feb 20 02:06:25"));
        assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log end time = Tue Feb 20 02:11:25"));
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.