Loading dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class WorkerGroupService extends BaseService { List<WorkerGroup> workerGroupList = workerGroupMapper.queryWorkerGroupByName(workerGroup.getName()); if(workerGroupList.size() > 0 ){ if(CollectionUtils.isNotEmpty(workerGroupList)){ // new group has same name.. if(workerGroup.getId() == 0){ return true; Loading dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapperTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public class WorkerGroupMapperTest { workerGroup.setName("workerGroup11"); int update = workerGroupMapper.updateById(workerGroup); workerGroupMapper.deleteById(workerGroup.getId()); Assert.assertEquals(update, 1); Assert.assertEquals(1, update); } /** Loading @@ -77,7 +77,7 @@ public class WorkerGroupMapperTest { WorkerGroup workerGroup = insertOne(); //delete int delete = workerGroupMapper.deleteById(workerGroup.getId()); Assert.assertEquals(delete, 1); Assert.assertEquals(1, delete); } /** Loading dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java +7 −11 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ import org.springframework.context.annotation.FilterType; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; Loading Loading @@ -255,7 +254,7 @@ public class WorkerServer implements IStoppable { */ private Runnable heartBeatThread(){ logger.info("start worker heart beat thread..."); Runnable heartBeatThread = new Runnable() { return new Runnable() { @Override public void run() { // send heartbeat to zk Loading @@ -266,7 +265,6 @@ public class WorkerServer implements IStoppable { zkWorkerClient.heartBeatForZk(zkWorkerClient.getWorkerZNode() , Constants.WORKER_PREFIX); } }; return heartBeatThread; } Loading @@ -276,7 +274,7 @@ public class WorkerServer implements IStoppable { * @return kill process thread */ private Runnable getKillProcessThread(){ Runnable killProcessThread = new Runnable() { return new Runnable() { @Override public void run() { logger.info("start listening kill process thread..."); Loading @@ -297,7 +295,6 @@ public class WorkerServer implements IStoppable { } } }; return killProcessThread; } /** Loading @@ -307,17 +304,17 @@ public class WorkerServer implements IStoppable { * @param pd process dao */ private void killTask(String taskInfo, ProcessService pd) { logger.info("get one kill command from tasks kill queue: " + taskInfo); logger.info("get one kill command from tasks kill queue: {}" , taskInfo); String[] taskInfoArray = taskInfo.split("-"); if(taskInfoArray.length != 2){ logger.error("error format kill info: " + taskInfo); logger.error("error format kill info: {}", taskInfo); return ; } String host = taskInfoArray[0]; int taskInstanceId = Integer.parseInt(taskInfoArray[1]); TaskInstance taskInstance = pd.getTaskInstanceDetailByTaskId(taskInstanceId); if(taskInstance == null){ logger.error("cannot find the kill task :" + taskInfo); logger.error("cannot find the kill task : {}", taskInfo); return; } Loading @@ -332,8 +329,7 @@ public class WorkerServer implements IStoppable { }else if(!taskInstance.getState().typeIsFinished()){ ProcessUtils.kill(taskInstance); }else{ logger.info("the task aleady finish: task id: " + taskInstance.getId() + " state: " + taskInstance.getState().toString()); logger.info("the task aleady finish: task id: {} state: {}", taskInstance.getId(), taskInstance.getState()); } } } Loading @@ -347,7 +343,7 @@ public class WorkerServer implements IStoppable { private void deleteTaskFromQueue(TaskInstance taskInstance, ProcessService pd){ // creating distributed locks, lock path /dolphinscheduler/lock/worker InterProcessMutex mutex = null; logger.info("delete task from tasks queue: " + taskInstance.getId()); logger.info("delete task from tasks queue: {}", taskInstance.getId()); try { mutex = zkWorkerClient.acquireZkLock(zkWorkerClient.getZkClient(), Loading Loading
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class WorkerGroupService extends BaseService { List<WorkerGroup> workerGroupList = workerGroupMapper.queryWorkerGroupByName(workerGroup.getName()); if(workerGroupList.size() > 0 ){ if(CollectionUtils.isNotEmpty(workerGroupList)){ // new group has same name.. if(workerGroup.getId() == 0){ return true; Loading
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapperTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ public class WorkerGroupMapperTest { workerGroup.setName("workerGroup11"); int update = workerGroupMapper.updateById(workerGroup); workerGroupMapper.deleteById(workerGroup.getId()); Assert.assertEquals(update, 1); Assert.assertEquals(1, update); } /** Loading @@ -77,7 +77,7 @@ public class WorkerGroupMapperTest { WorkerGroup workerGroup = insertOne(); //delete int delete = workerGroupMapper.deleteById(workerGroup.getId()); Assert.assertEquals(delete, 1); Assert.assertEquals(1, delete); } /** Loading
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java +7 −11 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ import org.springframework.context.annotation.FilterType; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; Loading Loading @@ -255,7 +254,7 @@ public class WorkerServer implements IStoppable { */ private Runnable heartBeatThread(){ logger.info("start worker heart beat thread..."); Runnable heartBeatThread = new Runnable() { return new Runnable() { @Override public void run() { // send heartbeat to zk Loading @@ -266,7 +265,6 @@ public class WorkerServer implements IStoppable { zkWorkerClient.heartBeatForZk(zkWorkerClient.getWorkerZNode() , Constants.WORKER_PREFIX); } }; return heartBeatThread; } Loading @@ -276,7 +274,7 @@ public class WorkerServer implements IStoppable { * @return kill process thread */ private Runnable getKillProcessThread(){ Runnable killProcessThread = new Runnable() { return new Runnable() { @Override public void run() { logger.info("start listening kill process thread..."); Loading @@ -297,7 +295,6 @@ public class WorkerServer implements IStoppable { } } }; return killProcessThread; } /** Loading @@ -307,17 +304,17 @@ public class WorkerServer implements IStoppable { * @param pd process dao */ private void killTask(String taskInfo, ProcessService pd) { logger.info("get one kill command from tasks kill queue: " + taskInfo); logger.info("get one kill command from tasks kill queue: {}" , taskInfo); String[] taskInfoArray = taskInfo.split("-"); if(taskInfoArray.length != 2){ logger.error("error format kill info: " + taskInfo); logger.error("error format kill info: {}", taskInfo); return ; } String host = taskInfoArray[0]; int taskInstanceId = Integer.parseInt(taskInfoArray[1]); TaskInstance taskInstance = pd.getTaskInstanceDetailByTaskId(taskInstanceId); if(taskInstance == null){ logger.error("cannot find the kill task :" + taskInfo); logger.error("cannot find the kill task : {}", taskInfo); return; } Loading @@ -332,8 +329,7 @@ public class WorkerServer implements IStoppable { }else if(!taskInstance.getState().typeIsFinished()){ ProcessUtils.kill(taskInstance); }else{ logger.info("the task aleady finish: task id: " + taskInstance.getId() + " state: " + taskInstance.getState().toString()); logger.info("the task aleady finish: task id: {} state: {}", taskInstance.getId(), taskInstance.getState()); } } } Loading @@ -347,7 +343,7 @@ public class WorkerServer implements IStoppable { private void deleteTaskFromQueue(TaskInstance taskInstance, ProcessService pd){ // creating distributed locks, lock path /dolphinscheduler/lock/worker InterProcessMutex mutex = null; logger.info("delete task from tasks queue: " + taskInstance.getId()); logger.info("delete task from tasks queue: {}", taskInstance.getId()); try { mutex = zkWorkerClient.acquireZkLock(zkWorkerClient.getZkClient(), Loading