mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
test the sub task retry mechanism
This commit is contained in:
parent
bc2b84efde
commit
341953acec
@ -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) {
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user