Examples of toStringUtf8()


Examples of com.google.protobuf.ByteString.toStringUtf8()

                public void operationFinished(Object ctx, Void resultOfOperation) {
                    Callback<Void> cb2 = new Callback<Void>() {

                        @Override
                        public void operationFailed(Object ctx, PubSubException exception) {
                            logger.error("subscription for subscriber " + subscriberId.toStringUtf8() + " to topic "
                                         + topic.toStringUtf8() + " failed due to failed listener callback", exception);
                            cb.operationFailed(ctx, exception);
                        }

                        @Override
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

        latch.acquire();
        tpManager.readTopicPersistenceInfo(topic, new Callback<Versioned<LedgerRanges>>() {
            @Override
            public void operationFinished(Object ctx, Versioned<LedgerRanges> ranges) {
                if (null == ranges || ranges.getValue().getRangesList().size() > 1) {
                    failureException = new PubSubException.NoTopicPersistenceInfoException("Invalid persistence info found for topic " + topic.toStringUtf8());
                    ((Semaphore)ctx).release();
                    return;
                }
                failureException = null;
                ((Semaphore)ctx).release();
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

            Map<String, ByteString> userOptions = SubscriptionStateUtils.buildUserOptions(preferences);
            ByteString modValue = userOptions.get(OPT_MOD);
            if (null == modValue) {
                mod = 0;
            } else {
                mod = Integer.valueOf(modValue.toStringUtf8());
            }
            return this;
        }

        @Override
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

        latch.acquire();
        tpManager.readTopicPersistenceInfo(topic, new Callback<Versioned<LedgerRanges>>() {
            @Override
            public void operationFinished(Object ctx, Versioned<LedgerRanges> ranges) {
                if (null == ranges || ranges.getValue().getRangesList().size() > 1) {
                    failureException = new PubSubException.NoTopicPersistenceInfoException("Invalid persistence info found for topic " + topic.toStringUtf8());
                    ((Semaphore)ctx).release();
                    return;
                }
                failureException = null;
                ((Semaphore)ctx).release();
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

            SubscriptionOptions.newBuilder()
            .setCreateOrAttach(CreateOrAttach.CREATE_OR_ATTACH)
            .setForceAttach(false).setEnableResubscribe(true).build();
        subscriber.subscribe(topic, subscriberId, options);
        logger.info("Subscribed topic {}, subscriber {}.", topic.toStringUtf8(),
                    subscriberId.toStringUtf8());
        subscriber.startDelivery(topic, subscriberId, new TestMessageHandler());

        // tear down the hub server to let subscribe enter
        tearDownHubServer();
        logger.info("Tear down the hub server");
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

        try {
            seqId = persistenceMgr.getCurrentSeqIdForTopic(topic);
        } catch (ServerNotResponsibleForTopicException e) {
            channel.write(PubSubResponseUtils.getResponseForException(e, request.getTxnId())).addListener(
                ChannelFutureListener.CLOSE);
            logger.error("Error getting current seq id for topic " + topic.toStringUtf8()
                       + " when processing subscribe request (txnid:" + request.getTxnId() + ") :", e);
            subStats.incrementFailedOps();
            ServerStats.getInstance().incrementRequestsRedirect();
            return;
        }
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId())).addListener(
                    ChannelFutureListener.CLOSE);
                logger.error("Error serving subscribe request (" + request.getTxnId() + ") for (topic: "
                           + topic.toStringUtf8() + " , subscriber: " + subscriberId.toStringUtf8() + ")", exception);
                subStats.incrementFailedOps();
            }

            @Override
            public void operationFinished(Object ctx, final SubscriptionData subData) {
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

                    filter.initialize(cfg.getConf());
                    filter.setSubscriptionPreferences(topic, subscriberId,
                                                      subData.getPreferences());
                } catch (RuntimeException re) {
                    String errMsg = "RuntimeException caught when instantiating message filter for (topic:"
                                  + topic.toStringUtf8() + ", subscriber:" + subscriberId.toStringUtf8() + ")."
                                  + "It might be introduced by programming error in message filter.";
                    logger.error(errMsg, re);
                    PubSubException pse = new PubSubException.InvalidMessageFilterException(errMsg, re);
                    subStats.incrementFailedOps();
                    // we should not close the subscription channel, just response error
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

                    // client decide to close it or not.
                    channel.write(PubSubResponseUtils.getResponseForException(pse, request.getTxnId()));
                    return;
                } catch (Throwable t) {
                    String errMsg = "Failed to instantiate message filter for (topic:" + topic.toStringUtf8()
                                  + ", subscriber:" + subscriberId.toStringUtf8() + ").";
                    logger.error(errMsg, t);
                    PubSubException pse = new PubSubException.InvalidMessageFilterException(errMsg, t);
                    subStats.incrementFailedOps();
                    channel.write(PubSubResponseUtils.getResponseForException(pse, request.getTxnId()))
                    .addListener(ChannelFutureListener.CLOSE);
View Full Code Here

Examples of com.google.protobuf.ByteString.toStringUtf8()

                }
                // Try to store the subscription channel for the topic subscriber
                Channel oldChannel = subChannelMgr.put(topicSub, channel, forceAttach);
                if (null != oldChannel) {
                    PubSubException pse = new PubSubException.TopicBusyException(
                        "Subscriber " + subscriberId.toStringUtf8() + " for topic " + topic.toStringUtf8()
                        + " is already being served on a different channel " + oldChannel + ".");
                    subStats.incrementFailedOps();
                    channel.write(PubSubResponseUtils.getResponseForException(pse, request.getTxnId()))
                    .addListener(ChannelFutureListener.CLOSE);
                    return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.