Package com.alibaba.otter.shared.common.model.config.node

Examples of com.alibaba.otter.shared.common.model.config.node.Node


        });

        mbeanServers = mapMaker.makeComputingMap(new Function<Long, MBeanServerConnection>() {

            public MBeanServerConnection apply(Long nid) {
                Node node = nodeService.findById(nid);
                String ip = node.getIp();
                int port = node.getPort().intValue() + 1;
                try {
                    JMXServiceURL serviceURL = new JMXServiceURL(MessageFormat.format(SERVICE_URL, ip,
                                                                                      String.valueOf(port)));
                    JMXConnector cntor = JMXConnectorFactory.connect(serviceURL, null);
                    MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
View Full Code Here


        List<Long> selectNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("selectNodeIds")
            .getLongValues()));
        List<Node> selectNodes = new ArrayList<Node>();
        for (Long selectNodeId : selectNodeIds) {
            Node node = new Node();
            node.setId(selectNodeId);
            selectNodes.add(node);
        }

        // select/extract节点普遍配置为同一个节点
        List<Long> extractNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("selectNodeIds")
            .getLongValues()));
        // List<Long> extractNodeIds =
        // Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("extractNodeIds").getLongValues()));
        List<Node> extractNodes = new ArrayList<Node>();
        for (Long extractNodeId : extractNodeIds) {
            Node node = new Node();
            node.setId(extractNodeId);
            extractNodes.add(node);
        }

        List<Long> loadNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("loadNodeIds").getLongValues()));
        List<Node> loadNodes = new ArrayList<Node>();
        for (Long loadNodeId : loadNodeIds) {
            Node node = new Node();
            node.setId(loadNodeId);
            loadNodes.add(node);
        }

        pipeline.setSelectNodes(selectNodes);
        pipeline.setExtractNodes(extractNodes);
View Full Code Here

        List<Long> selectNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("selectNodeIds")
            .getLongValues()));
        List<Node> selectNodes = new ArrayList<Node>();
        for (Long selectNodeId : selectNodeIds) {
            Node node = new Node();
            node.setId(selectNodeId);
            selectNodes.add(node);
        }

        // select/extract节点普遍配置为同一个节点
        List<Long> extractNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("selectNodeIds")
            .getLongValues()));
        // List<Long> extractNodeIds =
        // Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("extractNodeIds").getLongValues()));
        List<Node> extractNodes = new ArrayList<Node>();
        for (Long extractNodeId : extractNodeIds) {
            Node node = new Node();
            node.setId(extractNodeId);
            extractNodes.add(node);
        }

        List<Long> loadNodeIds = Arrays.asList(ArrayUtils.toObject(pipelineInfo.getField("loadNodeIds").getLongValues()));
        List<Node> loadNodes = new ArrayList<Node>();
        for (Long loadNodeId : loadNodeIds) {
            Node node = new Node();
            node.setId(loadNodeId);
            loadNodes.add(node);
        }

        pipeline.setSelectNodes(selectNodes);
        pipeline.setExtractNodes(extractNodes);
View Full Code Here

            });
        }
    }

    private String convertToAddress(Long nid) {
        Node node = ArbitrateConfigUtils.findNode(nid);
        return node.getIp() + ":" + node.getPort();
    }
View Full Code Here

        if (nodes == null || nodes.size() == 0) {
            return null;
        }

        Long nid = ArbitrateConfigUtils.getCurrentNid();
        Node current = new Node();
        current.setId(nid);

        // 判断一下是否优先返回local
        boolean existLocal = nodes.remove(current);
        if (existLocal && nodes.size() == 0) {//如果只有它自己
            return current;
View Full Code Here

        } else if (loadBanlanceAlgorithm.isRoundRbin()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, ExtractRoundRobinLoadBalance.class);
        } else {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, ExtractStickLoadBalance.class);
        }
        Node node = loadbalance.next();// 获取下一个处理节点信息
        return node;
    }
View Full Code Here

        } else if (loadBanlanceAlgorithm.isRoundRbin()) {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, TransformRoundRobinLoadBalance.class);
        } else {
            loadbalance = ArbitrateFactory.getInstance(pipelineId, TransformStickLoadBalance.class);
        }
        Node node = loadbalance.next();// 获取下一个处理节点信息
        return node;
    }
View Full Code Here

                EtlEventData eventData = new EtlEventData();
                eventData.setPipelineId(pipelineId);
                eventData.setProcessId(processId);
                eventData.setStartTime(new Date().getTime());// 返回当前时间

                Node node = LoadBalanceFactory.getNextExtractNode(pipelineId);// 获取下一个处理节点信息
                if (node == null) {// 没有后端节点
                    // TerminEventData termin = new TerminEventData();
                    // termin.setPipelineId(pipelineId);
                    // termin.setType(TerminType.ROLLBACK);
                    // termin.setCode("no_node");
                    // termin.setDesc(MessageFormat.format("pipeline[{}] extract stage has no node!", pipelineId));
                    // terminEvent.single(termin);
                    throw new ArbitrateException("Select_single", "no next node");
                } else {
                    eventData.setNextNid(node.getId());
                    markUsed(eventData); // 标记为已使用
                    return eventData;// 只有这一条路返回
                }
            } catch (ZkNoNodeException e) {
                logger.error("pipeline[{}] processId[{}] is invalid , retry again", pipelineId, processId);
View Full Code Here

        if (nodes == null || nodes.size() == 0) {
            return null;
        }

        Long nid = ArbitrateConfigUtils.getCurrentNid();
        Node current = new Node();
        current.setId(nid);

        // 判断一下是否优先返回local
        boolean existLocal = nodes.remove(current);
        if (existLocal && nodes.size() == 0) {//如果只有它自己
            return current;
View Full Code Here

        });

        nodeCache = new RefreshMemoryMirror<Long, Node>(timeout, new ComputeFunction<Long, Node>() {

            public Node apply(Long key, Node oldValue) {
                Node node = nodeService.findById(key);
                if (node == null) {
                    return oldValue;
                } else {
                    return node;
                }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.config.node.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.