public class SharePartitionManager extends Object implements AutoCloseable
Constructor and Description |
---|
SharePartitionManager(kafka.server.ReplicaManager replicaManager,
org.apache.kafka.common.utils.Time time,
org.apache.kafka.server.share.ShareSessionCache cache,
int recordLockDurationMs,
int maxDeliveryCount,
int maxInFlightMessages,
org.apache.kafka.server.group.share.Persister persister,
org.apache.kafka.common.metrics.Metrics metrics) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareAcknowledgeResponseData.PartitionData>> |
acknowledge(String memberId,
String groupId,
Map<org.apache.kafka.common.TopicIdPartition,List<org.apache.kafka.server.share.ShareAcknowledgementBatch>> acknowledgeTopics)
The acknowledge method is used to acknowledge the messages that have been fetched.
|
void |
close() |
CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareFetchResponseData.PartitionData>> |
fetchMessages(String groupId,
String memberId,
org.apache.kafka.storage.internals.log.FetchParams fetchParams,
List<org.apache.kafka.common.TopicIdPartition> topicIdPartitions,
Map<org.apache.kafka.common.TopicIdPartition,Integer> partitionMaxBytes)
The fetch messages method is used to fetch messages from the log for the specified topic-partitions.
|
ShareFetchContext |
newContext(String groupId,
Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.requests.ShareFetchRequest.SharePartitionData> shareFetchData,
List<org.apache.kafka.common.TopicIdPartition> toForget,
org.apache.kafka.common.requests.ShareFetchMetadata reqMetadata)
The newContext method is used to create a new share fetch context for every share fetch request.
|
CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareAcknowledgeResponseData.PartitionData>> |
releaseAcquiredRecords(String groupId,
String memberId)
The release acquired records method is used to release the acquired records for the specified topic-partitions.
|
public SharePartitionManager(kafka.server.ReplicaManager replicaManager, org.apache.kafka.common.utils.Time time, org.apache.kafka.server.share.ShareSessionCache cache, int recordLockDurationMs, int maxDeliveryCount, int maxInFlightMessages, org.apache.kafka.server.group.share.Persister persister, org.apache.kafka.common.metrics.Metrics metrics)
public CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareFetchResponseData.PartitionData>> fetchMessages(String groupId, String memberId, org.apache.kafka.storage.internals.log.FetchParams fetchParams, List<org.apache.kafka.common.TopicIdPartition> topicIdPartitions, Map<org.apache.kafka.common.TopicIdPartition,Integer> partitionMaxBytes)
groupId
- The group id, this is used to identify the share group.memberId
- The member id, generated by the group-coordinator, this is used to identify the client.fetchParams
- The fetch parameters from the share fetch request.topicIdPartitions
- The topic-partitions to fetch messages for.partitionMaxBytes
- The maximum number of bytes to fetch for each partition.public CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareAcknowledgeResponseData.PartitionData>> acknowledge(String memberId, String groupId, Map<org.apache.kafka.common.TopicIdPartition,List<org.apache.kafka.server.share.ShareAcknowledgementBatch>> acknowledgeTopics)
memberId
- The member id, generated by the group-coordinator, this is used to identify the client.groupId
- The group id, this is used to identify the share group.acknowledgeTopics
- The acknowledge topics and their corresponding acknowledge batches.public CompletableFuture<Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.message.ShareAcknowledgeResponseData.PartitionData>> releaseAcquiredRecords(String groupId, String memberId)
groupId
- The group id, this is used to identify the share group.memberId
- The member id, generated by the group-coordinator, this is used to identify the client.public ShareFetchContext newContext(String groupId, Map<org.apache.kafka.common.TopicIdPartition,org.apache.kafka.common.requests.ShareFetchRequest.SharePartitionData> shareFetchData, List<org.apache.kafka.common.TopicIdPartition> toForget, org.apache.kafka.common.requests.ShareFetchMetadata reqMetadata)
groupId
- The group id in the share fetch request.shareFetchData
- The topic-partitions and their corresponding maxBytes data in the share fetch request.toForget
- The topic-partitions to forget present in the share fetch request.reqMetadata
- The metadata in the share fetch request.public void close() throws Exception
close
in interface AutoCloseable
Exception