67
67
import org .apache .dolphinscheduler .dao .mapper .TaskGroupQueueMapper ;
68
68
import org .apache .dolphinscheduler .dao .mapper .TenantMapper ;
69
69
import org .apache .dolphinscheduler .dao .repository .ProcessInstanceDao ;
70
+ import org .apache .dolphinscheduler .dao .utils .WorkerGroupUtils ;
70
71
import org .apache .dolphinscheduler .registry .api .enums .RegistryNodeType ;
71
72
import org .apache .dolphinscheduler .service .command .CommandService ;
72
73
import org .apache .dolphinscheduler .service .process .ProcessService ;
@@ -271,7 +272,7 @@ public void testNoComplement() {
271
272
null , null ,
272
273
null , null , null ,
273
274
RunMode .RUN_MODE_SERIAL ,
274
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 10 , null , null ,
275
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 10 , null , null ,
275
276
Constants .DRY_RUN_FLAG_NO ,
276
277
Constants .TEST_FLAG_NO ,
277
278
ComplementDependentMode .OFF_MODE , null ,
@@ -298,7 +299,7 @@ public void testComplementWithStartNodeList() {
298
299
null , "123456789,987654321" ,
299
300
null , null , null ,
300
301
RunMode .RUN_MODE_SERIAL ,
301
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , null ,
302
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 110 , null , null ,
302
303
Constants .DRY_RUN_FLAG_NO ,
303
304
Constants .TEST_FLAG_NO ,
304
305
ComplementDependentMode .OFF_MODE , null ,
@@ -323,7 +324,7 @@ public void testComplementWithOldStartNodeList() {
323
324
null , "1123456789,987654321" ,
324
325
null , null , null ,
325
326
RunMode .RUN_MODE_SERIAL ,
326
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , 0 ,
327
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 110 , null , 0 ,
327
328
Constants .DRY_RUN_FLAG_NO ,
328
329
Constants .TEST_FLAG_NO ,
329
330
ComplementDependentMode .OFF_MODE , null ,
@@ -354,14 +355,14 @@ public void testComplementWithDependentMode() {
354
355
dependentProcessDefinition .setProcessDefinitionCode (2 );
355
356
dependentProcessDefinition .setProcessDefinitionVersion (1 );
356
357
dependentProcessDefinition .setTaskDefinitionCode (1 );
357
- dependentProcessDefinition .setWorkerGroup (Constants . DEFAULT_WORKER_GROUP );
358
+ dependentProcessDefinition .setWorkerGroup (WorkerGroupUtils . getDefaultWorkerGroup () );
358
359
dependentProcessDefinition .setTaskParams (
359
360
"{\" localParams\" :[],\" resourceList\" :[],\" dependence\" :{\" relation\" :\" AND\" ,\" dependTaskList\" :[{\" relation\" :\" AND\" ,\" dependItemList\" :[{\" depTaskCode\" :2,\" status\" :\" SUCCESS\" }]}]},\" conditionResult\" :{\" successNode\" :[1],\" failedNode\" :[1]}}" );
360
361
Mockito .when (processService .queryDependentProcessDefinitionByProcessDefinitionCode (processDefinitionCode ))
361
362
.thenReturn (Lists .newArrayList (dependentProcessDefinition ));
362
363
363
364
Map <Long , String > processDefinitionWorkerGroupMap = new HashMap <>();
364
- processDefinitionWorkerGroupMap .put (1L , Constants . DEFAULT_WORKER_GROUP );
365
+ processDefinitionWorkerGroupMap .put (1L , WorkerGroupUtils . getDefaultWorkerGroup () );
365
366
Mockito .when (workerGroupService .queryWorkerGroupByProcessDefinitionCodes (Lists .newArrayList (1L )))
366
367
.thenReturn (processDefinitionWorkerGroupMap );
367
368
@@ -370,7 +371,7 @@ public void testComplementWithDependentMode() {
370
371
command .setCommandType (CommandType .COMPLEMENT_DATA );
371
372
command .setCommandParam (
372
373
"{\" StartNodeList\" :\" 1\" ,\" complementStartDate\" :\" 2020-01-01 00:00:00\" ,\" complementEndDate\" :\" 2020-01-31 23:00:00\" }" );
373
- command .setWorkerGroup (Constants . DEFAULT_WORKER_GROUP );
374
+ command .setWorkerGroup (WorkerGroupUtils . getDefaultWorkerGroup () );
374
375
command .setProcessDefinitionCode (processDefinitionCode );
375
376
command .setExecutorId (1 );
376
377
@@ -383,7 +384,7 @@ public void testComplementWithDependentMode() {
383
384
childDependent .setProcessDefinitionCode (3 );
384
385
childDependent .setProcessDefinitionVersion (1 );
385
386
childDependent .setTaskDefinitionCode (4 );
386
- childDependent .setWorkerGroup (Constants . DEFAULT_WORKER_GROUP );
387
+ childDependent .setWorkerGroup (WorkerGroupUtils . getDefaultWorkerGroup () );
387
388
childDependent .setTaskParams (
388
389
"{\" localParams\" :[],\" resourceList\" :[],\" dependence\" :{\" relation\" :\" AND\" ,\" dependTaskList\" :[{\" relation\" :\" AND\" ,\" dependItemList\" :[{\" depTaskCode\" :3,\" status\" :\" SUCCESS\" }]}]},\" conditionResult\" :{\" successNode\" :[1],\" failedNode\" :[1]}}" );
389
390
Mockito .when (processService .queryDependentProcessDefinitionByProcessDefinitionCode (
@@ -409,7 +410,8 @@ public void testDateError() {
409
410
null , null ,
410
411
null , null , null ,
411
412
RunMode .RUN_MODE_SERIAL ,
412
- Priority .LOW , Constants .DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , 2 , Constants .DRY_RUN_FLAG_NO ,
413
+ Priority .LOW , WorkerGroupUtils .getDefaultWorkerGroup (), tenantCode , 100L , 110 , null , 2 ,
414
+ Constants .DRY_RUN_FLAG_NO ,
413
415
Constants .TEST_FLAG_NO ,
414
416
ComplementDependentMode .OFF_MODE , null ,
415
417
false ,
@@ -434,7 +436,7 @@ public void testSerial() {
434
436
null , null ,
435
437
null , null , null ,
436
438
RunMode .RUN_MODE_SERIAL ,
437
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , null ,
439
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 110 , null , null ,
438
440
Constants .DRY_RUN_FLAG_NO ,
439
441
Constants .TEST_FLAG_NO ,
440
442
ComplementDependentMode .OFF_MODE , null ,
@@ -460,7 +462,8 @@ public void testParallelWithOutSchedule() {
460
462
null , null ,
461
463
null , null , null ,
462
464
RunMode .RUN_MODE_PARALLEL ,
463
- Priority .LOW , Constants .DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , 2 , Constants .DRY_RUN_FLAG_NO ,
465
+ Priority .LOW , WorkerGroupUtils .getDefaultWorkerGroup (), tenantCode , 100L , 110 , null , 2 ,
466
+ Constants .DRY_RUN_FLAG_NO ,
464
467
Constants .TEST_FLAG_NO ,
465
468
ComplementDependentMode .OFF_MODE , null ,
466
469
false ,
@@ -486,7 +489,7 @@ public void testParallelWithSchedule() {
486
489
null , null ,
487
490
null , null , null ,
488
491
RunMode .RUN_MODE_PARALLEL ,
489
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , 15 ,
492
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 110 , null , 15 ,
490
493
Constants .DRY_RUN_FLAG_NO ,
491
494
Constants .TEST_FLAG_NO ,
492
495
ComplementDependentMode .OFF_MODE , null ,
@@ -514,7 +517,7 @@ public void testNoMasterServers() {
514
517
null ,
515
518
RunMode .RUN_MODE_PARALLEL ,
516
519
Priority .LOW ,
517
- Constants . DEFAULT_WORKER_GROUP ,
520
+ WorkerGroupUtils . getDefaultWorkerGroup () ,
518
521
tenantCode ,
519
522
100L ,
520
523
110 ,
@@ -553,7 +556,7 @@ public void testOfTestRun() {
553
556
null , null ,
554
557
null , null , 0 ,
555
558
RunMode .RUN_MODE_PARALLEL ,
556
- Priority .LOW , Constants . DEFAULT_WORKER_GROUP , tenantCode , 100L , 110 , null , 15 ,
559
+ Priority .LOW , WorkerGroupUtils . getDefaultWorkerGroup () , tenantCode , 100L , 110 , null , 15 ,
557
560
Constants .DRY_RUN_FLAG_NO ,
558
561
Constants .TEST_FLAG_YES ,
559
562
ComplementDependentMode .OFF_MODE , null ,
0 commit comments