test the sub task retry mechanism

This commit is contained in:
tjq 2020-03-26 23:03:08 +08:00
parent bc2b84efde
commit 341953acec
2 changed files with 8 additions and 4 deletions

View File

@ -62,7 +62,7 @@ public class TaskTrackerTest {
req.setInstanceParams("this is instance Params");
req.setProcessorType(ProcessorType.EMBEDDED_JAVA.name());
req.setTaskRetryNum(3);
req.setThreadConcurrency(5);
req.setThreadConcurrency(20);
req.setTimeLimit(500000);
switch (executeType) {

View File

@ -37,7 +37,7 @@ public class TestMapReduceProcessor extends MapReduceProcessor {
if (isRootTask()) {
System.out.println("start to map");
List<TestSubTask> subTasks = Lists.newLinkedList();
for (int j = 0; j < 2; j++) {
for (int j = 0; j < 1; j++) {
for (int i = 0; i < 100; i++) {
int x = j * 100 + i;
subTasks.add(new TestSubTask("name" + x, x));
@ -49,9 +49,13 @@ public class TestMapReduceProcessor extends MapReduceProcessor {
return new ProcessResult(true, "MAP_SUCCESS");
}else {
System.out.println("start to process");
Thread.sleep(1000);
// Thread.sleep(1000);
System.out.println(context.getSubTask());
return new ProcessResult(true, "PROCESS_SUCCESS");
if (context.getCurrentRetryTimes() == 0) {
return new ProcessResult(false, "FIRST_FAILED");
}else {
return new ProcessResult(true, "PROCESS_SUCCESS");
}
}
}