Search in sources :

Example 1 with FindTaskEvent

use of com.alibaba.otter.shared.communication.model.config.FindTaskEvent in project otter by alibaba.

the class NodeTaskServiceImpl method initNodeTask.

private void initNodeTask() {
    // 从manager下获取一下对应的任务列表
    Node node = configClientService.currentNode();
    FindTaskEvent event = new FindTaskEvent();
    event.setNid(node.getId());
    Object obj = nodeCommmunicationClient.callManager(event);
    if (obj != null) {
        List<Channel> channels = (List<Channel>) obj;
        for (Channel channel : channels) {
            // 排除已经分配过的task
            processNodeTask(channel);
        }
    }
}
Also used : Node(com.alibaba.otter.shared.common.model.config.node.Node) Channel(com.alibaba.otter.shared.common.model.config.channel.Channel) ArrayList(java.util.ArrayList) List(java.util.List) FindTaskEvent(com.alibaba.otter.shared.communication.model.config.FindTaskEvent)

Aggregations

Channel (com.alibaba.otter.shared.common.model.config.channel.Channel)1 Node (com.alibaba.otter.shared.common.model.config.node.Node)1 FindTaskEvent (com.alibaba.otter.shared.communication.model.config.FindTaskEvent)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1