Class TxEQAssignor
java.lang.Object
org.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor
org.oracle.okafka.clients.consumer.TxEQAssignor
- All Implemented Interfaces:
org.apache.kafka.clients.consumer.ConsumerPartitionAssignor
public class TxEQAssignor
extends org.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor
With Oracle Transactional Event Queue (TxEQ) and in Oracle RAC environment, different partitions of a Topic can be owned
by different RAC instances. To get maximum throughput while consuming messages from these partitions,
best case is to consume messages from local partitions. That means, if a session 1 is connected to Oracle RAC instance 1,
then it is preferable to assign partitions owned by instance 1 to session 1.
If session 1 is assigned a topic-partition owned by instance 2, then consuming messages from these 'Remote' partition
involves additional overhead and slows down the performance.
AbstractPartitionAssignor.assign(org.apache.kafka.common.Cluster, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.GroupSubscription)
method tries to distribute partitions so that, preference is given to Local assignment.
This follows below logic for assigning partitions.
1. Equal and fair distribution of partitions among alive consumer sessions
2. 1st Preference for Local Assignment
3. 2nd Preference for Sticky Assignment-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor
org.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor.MemberInfo
Nested classes/interfaces inherited from interface org.apache.kafka.clients.consumer.ConsumerPartitionAssignor
org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Assignment, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.GroupAssignment, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.GroupSubscription, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.RebalanceProtocol, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Subscription
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.kafka.common.TopicPartition>
allPartitionsSorted
(Map<String, Integer> partitionsPerTopic, Map<String, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Subscription> subscriptions) assign
(Map<String, Integer> partitionsPerTopic, Map<String, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Subscription> subscriptions) assign
(Map<String, Integer> partitionsPerTopic, Map<String, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Subscription> subscriptions, int oldVersion) name()
void
setInstPListMap
(Map<Integer, ArrayList<Integer>> _instPListMap) void
setPartitionMemberMap
(Map<String, ArrayList<org.oracle.okafka.common.internals.SessionData>> _partitionMemberMap) Methods inherited from class org.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor
assign, assignPartitions, partitionInfosWithoutRacks, partitions, put, useRackAwareAssignment
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.kafka.clients.consumer.ConsumerPartitionAssignor
onAssignment, subscriptionUserData, supportedProtocols, version
-
Constructor Details
-
TxEQAssignor
public TxEQAssignor()
-
-
Method Details
-
setInstPListMap
-
setPartitionMemberMap
-
assign
-
assign
public Map<String,List<org.apache.kafka.common.TopicPartition>> assign(Map<String, Integer> partitionsPerTopic, Map<String, org.apache.kafka.clients.consumer.ConsumerPartitionAssignor.Subscription> subscriptions) - Specified by:
assign
in classorg.apache.kafka.clients.consumer.internals.AbstractPartitionAssignor
-
allPartitionsSorted
-
name
-