Package com.taobao.metamorphosis.exception

Examples of com.taobao.metamorphosis.exception.MetaClientException


        try {
            this.consumerZooKeeper.registerConsumer(this.consumerConfig, this.fetchManager,
                this.topicSubcriberRegistry, this.offsetStorage, this.loadBalanceStrategy);
        }
        catch (final Exception e) {
            throw new MetaClientException("ע�ᶩ����ʧ��", e);
        }
    }
View Full Code Here


            switch (booleanCmd.getCode()) {
            case HttpStatus.Success:
                success = true;
                return Long.parseLong(booleanCmd.getErrorMsg());
            default:
                throw new MetaClientException(booleanCmd.getErrorMsg());
            }
        }
        catch (final MetaClientException e) {
            throw e;
        }
        catch (final TimeoutException e) {
            throw new MetaOpeartionTimeoutException("Send message timeout in "
                    + this.consumerConfig.getFetchTimeoutInMills() + " mills");
        }
        catch (final Exception e) {
            throw new MetaClientException("get offset failed,topic=" + fetchRequest.getTopic() + ",partition="
                    + fetchRequest.getPartition() + ",current offset=" + fetchRequest.getOffset(), e);
        }
        finally {
            final long duration = System.currentTimeMillis() - start;
            if (duration > 200) {
View Full Code Here

                    success = true;
                    fetchRequest.resetRetries();
                    fetchRequest.setOffset(Long.parseLong(booleanCmd.getErrorMsg()), -1, true);
                    return null;
                default:
                    throw new MetaClientException("Status:" + booleanCmd.getCode() + ",Error message:"
                            + ((BooleanCommand) response).getErrorMsg());
                }
            }

        }
        catch (final TimeoutException e) {
            throw new MetaOpeartionTimeoutException("Send message timeout in "
                    + this.consumerConfig.getFetchTimeoutInMills() + " mills");
        }
        catch (final MetaClientException e) {
            throw e;
        }
        catch (final InterruptedException e) {
            throw e;
        }
        catch (final Exception e) {
            throw new MetaClientException("get message failed,topic=" + fetchRequest.getTopic() + ",partition="
                    + fetchRequest.getPartition() + ",offset=" + fetchRequest.getOffset(), e);
        }
        finally {
            final long duration = System.currentTimeMillis() - start;
            if (duration > 200) {
View Full Code Here

        this.serverUrl = serverUrl;
        try {
            this.url = new URI(serverUrl);
        }
        catch (URISyntaxException e) {
            throw new MetaClientException(e);
        }
        this.metaMessageSessionFactory = new MetaMessageSessionFactory(monitorConfig.metaClientConfigOf(serverUrl));
        this.remotingClient = this.metaMessageSessionFactory.getRemotingClient();
        this.producer = this.metaMessageSessionFactory.createProducer();
    }
View Full Code Here

        catch (InterruptedException e) {
            // ignore
            statsResult.setException(e);
        }
        catch (Exception e) {
            statsResult.setException(new MetaClientException("send stats failed", e));
        }
        return statsResult;
    }
View Full Code Here

    private MetaClientException toMetaClientException(final Exception e) {
        if (e instanceof MetaClientException) {
            return (MetaClientException) e;
        }
        else if (e instanceof XAException) {
            return new MetaClientException(e.getMessage(), e.getCause() != null ? e.getCause() : e);
        }
        return new MetaClientException(e);
    }
View Full Code Here

                            TransactionInfo.TransactionType.COMMIT_ONE_PHASE, this.uniqueQualifier);
                this.transactionId = null;
                this.syncSendLocalTxCommand(info);
            }
            catch (TimeoutException e) {
                throw new MetaClientException(
                    "Commit transaction timeout,the transaction state is unknown,you must check it by yourself.", e);
            }
            finally {
                this.logTxTime();
            }
        }
        else {
            throw new MetaClientException("No transaction is started");
        }
    }
View Full Code Here

            final BooleanCommand resp =
                    (BooleanCommand) this.remotingClient.invokeToGroup(this.serverUrl, new TransactionCommand(info,
                        OpaqueGenerator.getNextOpaque()), this.transactionRequestTimeoutInMills, TimeUnit.MILLISECONDS);
            if (resp.getResponseStatus() != ResponseStatus.NO_ERROR) {
                throw new MetaClientException(resp.getErrorMsg());
            }
        }
        catch (TimeoutException te) {
            throw te;
        }
View Full Code Here

                            TransactionInfo.TransactionType.ROLLBACK, this.uniqueQualifier);
                this.transactionId = null;
                this.syncSendLocalTxCommand(info);
            }
            catch (TimeoutException e) {
                throw new MetaClientException(
                    "Rollback transaction timeout,the transaction state is unknown,you must check it by yourself.", e);
            }
            finally {
                this.logTxTime();
            }
        }
        else {
            throw new MetaClientException("No transaction is started");
        }

    }
View Full Code Here

    public byte[] toByteArray(Serializable body) throws MetaClientException {
        try {
            return this.serializer.encodeObject(body);
        }
        catch (IOException e) {
            throw new MetaClientException(e);

        }
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.exception.MetaClientException

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.