Examples of YaessJobId


Examples of com.asakusafw.yaess.tools.log.YaessJobId

            try {
                Map<YaessJobId, List<String>> results = new HashMap<YaessJobId, List<String>>();
                assertThat("skip header", reader.next(), is(true));
                while (reader.next()) {
                    List<String> record = reader.get();
                    YaessJobId id = new YaessJobId();
                    id.setBatchId(record.get(0));
                    id.setFlowId(record.get(1));
                    id.setExecutionId(record.get(2));
                    id.setPhase(record.get(3));
                    id.setServiceId(record.get(4));
                    id.setJobId(record.get(5));
                    id.setTrackingId(record.get(6));
                    assertThat(results.get(id), is(nullValue()));
                    results.put(id, new ArrayList<String>(record.subList(7, record.size())));
                }
                return results;
            } finally {
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    /**
     * Simple test case.
     */
    @Test
    public void simple() {
        YaessJobId id1 = provider.copy();
        append(0, "YS-CORE-I00000", id1);
        append(100, "YS-CORE-I00999", id1);

        Map<YaessJobId, List<String>> results = summarize(Filter.THROUGH);
        assertThat(results.size(), is(1));
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

     * Multiple records.
     */
    @Test
    public void multiple() {
        provider.id().setJobId("j1");
        YaessJobId id1 = provider.copy();
        append(10000, "YS-CORE-I00000", id1);
        append(10001, "YS-CORE-I00001", id1);
        append(10100, "YS-CORE-I00999", id1);

        provider.id().setJobId("j2");
        YaessJobId id2 = provider.copy();
        append(11000, "YS-CORE-I00000", id2);
        append(11001, "YS-CORE-W00001", id2);
        append(11200, "YS-CORE-I00999", id2);

        provider.id().setJobId("j3");
        YaessJobId id3 = provider.copy();
        append(12000, "YS-CORE-I00000", id3);
        append(12001, "YS-CORE-E00001", id3);
        append(12300, "YS-CORE-I00999", id3);

        Map<YaessJobId, List<String>> results = summarize(Filter.THROUGH);
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    /**
     * w/ filter.
     */
    @Test
    public void filtered() {
        YaessJobId id1 = provider.copy();
        append(0, "YS-CORE-I00000", id1);
        append(100, "YS-CORE-I00999", id1);
        append(500, "YS-UNKNOWN-I00000", id1);

        Map<YaessJobId, List<String>> results = summarize(new LogCodeRegexFilter(Pattern.compile("YS-CORE-.*")));
 
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

        if (lines.isEmpty() == false) {
            // ignore header
            lines = lines.subList(1, lines.size());
        }
        for (List<String> record : lines) {
            YaessJobId id = new YaessJobId();
            id.setBatchId(record.get(0));
            id.setFlowId(record.get(1));
            id.setExecutionId(record.get(2));
            id.setPhase(record.get(3));
            id.setServiceId(record.get(4));
            id.setJobId(record.get(5));
            id.setTrackingId(record.get(6));
            assertThat(results.get(id), is(nullValue()));
            results.put(id, new ArrayList<String>(record.subList(7, record.size())));
        }
        return results;
    }
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    /**
     * Creates a {@link YaessJobId}.
     * @return a job ID
     */
    protected YaessJobId createId() {
        return new YaessJobId();
    }
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    /**
     * Returns a copy of the original ID.
     * @return a copy
     */
    public YaessJobId copy() {
        YaessJobId copy = new YaessJobId();
        copy.setBatchId(id().getBatchId());
        copy.setFlowId(id().getFlowId());
        copy.setJobId(id().getJobId());
        copy.setPhase(id().getPhase());
        copy.setExecutionId(id().getExecutionId());
        copy.setServiceId(id().getServiceId());
        copy.setTrackingId(id().getTrackingId());
        return copy;
    }
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

        String code = extractCode(line);
        if (code == null) {
            LOG.debug("Not a YAESS job log: {}", line);
            return null;
        }
        YaessJobId id = extractId(line);
        if (id == null) {
            LOG.debug("Failed to extract job ID: {}", line);
            return null;
        }
        long time = extractTime(line);
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    private YaessJobId extractId(String line) {
        Map<String, String> fields = extractFields(line);
        if (fields.isEmpty()) {
            return null;
        }
        YaessJobId id = new YaessJobId();
        id.setBatchId(fields.get(KEY_BATCH_ID));
        id.setFlowId(fields.get(KEY_FLOW_ID));
        id.setExecutionId(fields.get(KEY_EXECUTION_ID));
        id.setPhase(fields.get(KEY_PHASE));
        id.setJobId(fields.get(KEY_JOB_ID));
        id.setServiceId(fields.get(KEY_SERVICE_ID));
        id.setTrackingId(fields.get(KEY_TRACKING_ID));
        return id;
    }
View Full Code Here

Examples of com.asakusafw.yaess.tools.log.YaessJobId

    /**
     * Simple scenario.
     */
    @Test
    public void simple() {
        YaessJobId id1 = provider.copy();
        append(0, "YS-CORE-I00000", id1);
        append(100, "YS-CORE-I00999", id1);

        Map<YaessJobId, List<String>> results = summarize("YS-CORE-.*");
        assertThat(results.size(), is(1));
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.