Package com.alibaba.otter.shared.arbitrate.exception

Examples of com.alibaba.otter.shared.arbitrate.exception.ArbitrateException


        if (needTermin) {
            try {
                result |= termin(channelId, TerminType.SHUTDOWN);
            } catch (Throwable e) {
                updateStatus(channelId, ChannelStatus.STOP); // 出错了,直接挂起
                throw new ArbitrateException(e);
            }
        }

        return result;
    }
View Full Code Here


        if (needTermin) {
            try {
                result |= termin(channelId, TerminType.RESTART);
            } catch (Throwable e) {
                updateStatus(channelId, ChannelStatus.PAUSE); // 出错了,直接挂起
                throw new ArbitrateException(e);
            }

        }

        // 处理一下重启操作,只处理pause状态
View Full Code Here

        } catch (ZkNoNodeException e) {
            // 如果节点已经不存在,则不抛异常
            // ignore
            return null;
        } catch (ZkException e) {
            throw new ArbitrateException("Channel_status", channelId.toString(), e);
        }

        return JsonUtils.unmarshalFromByte(data, ChannelStatus.class);
    }
View Full Code Here

            zookeeper.delete(path); // 删除节点,不关心版本
        } catch (ZkNoNodeException e) {
            // 如果节点已经不存在,则不抛异常
            // ignore
        } catch (ZkException e) {
            throw new ArbitrateException("Channel_destory", channelId.toString(), e);
        }
    }
View Full Code Here

        String path = ManagePathUtils.getChannelByChannelId(channelId);
        byte[] data = JsonUtils.marshalToByte(status);// 初始化的数据对象
        try {
            zookeeper.writeData(path, data);
        } catch (ZkException e) {
            throw new ArbitrateException("Channel_init", channelId.toString(), e);
        }
    }
View Full Code Here

    /**
     * 包装重试策略
     */
    public <T> T retryOperation(ZooKeeperOperation<T> operation) throws KeeperException, InterruptedException {
        if (!running.get()) {
            throw new ArbitrateException("Zookeeper is destory ,should never be used ....");
        }

        KeeperException exception = null;
        for (int i = 0; i < maxRetry; i++) {
            int version = cversion.get(); // 获取版本
View Full Code Here

        _constructorArgs[0] = pipelineId;

        try {
            _constructor = type.getConstructor(new Class[] { Long.class });
        } catch (NoSuchMethodException e) {
            throw new ArbitrateException("Constructor_notFound");
        }

        try {
            return _constructor.newInstance(_constructorArgs);
        } catch (Exception e) {
            throw new ArbitrateException("Constructor_newInstance_error", e);
        }

    }
View Full Code Here

                    // 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);
                return await(pipelineId);// /出现节点不存在,说明出现了error情况,递归调用重新获取一次
            } catch (ZkException e) {
                throw new ArbitrateException("Select_await", e.getMessage(), e);
            }
        } else {
            logger.warn("pipelineId[{}] select ignore processId[{}] by status[{}]", new Object[] { pipelineId,
                    processId, status });
            // add by ljh 2013-02-01
View Full Code Here

        processMonitor.reload();
    }

    public Long waitForProcess(StageType stage) throws InterruptedException {
        if (stage.isSelect()) {
            throw new ArbitrateException("not support");
        }

        return replys.get(stage).take();
    }
View Full Code Here

            for (int i = 0; i < size; i++) {
                TerminEventData data = stageController.waitTermin();
                ack(data);
            }
        } catch (InterruptedException e) {
            throw new ArbitrateException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.arbitrate.exception.ArbitrateException

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.