checkArgument(cmd.hasGetLastMessageId()); handleGetLastMessageId(cmd.getGetLastMessageId()); cmd.getGetLastMessageId().recycle(); break;
org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.Builder subBuilder = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.newBuilder(); if (hasGetLastMessageId()) { subBuilder.mergeFrom(getGetLastMessageId());
checkArgument(cmd.hasGetLastMessageId()); handleGetLastMessageId(cmd.getGetLastMessageId()); cmd.getGetLastMessageId().recycle(); break;
if (!getGetLastMessageId().isInitialized()) { memoizedIsInitialized = 0; return false;
if (!getGetLastMessageId().isInitialized()) {
seek_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandSeek.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x08000000); getLastMessageId_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x10000000); getLastMessageIdResponse_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageIdResponse.getDefaultInstance();
reachedEndOfTopic_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandReachedEndOfTopic.getDefaultInstance(); seek_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandSeek.getDefaultInstance(); getLastMessageId_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.getDefaultInstance(); getLastMessageIdResponse_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageIdResponse.getDefaultInstance(); activeConsumerChange_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandActiveConsumerChange.getDefaultInstance();
@Override protected void handleGetLastMessageId(CommandGetLastMessageId getLastMessageId) { checkArgument(state == State.Connected); CompletableFuture<Consumer> consumerFuture = consumers.get(getLastMessageId.getConsumerId()); if (consumerFuture != null && consumerFuture.isDone() && !consumerFuture.isCompletedExceptionally()) { Consumer consumer = consumerFuture.getNow(null); long requestId = getLastMessageId.getRequestId(); Topic topic = consumer.getSubscription().getTopic(); Position position = topic.getLastMessageId(); int partitionIndex = TopicName.getPartitionIndex(topic.getName()); if (log.isDebugEnabled()) { log.debug("[{}] [{}][{}] Get LastMessageId {} partitionIndex {}", remoteAddress, topic.getName(), consumer.getSubscription().getName(), position, partitionIndex); } MessageIdData messageId = MessageIdData.newBuilder() .setLedgerId(((PositionImpl)position).getLedgerId()) .setEntryId(((PositionImpl)position).getEntryId()) .setPartition(partitionIndex) .build(); ctx.writeAndFlush(Commands.newGetLastMessageIdResponse(requestId, messageId)); } else { ctx.writeAndFlush(Commands.newError(getLastMessageId.getRequestId(), ServerError.MetadataError, "Consumer not found")); } }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId prototype) {
public Builder toBuilder() { return newBuilder(this); }
public org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId getDefaultInstanceForType() { return org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.getDefaultInstance(); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasConsumerId()) { memoizedIsInitialized = 0; return false; } if (!hasRequestId()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public static Builder newBuilder(org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public Builder clearGetLastMessageId() { getLastMessageId_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x10000000); return this; }
public static org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId parseFrom( org.apache.pulsar.shaded.com.google.protobuf.v241.CodedInputStream input, org.apache.pulsar.shaded.com.google.protobuf.v241.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); }
public static org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input)) { return builder.buildParsed(); } else { return null; } } public static org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId parseDelimitedFrom(
public static org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId parseDelimitedFrom( java.io.InputStream input, org.apache.pulsar.shaded.com.google.protobuf.v241.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input, extensionRegistry)) { return builder.buildParsed(); } else { return null; } } public static org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId parseFrom(
public static ByteBuf newGetLastMessageId(long consumerId, long requestId) { CommandGetLastMessageId.Builder cmdBuilder = CommandGetLastMessageId.newBuilder(); cmdBuilder.setConsumerId(consumerId).setRequestId(requestId); ByteBuf res = serializeWithSize(BaseCommand.newBuilder() .setType(Type.GET_LAST_MESSAGE_ID) .setGetLastMessageId(cmdBuilder.build())); cmdBuilder.recycle(); return res; }
public void writeTo(org.apache.pulsar.common.util.protobuf.ByteBufCodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeUInt64(1, consumerId_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeUInt64(2, requestId_); } }
public Builder mergeGetLastMessageId(org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId value) { if (((bitField0_ & 0x10000000) == 0x10000000) && getLastMessageId_ != org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.getDefaultInstance()) { getLastMessageId_ = org.apache.pulsar.common.api.proto.PulsarApi.CommandGetLastMessageId.newBuilder(getLastMessageId_).mergeFrom(value).buildPartial(); } else { getLastMessageId_ = value; } bitField0_ |= 0x10000000; return this; } public Builder clearGetLastMessageId() {