Examples of toStringUtf8()


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

                                    .setPreferences(subData.getPreferences());
                                ResponseBody respBody = ResponseBody.newBuilder()
                                    .setSubscribeResponse(subRespBuilder).build();
                                channel.write(PubSubResponseUtils.getSuccessResponse(request.getTxnId(), respBody));
                                logger.info("Subscribe request (" + request.getTxnId() + ") for (topic:"
                                            + topic.toStringUtf8() + ", subscriber:" + subscriberId.toStringUtf8()
                                            + ") from channel " + channel.getRemoteAddress()
                                            + " succeed - its subscription data is "
                                            + SubscriptionStateUtils.toString(subData));
                                subStats.updateLatency(MathUtils.now() - requestTime);
                            }
View Full Code Here

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

                            topicSubs.put(subscriberId, subData);
                        } catch (ParseException e) {
                            StringBuilder sb = new StringBuilder();
                            sb.append("Failed to deserialize subscription data for topic: ")
                                    .append(topic.toStringUtf8()).append(", subscriberId: ")
                                    .append(subscriberId.toStringUtf8());
                            String msg = sb.toString();
                            logger.error(msg, e);
                            callback.operationFailed(ctx, new PubSubException.UnexpectedConditionException(msg));
                            return;
                        } catch (UnsupportedEncodingException e) {
View Full Code Here

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

                            callback.operationFailed(ctx, new PubSubException.UnexpectedConditionException(msg));
                            return;
                        } catch (UnsupportedEncodingException e) {
                            StringBuilder sb = new StringBuilder();
                            sb.append("Subscription data for topic: ").append(topic.toStringUtf8())
                                    .append(", subscriberId: ").append(subscriberId.toStringUtf8())
                                    .append(" is not UTF-8 encoded.");
                            String msg = sb.toString();
                            logger.error(msg, e);
                            callback.operationFailed(ctx, new PubSubException.UnexpectedConditionException(msg));
                            return;
View Full Code Here

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

                    if (stop) {
                        break;
                    }
                }
                ByteString t = iter.next();
                topics.add(t.toStringUtf8());
            }
            if (!stop) {
                System.out.println(topics);
            }
        }
View Full Code Here

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

                            public void safeProcessResult(int rc, String path, Object ctx, byte[] data, Stat stat) {

                                if (rc != Code.OK.intValue()) {
                                    KeeperException e = ZkUtils.logErrorAndCreateZKException(
                                                            "Could not read subscription data for topic: " + topic.toStringUtf8()
                                                            + ", subscriberId: " + subscriberId.toStringUtf8(), path, rc);
                                    reportFailure(new PubSubException.ServiceDownException(e));
                                    return;
                                }

                                if (failed.get()) {
View Full Code Here

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

                                    subData = new Versioned<SubscriptionData>(
                                            SubscriptionStateUtils.parseSubscriptionData(data),
                                            new ZkVersion(stat.getVersion()));
                                } catch (InvalidProtocolBufferException ex) {
                                    String msg = "Failed to deserialize subscription data for topic: " + topic.toStringUtf8()
                                                 + " subscriberId: " + subscriberId.toStringUtf8();
                                    logger.error(msg, ex);
                                    reportFailure(new PubSubException.UnexpectedConditionException(msg));
                                    return;
                                }
View Full Code Here

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

            CreateOrAttach createOrAttach = subRequest.getCreateOrAttach();

            if (subscriptionState != null) {

                if (createOrAttach.equals(CreateOrAttach.CREATE)) {
                    String msg = "Topic: " + topic.toStringUtf8() + " subscriberId: " + subscriberId.toStringUtf8()
                                 + " requested creating a subscription but it is already subscribed with state: "
                                 + SubscriptionStateUtils.toString(subscriptionState.getSubscriptionState());
                    logger.error(msg);
                    cb.operationFailed(ctx, new PubSubException.ClientAlreadySubscribedException(msg));
                    return;
View Full Code Here

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

                        }

                        @Override
                        public void operationFinished(Object ctx, Void resultOfOperation) {
                            if (logger.isDebugEnabled()) {
                                logger.debug("Topic: " + topic.toStringUtf8() + " subscriberId: " + subscriberId.toStringUtf8()
                                             + " attaching to subscription with state: "
                                             + SubscriptionStateUtils.toString(subscriptionState.getSubscriptionState())
                                             + ", with preferences: "
                                             + SubscriptionStateUtils.toString(subscriptionState.getSubscriptionPreferences()));
                            }
View Full Code Here

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

                    return;
                }

                // otherwise just attach
                if (logger.isDebugEnabled()) {
                    logger.debug("Topic: " + topic.toStringUtf8() + " subscriberId: " + subscriberId.toStringUtf8()
                                 + " attaching to subscription with state: "
                                 + SubscriptionStateUtils.toString(subscriptionState.getSubscriptionState())
                                 + ", with preferences: "
                                 + SubscriptionStateUtils.toString(subscriptionState.getSubscriptionPreferences()));
                }
View Full Code Here

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

                return;
            }

            // we don't have a mapping for this subscriber
            if (createOrAttach.equals(CreateOrAttach.ATTACH)) {
                String msg = "Topic: " + topic.toStringUtf8() + " subscriberId: " + subscriberId.toStringUtf8()
                             + " requested attaching to an existing subscription but it is not subscribed";
                logger.error(msg);
                cb.operationFailed(ctx, new PubSubException.ClientNotSubscribedException(msg));
                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.