Examples of toStringUtf8()


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

                if (entryId + topicInfo.currentLedgerRange.getStartSeqIdIncluded() != localSeqId) {
                    String msg = "Expected BK to assign entry-id: "
                                 + (localSeqId - topicInfo.currentLedgerRange.getStartSeqIdIncluded())
                                 + " but it instead assigned entry-id: " + entryId + " topic: "
                                 + topic.toStringUtf8() + "ledger: " + lh.getId();
                    logger.error(msg);
                    throw new UnexpectedError(msg);
                }

                topicInfo.lastEntryIdAckedInCurrentLedger = entryId;
View Full Code Here

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

                    entryId + topicInfo.currentLedgerRange.getStartSeqIdIncluded() == topicInfo.lastSeqIdBeforeLedgerChange) {
                    // change ledger
                    changeLedger(topic, new Callback<Void>() {
                        @Override
                        public void operationFailed(Object ctx, PubSubException exception) {
                            logger.error("Failed to change ledger for topic " + topic.toStringUtf8(), exception);
                            // change ledger failed, we should give up topic
                            releaseTopicIfRequested(request.topic, exception, ctx);
                        }
                        @Override
                        public void operationFinished(Object ctx, Void resultOfOperation) {
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.debug(msg);
                    cb.operationFailed(ctx, new PubSubException.ClientAlreadySubscribedException(msg));
                    return;
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()));
                }

                cb.operationFinished(ctx, subscriptionState.getLastConsumeSeqId());
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.debug(msg);
                cb.operationFailed(ctx, new PubSubException.ClientNotSubscribedException(msg));
                return;
            }
View Full Code Here

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

                public void operationFinished(Object ctx, Void resultOfOperation) {
                    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
                            deleteSubscriptionState(topic, subscriberId, 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() {
                                    // we should decrement local count when remote subscription failed
View Full Code Here

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

              ByteString rawValue = row.getValues(i).getValue();
              if (byte[].class.isAssignableFrom(aClass)) {
                res.add(rawValue.toByteArray());
                continue;
              }
              String data = rawValue.toStringUtf8();
              if (String.class.isAssignableFrom(aClass)) {
                res.add(data);
              } else if (Boolean.class.isAssignableFrom(aClass)) {
                res.add(!data.isEmpty() && data.charAt(0) != '0');
              } else if (Integer.class.isAssignableFrom(aClass)) {
View Full Code Here

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

  public String getString(String key) throws IOException {
    ByteString val = get(ByteString.copyFromUtf8(key));
    if (val == null)
      return null;
    return val.toStringUtf8();
  }

  public <T> T fold(final KeyValueIter<T> entryIter, T acc) throws IOException {

    final int expiry_time = opts.expiry_time();
View Full Code Here

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

    int len = (int) file.length();
    byte[] data = new byte[len];
    file.read(data);

    ByteString s = ByteString.copyFrom(data);
    String ss = s.toStringUtf8()
   
    return ss;
  }

  public void release() throws IOException {
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.