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

Examples of com.alibaba.otter.shared.common.model.config.channel.Channel


        if ((queueSizeMap != null) && (false == queueSizeMap.isEmpty())) {
            Set<Long> key = queueSizeMap.keySet();
            for (Iterator it = key.iterator(); it.hasNext();) {
                Long pipelineId = (Long) it.next();

                Channel channel = channelService.findByPipelineId(pipelineId);
                // 判断channel状态,只有启动状态才进行判断超时时间
                if (!channel.getStatus().isStop()) {

                    DelayStat delayStat = delayStatService.findRealtimeDelayStat(pipelineId);
                    logger.info("delayStat.getDelayNumber() == " + delayStat.getDelayNumber());

                    if (null != delayStat.getDelayNumber()
                        && delayStat.getDelayNumber() >= queueSizeMap.get(pipelineId)) {
                        result = false;
                    }
                }
            }
        }
        if ((delayTimeMap != null) && (false == delayTimeMap.isEmpty())) {
            Set<Long> key = delayTimeMap.keySet();
            for (Iterator it = key.iterator(); it.hasNext();) {
                Long pipelineId = (Long) it.next();
                Channel channel = channelService.findByPipelineId(pipelineId);
                // 判断channel状态,只有启动状态才进行判断超时时间
                if (!channel.getStatus().isStop()) {
                    DelayStat delayStat = delayStatService.findRealtimeDelayStat(pipelineId);
                    logger.info("delayStat.getDelayTime() == " + delayStat.getDelayTime());

                    if (null != delayStat.getDelayTime() && delayStat.getDelayTime() >= delayTimeMap.get(pipelineId)) {
                        result = false;
                    }
                }
            }
        }

        if ((timeoutMap != null) && (false == timeoutMap.isEmpty())) {
            Set<Long> key = timeoutMap.keySet();
            for (Iterator it = key.iterator(); it.hasNext();) {
                Long pipelineId = (Long) it.next();
                Channel channel = channelService.findByPipelineId(pipelineId);
                // 判断channel状态,只有启动状态才进行判断超时时间
                if (!channel.getStatus().isStop()) {
                    ThroughputCondition condition = new ThroughputCondition();
                    condition.setPipelineId(pipelineId);
                    condition.setType(ThroughputType.ROW);
                    ThroughputStat throughputStat = throughputStatService.findThroughputStatByPipelineId(condition);
View Full Code Here


    @Resource(name = "tableStatService")
    private TableStatService     tableStatService;

    public void execute(@Param("pipelineId") Long pipelineId, Context context) throws Exception {
        // Pipeline pipeline = pipelineService.findById(pipelineId);
        Channel channel = channelService.findByPipelineId(pipelineId);
        List<DataMediaPair> dataMediaPairs = dataMediaPairService.listByPipelineId(pipelineId);
        Map<Long, TableStat> tableStatMap = new HashMap<Long, TableStat>(dataMediaPairs.size(), 1f);
        List<TableStat> tableStats = tableStatService.listTableStat(pipelineId);

        for (DataMediaPair dataMediaPair : dataMediaPairs) {
View Full Code Here

    @Resource(name = "arbitrateManageService")
    private ArbitrateManageService arbitrateManageService;

    public void doSwitch(@Param("pipelineId") Long pipelineId, Navigator nav) throws Exception {
        Channel channel = channelService.findByPipelineId(pipelineId);
        arbitrateManageService.channelEvent().restart(channel.getId());// 尝试重新启动
        arbitrateManageService.systemEvent().switchWarmup(channel.getId(), pipelineId);
        nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
    }
View Full Code Here

        arbitrateManageService.systemEvent().switchWarmup(channel.getId(), pipelineId);
        nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
    }

    public void doRestart(@Param("pipelineId") Long pipelineId, Navigator nav) throws Exception {
        Channel channel = channelService.findByPipelineId(pipelineId);
        arbitrateManageService.channelEvent().restart(channel.getId());// 尝试重新启动
        channelService.notifyChannel(channel.getId());// 推送下配置
        nav.redirectToLocation("analysisStageStat.htm?pipelineId=" + pipelineId);
    }
View Full Code Here

    private ChannelService   channelService;

    public void execute(@Param("pipelineId") Long pipelineId, Context context) throws Exception {

        List<AlarmRule> alarmRules = alarmRuleService.getAlarmRules(pipelineId);
        Channel channel = channelService.findByPipelineId(pipelineId);
        context.put("alarmRules", alarmRules);
        context.put("pipelineId", pipelineId);
        context.put("channelId", channel.getId());
    }
View Full Code Here

        nav.redirectToLocation("pipelineList.htm?channelId=" + pipeline.getChannelId());
    }

    public void doDelete(@Param("pipelineId") Long pipelineId, @Param("channelId") Long channelId, Navigator nav)
                                                                                                                 throws WebxException {
        Channel channel = channelService.findById(channelId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }
        // 如果pipeline节点下面存在dataMediaPair,则不允许删除
        if (dataMediaPairService.listByPipelineId(pipelineId).size() < 1) {
View Full Code Here

     * 更新一下事务标记
     */
    private void updateMark(DbLoadContext context, DbDialect dialect, int threadId, String sql, boolean needInfo,
                            String hint) {
        Identity identity = context.getIdentity();
        Channel channel = context.getChannel();
        // 获取dbDialect
        String markTableName = context.getPipeline().getParameters().getSystemSchema() + "."
                               + context.getPipeline().getParameters().getSystemMarkTable();
        String markTableColumn = context.getPipeline().getParameters().getSystemMarkTableColumn();
        synchronized (dialect.getJdbcTemplate()) {
            if (tableCheckStatus.contains(dialect.getJdbcTemplate()) == false) {
                init(dialect.getJdbcTemplate(), markTableName, markTableColumn);
                tableCheckStatus.add(dialect.getJdbcTemplate());
            }
        }

        int affectedCount = 0;
        if (needInfo) {
            String infoColumn = context.getPipeline().getParameters().getSystemMarkTableInfo();
            String info = context.getPipeline().getParameters().getChannelInfo();// 记录一下channelInfo
            String esql = MessageFormat.format(sql, new Object[] { markTableName, markTableColumn, infoColumn });
            if (hint != null) {
                esql = hint + esql;
            }
            affectedCount = dialect.getJdbcTemplate().update(esql, new Object[] { threadId, channel.getId(), info });
        } else {
            String esql = MessageFormat.format(sql, new Object[] { markTableName, markTableColumn });
            if (hint != null) {
                esql = hint + esql;
            }
            affectedCount = dialect.getJdbcTemplate().update(esql, new Object[] { threadId, channel.getId() });
        }

        if (affectedCount <= 0) {
            logger.warn("## update {} failed by [{}]", markTableName, threadId);
        } else {
View Full Code Here

                            long startTime = etlEventData.getStartTime();
                            if (!CollectionUtils.isEmpty(eventData)) {
                                startTime = eventData.get(0).getExecuteTime();
                            }

                            Channel channel = configClientService.findChannelByPipelineId(pipelineId);
                            RowBatch rowBatch = new RowBatch();
                            // 构造唯一标识
                            Identity identity = new Identity();
                            identity.setChannelId(channel.getId());
                            identity.setPipelineId(pipelineId);
                            identity.setProcessId(etlEventData.getProcessId());
                            rowBatch.setIdentity(identity);
                            // 进行数据合并
                            for (EventData data : eventData) {
View Full Code Here

    }

    private DbLoadContext buildContext(Identity identity) {
        DbLoadContext context = new DbLoadContext();
        context.setIdentity(identity);
        Channel channel = configClientService.findChannel(identity.getChannelId());
        Pipeline pipeline = configClientService.findPipeline(identity.getPipelineId());
        context.setChannel(channel);
        context.setPipeline(pipeline);
        return context;
    }
View Full Code Here

        nav.redirectToLocation("pipelineList.htm?channelId=" + pipeline.getChannelId());
    }

    public void doDelete(@Param("pipelineId") Long pipelineId, @Param("channelId") Long channelId, Navigator nav)
                                                                                                                 throws WebxException {
        Channel channel = channelService.findById(channelId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }
        // 如果pipeline节点下面存在dataMediaPair,则不允许删除
        if (dataMediaPairService.listByPipelineId(pipelineId).size() < 1) {
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.config.channel.Channel

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.