Package kr.or.ioi2002.RMIServer

Examples of kr.or.ioi2002.RMIServer.LogTest


        dispatchJob();
    }

    public void submit(String contestId, String userId, Task task, String language, File tmp,
            String sourceFileName, JobRemovalNotified notified) {
        Job job = new Job();
        job.setContestId(contestId);
        job.setUserid(userId);
        if (task.isFeedbackEnabled()) {
            job.setType(JobType.FEEDBACK);
        } else {
            job.setType(JobType.SUBMIT);
        }
        // TODO: remove HACK
        if (task.getType() != Task.PROBLEM_TYPE_OUTPUT) {
            job.setTask(task.getName());
        } else {
            job.setTask(task.getName() + language);
        }
        job.setLanguage(language);
        job.srcFilename = sourceFileName;
        job.src = tmp;
        gradingQueueManager.push(job, notified);
        dispatchJob();
    }
View Full Code Here


        dispatchJob();
    }

    public void test(String contestId, String userId, String task, String language, TempFile tmp,
            TempFile tmp2, JobRemovalNotified notified) {
        Job job = new Job();
        job.setContestId(contestId);
        job.setUserid(userId);
        job.setType(JobType.TEST);
        job.setTask(task);
        job.setLanguage(language);
        job.src = tmp;
        job.stdin = tmp2;
        gradingQueueManager.push(job, notified);
        dispatchJob();
    }
View Full Code Here

        }
        GraderAgent gm = machineQueueManager.moveMachineToBusy();
        if (gm == null) {
            return;
        }
        Job job = gradingQueueManager.popJob(jobType);

        if (gm != null && job != null && gm.assignJob(job)) {
            gradingQueueManager.markSuccessfullyAssignedJob(job);
        } else {
            machineQueueManager.releaseMachineFromBusyMode(gm);
View Full Code Here

    }

    public void pushTestData(Contest contest) {
        int jobsCount = machineQueueManager.markAllGradersToUpdate(contest);
        for (int i = 0; i < jobsCount; ++i) {
            Job job = new Job();
            job.setContestId(contest.getId());
            job.setType(JobType.SETUP);
            gradingQueueManager.push(job, null);
            dispatchJob();
        }
    }
View Full Code Here

    public Job removeJob(JobType jobType) {
        LinkedList<Job> queue = getQueueImpl(jobType);
        synchronized (queue) {
            if (queue.isEmpty())
                return null;
            Job job = queue.remove();
            store();
            return job;
        }
    }
View Full Code Here

        LogGraderAgent.log("dispatchGrade: putback occured");
        push(job, null);
    }

    public synchronized void push(Job job, JobRemovalNotified notified) {
        Job modifiedJob = implementation.addJob(job);
        notifyAddition(notified, modifiedJob);
    }
View Full Code Here

        Job modifiedJob = implementation.addJob(job);
        notifyAddition(notified, modifiedJob);
    }

    public synchronized Job popJob(JobType jobType) {
        Job job = implementation.removeJob(jobType);
        if (job == null)
            return null;

        notifyRemoval(job);
        return job;
View Full Code Here

    @Override
    protected void tearDown() throws Exception {
    }

    public void testSerialization() {
        Job job = new Job();
        job.setType(JobType.SUBMIT);
        {
            GradingQueue gradingQueueManager = new GradingQueue("./");
            gradingQueueManager.push(job, null);
        }
        {
View Full Code Here

     * job to null.
     *
     * @return the just finished job
     */
    private Job resetCurrentJob() {
        Job finishedJob = currentJob;
        currentJob = null;
        return finishedJob;
    }
View Full Code Here

        }
    }

    private void sendDoneMessage() {
        currentJob.gmid = getIP().toString();
        Job job = resetCurrentJob();
        graderManager.releaseMachine(this);

        // It is important that currentJob is null-ified before a call to the
        // gradeManager occurs, otherwise a putback occurs and this go awry.
        if (JobType.GRADE == job.getType())
            graderManager.OnMsgGradeDone(job);
        else if (JobType.SUBMIT == job.getType())
            graderManager.OnMsgSubmitDone(job);
        else if (JobType.TEST == job.getType())
            graderManager.OnMsgTestDone(job);
    }
View Full Code Here

TOP

Related Classes of kr.or.ioi2002.RMIServer.LogTest

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.