Package com.asakusafw.yaess.jobqueue.client

Examples of com.asakusafw.yaess.jobqueue.client.JobStatus


                    info.id);
            long start = System.currentTimeMillis();
            try {
                JobStatus.Kind lastKind = JobStatus.Kind.INITIALIZED;
                while (true) {
                    JobStatus status = poll(context, info);
                    JobStatus.Kind currentKind = status.getKind();
                    if (lastKind.compareTo(currentKind) < 0) {
                        // progressed
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("Job status was changed: {} -> {} ({})", new Object[] {
                                    lastKind,
View Full Code Here


     * @throws Exception if failed
     */
    @Test(expected = IOException.class)
    public void execute_fail() throws Exception {
        MockJobClient c1 = new MockJobClient("testing");
        JobStatus fail = new JobStatus();
        fail.setKind(COMPLETED);
        fail.setExitCode(1);
        c1.add(fail);

        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
View Full Code Here

        public MockJobClient(String id, JobStatus.Kind... sequence) {
            this.jobId = id == null ? null : new JobId(id);
            this.sequence = new LinkedList<JobStatus>();
            for (JobStatus.Kind kind : sequence) {
                JobStatus result = new JobStatus();
                result.setKind(kind);
                result.setJobId(id == null ? "DUMMY" : id);
                result.setExitCode(0);
                this.sequence.addLast(result);
            }
        }
View Full Code Here

                throw new IOException();
            }
            if (sequence.isEmpty()) {
                throw new IOException();
            }
            JobStatus status = sequence.removeFirst();
            return status;
        }
View Full Code Here

TOP

Related Classes of com.asakusafw.yaess.jobqueue.client.JobStatus

Copyright © 2018 www.massapicom. 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.