[Feauture](Export) support parallel export job using Job Schedule (#22854)

This commit is contained in:
Tiewei Fang
2023-08-18 22:24:42 +08:00
committed by GitHub
parent 6847592137
commit 10abbd2b62
23 changed files with 905 additions and 617 deletions

View File

@ -23,6 +23,7 @@ import org.apache.doris.common.ExceptionChecker;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.UserException;
import org.apache.doris.load.ExportJob;
import org.apache.doris.load.ExportJobState;
import org.apache.doris.load.ExportMgr;
import org.apache.doris.utframe.TestWithFeService;
@ -154,12 +155,12 @@ public class CancelExportStmtTest extends TestWithFeService {
List<ExportJob> exportJobList2 = Lists.newLinkedList();
ExportJob job1 = new ExportJob();
ExportJob job2 = new ExportJob();
job2.updateState(ExportJob.JobState.CANCELLED, true);
job2.updateState(ExportJobState.CANCELLED, true);
ExportJob job3 = new ExportJob();
job3.updateState(ExportJob.JobState.EXPORTING, false);
job3.updateState(ExportJobState.EXPORTING, false);
ExportJob job4 = new ExportJob();
ExportJob job5 = new ExportJob();
job5.updateState(ExportJob.JobState.IN_QUEUE, false);
job5.updateState(ExportJobState.IN_QUEUE, false);
exportJobList1.add(job1);
exportJobList1.add(job2);
exportJobList1.add(job3);
@ -188,15 +189,6 @@ public class CancelExportStmtTest extends TestWithFeService {
Assert.assertTrue(exportJobList1.stream().filter(filter).count() == 1);
stateStringLiteral = new StringLiteral("IN_QUEUE");
stateEqPredicate =
new BinaryPredicate(BinaryPredicate.Operator.EQ, stateSlotRef, stateStringLiteral);
stmt = new CancelExportStmt(null, stateEqPredicate);
stmt.analyze(analyzer);
filter = ExportMgr.buildCancelJobFilter(stmt);
Assert.assertTrue(exportJobList2.stream().filter(filter).count() == 1);
}
}

View File

@ -30,6 +30,7 @@ import org.apache.doris.common.VariableAnnotation;
import org.apache.doris.common.util.ProfileManager;
import org.apache.doris.common.util.RuntimeProfile;
import org.apache.doris.load.ExportJob;
import org.apache.doris.load.ExportJobState;
import org.apache.doris.task.ExportExportingTask;
import org.apache.doris.thrift.TQueryOptions;
import org.apache.doris.utframe.TestWithFeService;
@ -171,14 +172,14 @@ public class SessionVariablesTest extends TestWithFeService {
ExportStmt exportStmt = (ExportStmt)
parseAndAnalyzeStmt("EXPORT TABLE test_d.test_t1 TO \"file:///tmp/test_t1\"", connectContext);
ExportJob job = new ExportJob(1234);
job.setJob(exportStmt);
ExportJob job = exportStmt.getExportJob();
job.setId(1234);
new Expectations(job) {
{
job.getState();
minTimes = 0;
result = ExportJob.JobState.EXPORTING;
result = ExportJobState.EXPORTING;
}
};
@ -201,14 +202,14 @@ public class SessionVariablesTest extends TestWithFeService {
ExportStmt exportStmt = (ExportStmt)
parseAndAnalyzeStmt("EXPORT TABLE test_d.test_t1 TO \"file:///tmp/test_t1\"", connectContext);
ExportJob job = new ExportJob(1234);
job.setJob(exportStmt);
ExportJob job = exportStmt.getExportJob();
job.setId(1234);
new Expectations(job) {
{
job.getState();
minTimes = 0;
result = ExportJob.JobState.EXPORTING;
result = ExportJobState.EXPORTING;
}
};