Search in sources :

Example 1 with RunRecord

use of cn.edu.zjnu.acm.judge.data.dto.RunRecord in project judge by zjnu-acm.

the class JudgeService method toCompletableFuture.

CompletableFuture<?> toCompletableFuture(Executor executor, long submissionId) {
    return CompletableFuture.runAsync(() -> {
        Submission submission = submissionMapper.findOne(submissionId);
        if (submission == null) {
            throw new BusinessException(BusinessCode.SUBMISSION_NOT_FOUND);
        }
        Problem problem = problemService.findOneNoI18n(submission.getProblem());
        RunRecord runRecord = RunRecord.builder().submissionId(submission.getId()).language(languageService.getAvailableLanguage(submission.getLanguage())).problemId(submission.getProblem()).userId(submission.getUser()).source(submissionMapper.findSourceById(submissionId)).memoryLimit(problem.getMemoryLimit()).timeLimit(problem.getTimeLimit()).build();
        judgeInternal(runRecord);
    }, executor);
}
Also used : RunRecord(cn.edu.zjnu.acm.judge.data.dto.RunRecord) BusinessException(cn.edu.zjnu.acm.judge.exception.BusinessException) Submission(cn.edu.zjnu.acm.judge.domain.Submission) Problem(cn.edu.zjnu.acm.judge.domain.Problem)

Aggregations

RunRecord (cn.edu.zjnu.acm.judge.data.dto.RunRecord)1 Problem (cn.edu.zjnu.acm.judge.domain.Problem)1 Submission (cn.edu.zjnu.acm.judge.domain.Submission)1 BusinessException (cn.edu.zjnu.acm.judge.exception.BusinessException)1