Search in sources :

Example 1 with TransactionCoordinator

use of io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator in project starlight-for-kafka by datastax.

the class KafkaProtocolHandler method initTransactionCoordinator.

public TransactionCoordinator initTransactionCoordinator(String tenant, PulsarAdmin pulsarAdmin, ClusterData clusterData) throws Exception {
    TransactionConfig transactionConfig = TransactionConfig.builder().transactionLogNumPartitions(kafkaConfig.getKafkaTxnLogTopicNumPartitions()).transactionMetadataTopicName(MetadataUtils.constructTxnLogTopicBaseName(tenant, kafkaConfig)).transactionProducerIdTopicName(MetadataUtils.constructTxnProducerIdTopicBaseName(tenant, kafkaConfig)).abortTimedOutTransactionsIntervalMs(kafkaConfig.getKafkaTxnAbortTimedOutTransactionCleanupIntervalMs()).transactionalIdExpirationMs(kafkaConfig.getKafkaTransactionalIdExpirationMs()).removeExpiredTransactionalIdsIntervalMs(kafkaConfig.getKafkaTransactionsRemoveExpiredTransactionalIdCleanupIntervalMs()).brokerId(kafkaConfig.getKafkaBrokerId()).build();
    MetadataUtils.createTxnMetadataIfMissing(tenant, pulsarAdmin, clusterData, kafkaConfig);
    TransactionCoordinator transactionCoordinator = TransactionCoordinator.of(tenant, kafkaConfig, transactionConfig, txnTopicClient, brokerService.getPulsar().getLocalMetadataStore(), kopBrokerLookupManager, OrderedScheduler.newSchedulerBuilder().name("transaction-log-manager-" + tenant).numThreads(1).build(), Time.SYSTEM);
    transactionCoordinator.startup(kafkaConfig.isKafkaTransactionalIdExpirationEnable()).get();
    return transactionCoordinator;
}
Also used : TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator) TransactionConfig(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionConfig)

Example 2 with TransactionCoordinator

use of io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator in project starlight-for-kafka by datastax.

the class KafkaRequestHandler method handleFindCoordinatorRequest.

@Override
protected void handleFindCoordinatorRequest(KafkaHeaderAndRequest findCoordinator, CompletableFuture<AbstractResponse> resultFuture) {
    checkArgument(findCoordinator.getRequest() instanceof FindCoordinatorRequest);
    FindCoordinatorRequest request = (FindCoordinatorRequest) findCoordinator.getRequest();
    String pulsarTopicName;
    int partition;
    if (request.coordinatorType() == FindCoordinatorRequest.CoordinatorType.TRANSACTION) {
        TransactionCoordinator transactionCoordinator = getTransactionCoordinator();
        partition = transactionCoordinator.partitionFor(request.coordinatorKey());
        pulsarTopicName = transactionCoordinator.getTopicPartitionName(partition);
    } else if (request.coordinatorType() == FindCoordinatorRequest.CoordinatorType.GROUP) {
        partition = getGroupCoordinator().partitionFor(request.coordinatorKey());
        pulsarTopicName = getGroupCoordinator().getTopicPartitionName(partition);
    } else {
        throw new NotImplementedException("FindCoordinatorRequest not support unknown type " + request.coordinatorType());
    }
    String groupId = request.coordinatorKey();
    String groupIdPath = GroupIdUtils.groupIdPathFormat(findCoordinator.getClientHost(), findCoordinator.getHeader().clientId());
    // Store group name to metadata store for current client, use to collect consumer metrics.
    storeGroupId(groupId, groupIdPath).whenComplete((__, ex) -> {
        if (ex != null) {
            log.warn("Store groupId failed, the groupId might already stored.", ex);
        }
        findBroker(TopicName.get(pulsarTopicName)).whenComplete((node, throwable) -> {
            if (node.error() != Errors.NONE || throwable != null) {
                log.error("[{}] Request {}: Error while find coordinator.", ctx.channel(), findCoordinator.getHeader(), throwable);
                resultFuture.complete(KafkaResponseUtils.newFindCoordinator(Errors.LEADER_NOT_AVAILABLE));
                return;
            }
            if (log.isDebugEnabled()) {
                log.debug("[{}] Found node {} as coordinator for key {} partition {}.", ctx.channel(), node.leader(), request.coordinatorKey(), partition);
            }
            resultFuture.complete(KafkaResponseUtils.newFindCoordinator(node.leader()));
        });
    });
}
Also used : FindCoordinatorRequest(org.apache.kafka.common.requests.FindCoordinatorRequest) NotImplementedException(org.apache.commons.lang3.NotImplementedException) TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator)

Example 3 with TransactionCoordinator

use of io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator in project starlight-for-kafka by datastax.

the class KafkaRequestHandler method handleInitProducerId.

@Override
protected void handleInitProducerId(KafkaHeaderAndRequest kafkaHeaderAndRequest, CompletableFuture<AbstractResponse> response) {
    InitProducerIdRequest request = (InitProducerIdRequest) kafkaHeaderAndRequest.getRequest();
    TransactionCoordinator transactionCoordinator = getTransactionCoordinator();
    transactionCoordinator.handleInitProducerId(request.transactionalId(), request.transactionTimeoutMs(), Optional.empty(), (resp) -> {
        response.complete(new InitProducerIdResponse(0, resp.getError(), resp.getProducerId(), resp.getProducerEpoch()));
    });
}
Also used : TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator) InitProducerIdRequest(org.apache.kafka.common.requests.InitProducerIdRequest) InitProducerIdResponse(org.apache.kafka.common.requests.InitProducerIdResponse)

Example 4 with TransactionCoordinator

use of io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator in project starlight-for-kafka by datastax.

the class KafkaRequestHandler method handleAddPartitionsToTxn.

@Override
protected void handleAddPartitionsToTxn(KafkaHeaderAndRequest kafkaHeaderAndRequest, CompletableFuture<AbstractResponse> response) {
    AddPartitionsToTxnRequest request = (AddPartitionsToTxnRequest) kafkaHeaderAndRequest.getRequest();
    List<TopicPartition> partitionsToAdd = request.partitions();
    Map<TopicPartition, Errors> unauthorizedTopicErrors = Maps.newConcurrentMap();
    Map<TopicPartition, Errors> nonExistingTopicErrors = Maps.newConcurrentMap();
    Set<TopicPartition> authorizedPartitions = Sets.newConcurrentHashSet();
    TransactionCoordinator transactionCoordinator = getTransactionCoordinator();
    AtomicInteger unfinishedAuthorizationCount = new AtomicInteger(partitionsToAdd.size());
    Consumer<Runnable> completeOne = (action) -> {
        action.run();
        if (unfinishedAuthorizationCount.decrementAndGet() == 0) {
            if (!unauthorizedTopicErrors.isEmpty() || !nonExistingTopicErrors.isEmpty()) {
                Map<TopicPartition, Errors> partitionErrors = Maps.newHashMap();
                partitionErrors.putAll(unauthorizedTopicErrors);
                partitionErrors.putAll(nonExistingTopicErrors);
                for (TopicPartition topicPartition : authorizedPartitions) {
                    partitionErrors.put(topicPartition, Errors.OPERATION_NOT_ATTEMPTED);
                }
                response.complete(new AddPartitionsToTxnResponse(0, partitionErrors));
            } else {
                transactionCoordinator.handleAddPartitionsToTransaction(request.transactionalId(), request.producerId(), request.producerEpoch(), authorizedPartitions, (errors) -> {
                    // TODO: handle PRODUCER_FENCED errors
                    Map<TopicPartition, Errors> topicPartitionErrorsMap = addPartitionError(partitionsToAdd, errors);
                    response.complete(new AddPartitionsToTxnResponse(0, topicPartitionErrorsMap));
                });
            }
        }
    };
    String namespacePrefix = currentNamespacePrefix();
    partitionsToAdd.forEach(tp -> {
        String fullPartitionName;
        try {
            fullPartitionName = KopTopic.toString(tp, namespacePrefix);
        } catch (KoPTopicException e) {
            log.warn("Invalid topic name: {}", tp.topic(), e);
            completeOne.accept(() -> nonExistingTopicErrors.put(tp, Errors.UNKNOWN_TOPIC_OR_PARTITION));
            return;
        }
        authorize(AclOperation.WRITE, Resource.of(ResourceType.TOPIC, fullPartitionName)).whenComplete((isAuthorized, ex) -> {
            if (ex != null) {
                log.error("AddPartitionsToTxn topic authorize failed, topic - {}. {}", fullPartitionName, ex.getMessage());
                completeOne.accept(() -> unauthorizedTopicErrors.put(tp, Errors.TOPIC_AUTHORIZATION_FAILED));
                return;
            }
            if (!isAuthorized) {
                completeOne.accept(() -> unauthorizedTopicErrors.put(tp, Errors.TOPIC_AUTHORIZATION_FAILED));
                return;
            }
            completeOne.accept(() -> authorizedPartitions.add(tp));
        });
    });
}
Also used : IsolationLevel(org.apache.kafka.common.requests.IsolationLevel) KafkaResponseUtils(io.streamnative.pulsar.handlers.kop.utils.KafkaResponseUtils) LeaveGroupRequest(org.apache.kafka.common.requests.LeaveGroupRequest) AppendRecordsContext(io.streamnative.pulsar.handlers.kop.storage.AppendRecordsContext) HeartbeatResponse(org.apache.kafka.common.requests.HeartbeatResponse) SaslAuthenticator(io.streamnative.pulsar.handlers.kop.security.SaslAuthenticator) Pair(org.apache.commons.lang3.tuple.Pair) SyncGroupRequest(org.apache.kafka.common.requests.SyncGroupRequest) ApiVersionsResponse(org.apache.kafka.common.requests.ApiVersionsResponse) MetadataUtils(io.streamnative.pulsar.handlers.kop.utils.MetadataUtils) Map(java.util.Map) RecordBatch(org.apache.kafka.common.record.RecordBatch) MutableRecordBatch(org.apache.kafka.common.record.MutableRecordBatch) PositionImpl(org.apache.bookkeeper.mledger.impl.PositionImpl) DeleteGroupsRequest(org.apache.kafka.common.requests.DeleteGroupsRequest) Set(java.util.Set) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) AddPartitionsToTxnRequest(org.apache.kafka.common.requests.AddPartitionsToTxnRequest) ListOffsetResponse(org.apache.kafka.common.requests.ListOffsetResponse) ListGroupsRequest(org.apache.kafka.common.requests.ListGroupsRequest) Slf4j(lombok.extern.slf4j.Slf4j) MemoryRecords(org.apache.kafka.common.record.MemoryRecords) Stream(java.util.stream.Stream) DeleteRecordsRequest(org.apache.kafka.common.requests.DeleteRecordsRequest) ListOffsetRequest(org.apache.kafka.common.requests.ListOffsetRequest) Errors(org.apache.kafka.common.protocol.Errors) Murmur3_32Hash(org.apache.pulsar.common.util.Murmur3_32Hash) Node(org.apache.kafka.common.Node) FetchRequest(org.apache.kafka.common.requests.FetchRequest) OffsetAndMetadata(io.streamnative.pulsar.handlers.kop.offset.OffsetAndMetadata) EntryFormatterFactory(io.streamnative.pulsar.handlers.kop.format.EntryFormatterFactory) Joiner(com.google.common.base.Joiner) AsyncCallbacks(org.apache.bookkeeper.mledger.AsyncCallbacks) AuthenticationException(org.apache.kafka.common.errors.AuthenticationException) TopicNameUtils(io.streamnative.pulsar.handlers.kop.utils.TopicNameUtils) AbstractResponse(org.apache.kafka.common.requests.AbstractResponse) WriteTxnMarkersRequest(org.apache.kafka.common.requests.WriteTxnMarkersRequest) MetadataStoreExtended(org.apache.pulsar.metadata.api.extended.MetadataStoreExtended) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) InvalidRecordException(org.apache.kafka.common.record.InvalidRecordException) ArrayList(java.util.ArrayList) GroupOverview(io.streamnative.pulsar.handlers.kop.coordinator.group.GroupMetadata.GroupOverview) FindCoordinatorRequest(org.apache.kafka.common.requests.FindCoordinatorRequest) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) BiConsumer(java.util.function.BiConsumer) THROTTLE_TIME_MS(org.apache.kafka.common.protocol.CommonFields.THROTTLE_TIME_MS) OffsetFetchResponse(org.apache.kafka.common.requests.OffsetFetchResponse) ProduceResponse(org.apache.kafka.common.requests.ProduceResponse) TENANT_ALLNAMESPACES_PLACEHOLDER(io.streamnative.pulsar.handlers.kop.KafkaServiceConfiguration.TENANT_ALLNAMESPACES_PLACEHOLDER) GroupIdUtils(io.streamnative.pulsar.handlers.kop.utils.GroupIdUtils) OffsetCommitResponse(org.apache.kafka.common.requests.OffsetCommitResponse) ResourceType(io.streamnative.pulsar.handlers.kop.security.auth.ResourceType) TxnOffsetCommitResponse(org.apache.kafka.common.requests.TxnOffsetCommitResponse) Executor(java.util.concurrent.Executor) SystemTime(org.apache.kafka.common.utils.SystemTime) OffsetMetadata(io.streamnative.pulsar.handlers.kop.offset.OffsetMetadata) DeleteRecordsResponse(org.apache.kafka.common.requests.DeleteRecordsResponse) AclOperation(org.apache.kafka.common.acl.AclOperation) PulsarService(org.apache.pulsar.broker.PulsarService) TENANT_PLACEHOLDER(io.streamnative.pulsar.handlers.kop.KafkaServiceConfiguration.TENANT_PLACEHOLDER) ExecutionException(java.util.concurrent.ExecutionException) AtomicLong(java.util.concurrent.atomic.AtomicLong) AddOffsetsToTxnResponse(org.apache.kafka.common.requests.AddOffsetsToTxnResponse) WriteTxnMarkersResponse(org.apache.kafka.common.requests.WriteTxnMarkersResponse) SimpleAclAuthorizer(io.streamnative.pulsar.handlers.kop.security.auth.SimpleAclAuthorizer) GroupCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.group.GroupCoordinator) InitProducerIdRequest(org.apache.kafka.common.requests.InitProducerIdRequest) JoinGroupRequest(org.apache.kafka.common.requests.JoinGroupRequest) TopicDetails(org.apache.kafka.common.requests.CreateTopicsRequest.TopicDetails) ProduceRequest(org.apache.kafka.common.requests.ProduceRequest) AbstractRequest(org.apache.kafka.common.requests.AbstractRequest) ControlRecordType(org.apache.kafka.common.record.ControlRecordType) DescribeGroupsRequest(org.apache.kafka.common.requests.DescribeGroupsRequest) ByteBuffer(java.nio.ByteBuffer) AddPartitionsToTxnResponse(org.apache.kafka.common.requests.AddPartitionsToTxnResponse) TopicMetadata(org.apache.kafka.common.requests.MetadataResponse.TopicMetadata) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) CreatePartitionsRequest(org.apache.kafka.common.requests.CreatePartitionsRequest) ListUtils(org.apache.commons.collections4.ListUtils) DelayedOperationPurgatory(io.streamnative.pulsar.handlers.kop.utils.delayed.DelayedOperationPurgatory) NamespaceName(org.apache.pulsar.common.naming.NamespaceName) TopicPartition(org.apache.kafka.common.TopicPartition) OrderedScheduler(org.apache.bookkeeper.common.util.OrderedScheduler) Time(org.apache.kafka.common.utils.Time) Collection(java.util.Collection) EndTxnResponse(org.apache.kafka.common.requests.EndTxnResponse) PartitionLog(io.streamnative.pulsar.handlers.kop.storage.PartitionLog) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) MessageMetadataUtils(io.streamnative.pulsar.handlers.kop.utils.MessageMetadataUtils) PulsarMetadataAccessor(io.streamnative.pulsar.handlers.kop.security.auth.PulsarMetadataAccessor) Position(org.apache.bookkeeper.mledger.Position) TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Preconditions.checkState(com.google.common.base.Preconditions.checkState) CoreUtils(io.streamnative.pulsar.handlers.kop.utils.CoreUtils) DescribeConfigsRequest(org.apache.kafka.common.requests.DescribeConfigsRequest) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) List(java.util.List) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) FutureUtil(org.apache.pulsar.common.util.FutureUtil) InitProducerIdResponse(org.apache.kafka.common.requests.InitProducerIdResponse) Optional(java.util.Optional) OffsetFinder(io.streamnative.pulsar.handlers.kop.utils.OffsetFinder) HeartbeatRequest(org.apache.kafka.common.requests.HeartbeatRequest) ReplicaManager(io.streamnative.pulsar.handlers.kop.storage.ReplicaManager) JoinGroupResponse(org.apache.kafka.common.requests.JoinGroupResponse) KoPTopicException(io.streamnative.pulsar.handlers.kop.exceptions.KoPTopicException) NotImplementedException(org.apache.commons.lang3.NotImplementedException) DeleteTopicsRequest(org.apache.kafka.common.requests.DeleteTopicsRequest) AddOffsetsToTxnRequest(org.apache.kafka.common.requests.AddOffsetsToTxnRequest) TopicName(org.apache.pulsar.common.naming.TopicName) Getter(lombok.Getter) CreateTopicsRequest(org.apache.kafka.common.requests.CreateTopicsRequest) EndTransactionMarker(org.apache.kafka.common.record.EndTransactionMarker) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) LeaderNotAvailableException(org.apache.kafka.common.errors.LeaderNotAvailableException) DescribeConfigsResponse(org.apache.kafka.common.requests.DescribeConfigsResponse) ApiError(org.apache.kafka.common.requests.ApiError) PartitionMetadata(org.apache.kafka.common.requests.MetadataResponse.PartitionMetadata) HashSet(java.util.HashSet) KeyValue(org.apache.pulsar.common.schema.KeyValue) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) Resource(io.streamnative.pulsar.handlers.kop.security.auth.Resource) ConfigResource(org.apache.kafka.common.config.ConfigResource) EntryFormatter(io.streamnative.pulsar.handlers.kop.format.EntryFormatter) PartitionResponse(org.apache.kafka.common.requests.ProduceResponse.PartitionResponse) ByteBuf(io.netty.buffer.ByteBuf) EndTxnRequest(org.apache.kafka.common.requests.EndTxnRequest) MetadataRequest(org.apache.kafka.common.requests.MetadataRequest) SyncGroupResponse(org.apache.kafka.common.requests.SyncGroupResponse) Session(io.streamnative.pulsar.handlers.kop.security.Session) Authorizer(io.streamnative.pulsar.handlers.kop.security.auth.Authorizer) ManagedLedgerImpl(org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl) Utils(org.apache.kafka.common.utils.Utils) DelayedOperation(io.streamnative.pulsar.handlers.kop.utils.delayed.DelayedOperation) KafkaRequestUtils(io.streamnative.pulsar.handlers.kop.utils.KafkaRequestUtils) KopTopic(io.streamnative.pulsar.handlers.kop.utils.KopTopic) OffsetCommitRequest(org.apache.kafka.common.requests.OffsetCommitRequest) Iterator(java.util.Iterator) SaslAuthenticateResponse(org.apache.kafka.common.requests.SaslAuthenticateResponse) AlterConfigsResponse(org.apache.kafka.common.requests.AlterConfigsResponse) TransactionResult(org.apache.kafka.common.requests.TransactionResult) UTF_8(java.nio.charset.StandardCharsets.UTF_8) PulsarAdminException(org.apache.pulsar.client.admin.PulsarAdminException) OffsetFetchRequest(org.apache.kafka.common.requests.OffsetFetchRequest) TxnOffsetCommitRequest(org.apache.kafka.common.requests.TxnOffsetCommitRequest) ApiKeys(org.apache.kafka.common.protocol.ApiKeys) Maps(com.google.common.collect.Maps) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) AlterConfigsRequest(org.apache.kafka.common.requests.AlterConfigsRequest) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) ApiException(org.apache.kafka.common.errors.ApiException) TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator) AddPartitionsToTxnResponse(org.apache.kafka.common.requests.AddPartitionsToTxnResponse) Errors(org.apache.kafka.common.protocol.Errors) KoPTopicException(io.streamnative.pulsar.handlers.kop.exceptions.KoPTopicException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) AddPartitionsToTxnRequest(org.apache.kafka.common.requests.AddPartitionsToTxnRequest) TopicPartition(org.apache.kafka.common.TopicPartition) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Example 5 with TransactionCoordinator

use of io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator in project kop by streamnative.

the class KafkaRequestHandler method handleInitProducerId.

@Override
protected void handleInitProducerId(KafkaHeaderAndRequest kafkaHeaderAndRequest, CompletableFuture<AbstractResponse> response) {
    InitProducerIdRequest request = (InitProducerIdRequest) kafkaHeaderAndRequest.getRequest();
    TransactionCoordinator transactionCoordinator = getTransactionCoordinator();
    transactionCoordinator.handleInitProducerId(request.transactionalId(), request.transactionTimeoutMs(), Optional.empty(), (resp) -> {
        response.complete(new InitProducerIdResponse(0, resp.getError(), resp.getProducerId(), resp.getProducerEpoch()));
    });
}
Also used : TransactionCoordinator(io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator) InitProducerIdRequest(org.apache.kafka.common.requests.InitProducerIdRequest) InitProducerIdResponse(org.apache.kafka.common.requests.InitProducerIdResponse)

Aggregations

TransactionCoordinator (io.streamnative.pulsar.handlers.kop.coordinator.transaction.TransactionCoordinator)18 PulsarAdminException (org.apache.pulsar.client.admin.PulsarAdminException)5 TopicName (org.apache.pulsar.common.naming.TopicName)5 GroupCoordinator (io.streamnative.pulsar.handlers.kop.coordinator.group.GroupCoordinator)4 NotImplementedException (org.apache.commons.lang3.NotImplementedException)4 TopicPartition (org.apache.kafka.common.TopicPartition)4 AddOffsetsToTxnRequest (org.apache.kafka.common.requests.AddOffsetsToTxnRequest)4 AddOffsetsToTxnResponse (org.apache.kafka.common.requests.AddOffsetsToTxnResponse)4 EndTxnRequest (org.apache.kafka.common.requests.EndTxnRequest)4 EndTxnResponse (org.apache.kafka.common.requests.EndTxnResponse)4 FindCoordinatorRequest (org.apache.kafka.common.requests.FindCoordinatorRequest)4 NamespaceName (org.apache.pulsar.common.naming.NamespaceName)4 Sets (com.google.common.collect.Sets)3 ReplicaManager (io.streamnative.pulsar.handlers.kop.storage.ReplicaManager)3 FetchRequest (org.apache.kafka.common.requests.FetchRequest)3 InitProducerIdRequest (org.apache.kafka.common.requests.InitProducerIdRequest)3 InitProducerIdResponse (org.apache.kafka.common.requests.InitProducerIdResponse)3 OffsetFetchRequest (org.apache.kafka.common.requests.OffsetFetchRequest)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)2