@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.pubsub.v1.PublishResponse getDefaultInstanceForType() { return com.google.pubsub.v1.PublishResponse.getDefaultInstance(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getMessageIdsCount() > 0) { hash = (37 * hash) + MESSAGE_IDS_FIELD_NUMBER; hash = (53 * hash) + getMessageIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < messageIds_.size(); i++) { dataSize += computeStringSizeNoTag(messageIds_.getRaw(i)); } size += dataSize; size += 1 * getMessageIdsList().size(); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
@Override public void onSuccess(PublishResponse result) { try { if (result.getMessageIdsCount() != outstandingBatch.size()) { Throwable t = new IllegalStateException( String.format( "The publish result count %s does not match " + "the expected %s results. Please contact Cloud Pub/Sub support " + "if this frequently occurs", result.getMessageIdsCount(), outstandingBatch.size())); for (OutstandingPublish oustandingMessage : outstandingBatch.outstandingPublishes) { oustandingMessage.publishResult.setException(t); } return; } Iterator<OutstandingPublish> messagesResultsIt = outstandingBatch.outstandingPublishes.iterator(); for (String messageId : result.getMessageIdsList()) { messagesResultsIt.next().publishResult.set(messageId); } } finally { messagesWaiter.incrementPendingMessages(-outstandingBatch.size()); } }
@Override public void splitResponse( PublishResponse batchResponse, Collection<? extends BatchedRequestIssuer<PublishResponse>> batch) { int batchMessageIndex = 0; for (BatchedRequestIssuer<PublishResponse> responder : batch) { List<String> subresponseElements = new ArrayList<>(); long subresponseCount = responder.getMessageCount(); for (int i = 0; i < subresponseCount; i++) { subresponseElements.add(batchResponse.getMessageIds(batchMessageIndex)); batchMessageIndex += 1; } PublishResponse response = PublishResponse.newBuilder().addAllMessageIds(subresponseElements).build(); responder.setResponse(response); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (getMessageIdsCount() > 0) { hash = (37 * hash) + MESSAGE_IDS_FIELD_NUMBER; hash = (53 * hash) + getMessageIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.PublishResponse)) { return super.equals(obj); } com.google.pubsub.v1.PublishResponse other = (com.google.pubsub.v1.PublishResponse) obj; boolean result = true; result = result && getMessageIdsList().equals(other.getMessageIdsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public com.google.pubsub.v1.PublishResponse buildPartial() { com.google.pubsub.v1.PublishResponse result = new com.google.pubsub.v1.PublishResponse(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) == 0x00000001)) { messageIds_ = messageIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); } result.messageIds_ = messageIds_; onBuilt(); return result; }
@java.lang.Override public com.google.pubsub.v1.PublishResponse build() { com.google.pubsub.v1.PublishResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
messageIds_ = messageIds_.getUnmodifiableView(); makeExtensionsImmutable();
@Override public int publish(TopicPath topic, List<OutgoingMessage> outgoingMessages) throws IOException { PublishRequest.Builder request = PublishRequest.newBuilder().setTopic(topic.getPath()); for (OutgoingMessage outgoingMessage : outgoingMessages) { PubsubMessage.Builder message = PubsubMessage.newBuilder().setData(ByteString.copyFrom(outgoingMessage.elementBytes)); if (outgoingMessage.attributes != null) { message.putAllAttributes(outgoingMessage.attributes); } if (timestampAttribute != null) { message .getMutableAttributes() .put(timestampAttribute, String.valueOf(outgoingMessage.timestampMsSinceEpoch)); } if (idAttribute != null && !Strings.isNullOrEmpty(outgoingMessage.recordId)) { message.getMutableAttributes().put(idAttribute, outgoingMessage.recordId); } request.addMessages(message); } PublishResponse response = publisherStub().publish(request.build()); return response.getMessageIdsCount(); }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < messageIds_.size(); i++) { dataSize += computeStringSizeNoTag(messageIds_.getRaw(i)); } size += dataSize; size += 1 * getMessageIdsList().size(); } memoizedSize = size; return size; }
public static Builder newBuilder(com.google.pubsub.v1.PublishResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.pubsub.v1.PublishResponse)) { return super.equals(obj); } com.google.pubsub.v1.PublishResponse other = (com.google.pubsub.v1.PublishResponse) obj; boolean result = true; result = result && getMessageIdsList() .equals(other.getMessageIdsList()); return result; }
public com.google.pubsub.v1.PublishResponse buildPartial() { com.google.pubsub.v1.PublishResponse result = new com.google.pubsub.v1.PublishResponse(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) == 0x00000001)) { messageIds_ = messageIds_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); } result.messageIds_ = messageIds_; onBuilt(); return result; }
public com.google.pubsub.v1.PublishResponse build() { com.google.pubsub.v1.PublishResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();