Examples of toStringUtf8()


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

                @Override
                public void operationFinished(Object ctx, final Version version) {
                    Callback<Void> cb2 = new Callback<Void>() {
                        @Override
                        public void operationFailed(final Object ctx, final PubSubException exception) {
                            logger.error("subscription for subscriber " + subscriberId.toStringUtf8() + " to topic "
                                         + topic.toStringUtf8() + " failed due to failed listener callback", exception);
                            // should remove subscription when synchronized cross-region subscription failed
                            deleteSubscriptionData(topic, subscriberId, version, new Callback<Void>() {
                                @Override
                                public void operationFinished(Object context,
View Full Code Here

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

                                    finish();
                                }
                                @Override
                                public void operationFailed(Object context,
                                        PubSubException ex) {
                                    logger.error("Remove subscription for subscriber " + subscriberId.toStringUtf8() + " to topic "
                                                 + topic.toStringUtf8() + " failed : ", ex);
                                    finish();
                                }
                                private void finish() {
                                    cb.operationFailed(ctx, exception);
View Full Code Here

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

        int numEntries = map.getEntriesCount();
        for (int i=0; i<numEntries; i++) {
            PubSubProtocol.Map.Entry entry = map.getEntries(i);
            String key = entry.getKey();
            ByteString value = entry.getValue();
            sb.append(key).append('=').append(value.toStringUtf8());
            if (i != (numEntries - 1)) {
                sb.append(',');
            }
        }
        return sb.toString();
View Full Code Here

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

        for (int i=0; i<numEntries; i++) {
            PubSubProtocol.Map.Entry entry = protoMap.getEntries(i);
            String key = entry.getKey();
            if (javaMap.containsKey(key)) {
                ByteString preValue = javaMap.get(key);
                logger.warn("Key " + key + " has already been defined as value : " + preValue.toStringUtf8());
            } else {
                javaMap.put(key, entry.getValue());
            }
        }
        return javaMap;
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()

                    Map<String, ByteString> props = MapUtils.buildMap(header.getProperties());
                    ByteString value = props.get(OPT_MOD);
                    if (null == value) {
                        return false;
                    }
                    int intValue = Integer.valueOf(value.toStringUtf8());
                    if (0 != intValue) {
                        return false;
                    }
                    return true;
                } else {
View Full Code Here

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

        final AtomicBoolean inRedirectLoop = new AtomicBoolean(false);
        numDone.set(0);
        for (int i=0; i<numSubscribers; i++) {
            ByteString subId = ByteString.copyFromUtf8("sub-" + i);
            if (logger.isDebugEnabled()) {
                logger.debug("subscriber " + subId.toStringUtf8() + " subscribes topic " + topic.toStringUtf8());
            }
            subscriber.asyncSubscribe(topic, subId, CreateOrAttach.CREATE_OR_ATTACH,
                new Callback<Void>() {
               
                    private void tick() {
View Full Code Here

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

                    ByteString subId;
                    while (true) {
                        subId = subscribers.take();
                       
                        if (logger.isDebugEnabled()) {
                            logger.debug("subscriber " + subId.toStringUtf8() + " subscribes topic " + topic.toStringUtf8());
                        }
                        subscriber.asyncSubscribe(topic, subId, CreateOrAttach.CREATE_OR_ATTACH,
                            new SubCallback(subId), null);
                    }
                    // subscriber.asyncSubscribe(topic, subscriberId, mode, callback, context)
View Full Code Here

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

        }

        // if the topic is changing ledger, queue following persist requests until ledger is changed
        if (topicInfo.doChangeLedger.get()) {
            logger.info("Topic {} is changing ledger, so queue persist request for message.",
                        topic.toStringUtf8());
            topicInfo.deferredRequests.add(request);
            return;
        }

        final long localSeqId = topicInfo.lastSeqIdPushed.getLocalComponent() + 1;
View Full Code Here

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

                    return;
                }
                if (rc != BKException.Code.OK) {
                    BKException bke = BKException.create(rc);
                    logger.error("Error while persisting entry to ledger: " + lh.getId() + " for topic: "
                                 + topic.toStringUtf8(), bke);
                    request.getCallback().operationFailed(ctx, new PubSubException.ServiceDownException(bke));

                    // To preserve ordering guarantees, we
                    // should give up the topic and not let
                    // other operations through
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.