Package com.alibaba.otter.shared.arbitrate.model

Examples of com.alibaba.otter.shared.arbitrate.model.PositionEventData


        }

        // 获取下mainstem状态信息
        MainStemEventData mainstemData = arbitrateViewService.mainstemData(pipeline.getChannelId(), pipelineId);

        PositionEventData positionData = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                             pipeline.getParameters().getMainstemClientId());

        context.put("pipeline", pipeline);
        context.put("pipelineId", pipelineId);
        context.put("processStats", processStats);
View Full Code Here


            IZkConnection connection = zookeeper.getConnection();
            // zkclient会将获取stat信息和正常的操作分开,使用原生的zk进行优化
            ZooKeeper orginZk = ((ZooKeeperx) connection).getZookeeper();
            Stat stat = new Stat();
            byte[] bytes = orginZk.getData(path, false, stat);
            PositionEventData eventData = new PositionEventData();
            eventData.setCreateTime(new Date(stat.getCtime()));
            eventData.setModifiedTime(new Date(stat.getMtime()));
            eventData.setPosition(new String(bytes, "UTF-8"));
            return eventData;
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

    public void doRemove(@Param("pipelineId") Long pipelineId, Navigator nav) throws Exception {
        Pipeline pipeline = pipelineService.findById(pipelineId);
        String destination = pipeline.getParameters().getDestinationName();
        short clientId = pipeline.getParameters().getMainstemClientId();
        PositionEventData position = arbitrateViewService.getCanalCursor(destination, clientId);
        logger.warn("remove pipelineId[{}] position \n {}", pipelineId, position); // 记录一下日志
        arbitrateViewService.removeCanalCursor(destination, clientId);
        nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
    }
View Full Code Here

        }

        // 获取下mainstem状态信息
        MainStemEventData mainstemData = arbitrateViewService.mainstemData(pipeline.getChannelId(), pipelineId);

        PositionEventData positionData = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                             pipeline.getParameters().getMainstemClientId());

        ChannelStatus status = channelArbitrateEvent.status(pipeline.getChannelId());

        context.put("pipeline", pipeline);
View Full Code Here

            condition.setType(ThroughputType.ROW);
            ThroughputStat throughputStat = throughputStatService.findThroughputStatByPipelineId(condition);
            throughputStats.put(pipeline.getId(), throughputStat);
            List<AlarmRule> alarmRules = alarmRuleService.getAlarmRules(pipeline.getId());
            alarmRuleStats.put(pipeline.getId(), alarmRules);
            PositionEventData positionData = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                                 pipeline.getParameters().getMainstemClientId());
            positionDatas.put(pipeline.getId(), positionData);
        }

        context.put("channel", channel);
View Full Code Here

        if (CollectionUtils.isEmpty(rules)) {
            return;
        }
        Long pipelineId = rules.get(0).getPipelineId();
        Pipeline pipeline = pipelineService.findById(pipelineId);
        PositionEventData data = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                     pipeline.getParameters().getMainstemClientId());
        // 如果处于stop状态,则忽略报警
        ChannelStatus status = arbitrateManageService.channelEvent().status(pipeline.getChannelId());
        if (status == null || status.isStop()) {
            return;
        }

        long latestSyncTime = 0L;
        if (data != null && data.getModifiedTime() != null) {
            Date modifiedDate = data.getModifiedTime();
            latestSyncTime = modifiedDate.getTime();
        }

        long now = System.currentTimeMillis();
        long elapsed = now - latestSyncTime;
View Full Code Here

            IZkConnection connection = zookeeper.getConnection();
            // zkclient会将获取stat信息和正常的操作分开,使用原生的zk进行优化
            ZooKeeper orginZk = ((ZooKeeperx) connection).getZookeeper();
            Stat stat = new Stat();
            byte[] bytes = orginZk.getData(path, false, stat);
            PositionEventData eventData = new PositionEventData();
            eventData.setCreateTime(new Date(stat.getCtime()));
            eventData.setModifiedTime(new Date(stat.getMtime()));
            eventData.setPosition(new String(bytes, "UTF-8"));
            return eventData;
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

        if (CollectionUtils.isEmpty(rules)) {
            return;
        }
        Long pipelineId = rules.get(0).getPipelineId();
        Pipeline pipeline = pipelineService.findById(pipelineId);
        PositionEventData data = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                     pipeline.getParameters().getMainstemClientId());

        long latestSyncTime = 0L;
        if (data != null && data.getModifiedTime() != null) {
            Date modifiedDate = data.getModifiedTime();
            latestSyncTime = modifiedDate.getTime();
        }

        long now = System.currentTimeMillis();
        long elapsed = now - latestSyncTime;
View Full Code Here

            IZkConnection connection = zookeeper.getConnection();
            // zkclient会将获取stat信息和正常的操作分开,使用原生的zk进行优化
            ZooKeeper orginZk = ((ZooKeeperx) connection).getZookeeper();
            Stat stat = new Stat();
            byte[] bytes = orginZk.getData(path, false, stat);
            PositionEventData eventData = new PositionEventData();
            eventData.setCreateTime(new Date(stat.getCtime()));
            eventData.setModifiedTime(new Date(stat.getMtime()));
            eventData.setPosition(new String(bytes, "UTF-8"));
            return eventData;
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

        if (CollectionUtils.isEmpty(rules)) {
            return;
        }
        Long pipelineId = rules.get(0).getPipelineId();
        Pipeline pipeline = pipelineService.findById(pipelineId);
        PositionEventData data = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                     pipeline.getParameters().getMainstemClientId());

        long latestSyncTime = 0L;
        if (data != null && data.getModifiedTime() != null) {
            Date modifiedDate = data.getModifiedTime();
            latestSyncTime = modifiedDate.getTime();
        } else {
            return;
        }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.arbitrate.model.PositionEventData

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.