Browse Source
* Optimize master log, add workflow instance id and task instance id in log * Use MDC to set the workflow info in log4j * Add workflowInstanceId and taskInstanceId in MDC3.1.0-release
Wenjun Ruan
2 years ago
committed by
GitHub
40 changed files with 745 additions and 476 deletions
@ -0,0 +1,25 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.plugin.task.api; |
||||
|
||||
public class TaskPluginException extends RuntimeException { |
||||
|
||||
public TaskPluginException(String message) { |
||||
super(message); |
||||
} |
||||
} |
@ -0,0 +1,97 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.server.worker.prc; |
||||
|
||||
import org.apache.dolphinscheduler.remote.NettyRemotingServer; |
||||
import org.apache.dolphinscheduler.remote.command.CommandType; |
||||
import org.apache.dolphinscheduler.remote.config.NettyServerConfig; |
||||
import org.apache.dolphinscheduler.server.log.LoggerRequestProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; |
||||
import org.apache.dolphinscheduler.server.worker.processor.HostUpdateProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteResponseAckProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteRunningAckProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor; |
||||
import org.apache.dolphinscheduler.server.worker.processor.TaskRecallAckProcessor; |
||||
|
||||
import java.io.Closeable; |
||||
|
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
public class WorkerRpcServer implements Closeable { |
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkerRpcServer.class); |
||||
|
||||
@Autowired |
||||
private TaskExecuteProcessor taskExecuteProcessor; |
||||
|
||||
@Autowired |
||||
private TaskKillProcessor taskKillProcessor; |
||||
|
||||
@Autowired |
||||
private TaskRecallAckProcessor taskRecallAckProcessor; |
||||
|
||||
@Autowired |
||||
private TaskExecuteRunningAckProcessor taskExecuteRunningAckProcessor; |
||||
|
||||
@Autowired |
||||
private TaskExecuteResponseAckProcessor taskExecuteResponseAckProcessor; |
||||
|
||||
@Autowired |
||||
private HostUpdateProcessor hostUpdateProcessor; |
||||
|
||||
@Autowired |
||||
private LoggerRequestProcessor loggerRequestProcessor; |
||||
|
||||
@Autowired |
||||
private WorkerConfig workerConfig; |
||||
|
||||
private NettyRemotingServer nettyRemotingServer; |
||||
|
||||
public void start() { |
||||
LOGGER.info("Worker rpc server starting"); |
||||
NettyServerConfig serverConfig = new NettyServerConfig(); |
||||
serverConfig.setListenPort(workerConfig.getListenPort()); |
||||
this.nettyRemotingServer = new NettyRemotingServer(serverConfig); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, taskExecuteProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, taskKillProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RUNNING_ACK, taskExecuteRunningAckProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE_ACK, taskExecuteResponseAckProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, hostUpdateProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.TASK_RECALL_ACK, taskRecallAckProcessor); |
||||
// logger server
|
||||
this.nettyRemotingServer.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, loggerRequestProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, loggerRequestProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, loggerRequestProcessor); |
||||
this.nettyRemotingServer.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, loggerRequestProcessor); |
||||
this.nettyRemotingServer.start(); |
||||
LOGGER.info("Worker rpc server started"); |
||||
} |
||||
|
||||
@Override |
||||
public void close() { |
||||
LOGGER.info("Worker rpc server closing"); |
||||
this.nettyRemotingServer.close(); |
||||
LOGGER.info("Worker rpc server closed"); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue