public class TierTopicManager extends Object implements Runnable, TierTopicAppender
TierRecordType
.
The TierTopicManager is also responsible for making all the tiering related metadata available to all brokers in the
cluster. It does this by consuming from the tier topic and materializing relevant state into the TierPartitionState
files.Constructor and Description |
---|
TierTopicManager(TierTopicManagerConfig config,
TierTopicConsumer tierTopicConsumer,
Supplier<kafka.server.InternalAdmin> internalAdminSupplier,
org.apache.kafka.common.utils.Time time,
kafka.server.ReplicaManager replicaManager,
org.apache.kafka.common.metrics.Metrics metrics)
Primary public constructor for TierTopicManager.
|
TierTopicManager(TierTopicManagerConfig config,
TierTopicConsumer tierTopicConsumer,
Supplier<org.apache.kafka.clients.producer.Producer<byte[],byte[]>> producerSupplier,
Supplier<kafka.server.InternalAdmin> internalAdminSupplier,
kafka.server.ReplicaManager replicaManager,
org.apache.kafka.common.utils.Time time,
org.apache.kafka.common.metrics.Metrics metrics)
Instantiate TierTopicManager.
|
Modifier and Type | Method and Description |
---|---|
CompletableFuture<TierPartitionState.AppendResult> |
addMetadata(AbstractTierMetadata metadata)
Write an AbstractTierMetadata to the Tier Topic, returning a
CompletableFuture that tracks the result of the materialization after the
message has been read from the tier topic, allowing the sender to determine
whether the write was fenced, or the send failed.
|
TierTopicDataLossValidator |
dataLossValidator() |
boolean |
detectDataLossInTierTopicHead() |
boolean |
isReady()
Return whether TierTopicManager is ready
|
boolean |
isReadyForWrites()
Return whether TierTopicManager is ready to accept writes.
|
static Set<org.apache.kafka.common.TopicPartition> |
partitions(String topicName,
int numPartitions) |
void |
run() |
void |
shutdown()
Shutdown the tier topic manager.
|
void |
startup() |
boolean |
tryBecomeReady(boolean startConsumerThread)
Try to move the TierTopicManager to ready state.
|
public TierTopicManager(TierTopicManagerConfig config, TierTopicConsumer tierTopicConsumer, Supplier<org.apache.kafka.clients.producer.Producer<byte[],byte[]>> producerSupplier, Supplier<kafka.server.InternalAdmin> internalAdminSupplier, kafka.server.ReplicaManager replicaManager, org.apache.kafka.common.utils.Time time, org.apache.kafka.common.metrics.Metrics metrics)
config
- tier topic manager configurationstierTopicConsumer
- tier topic consumer instanceproducerSupplier
- supplier for producer instancesinternalAdminSupplier
- supplier method for the internal admin client to be used to check on the topicreplicaManager
- replica manager instance, which is used by tier topic data loss detectiontime
- time objectmetrics
- broker metricspublic TierTopicManager(TierTopicManagerConfig config, TierTopicConsumer tierTopicConsumer, Supplier<kafka.server.InternalAdmin> internalAdminSupplier, org.apache.kafka.common.utils.Time time, kafka.server.ReplicaManager replicaManager, org.apache.kafka.common.metrics.Metrics metrics)
config
- TierTopicManagerConfig containing tiering configuration.tierTopicConsumer
- tier topic consumer instanceinternalAdminSupplier
- supplier method for the internal admin client to be used to check on the topictime
- object used to manipulate time during testingreplicaManager
- replica manager instancemetrics
- broker metricspublic void startup()
public CompletableFuture<TierPartitionState.AppendResult> addMetadata(AbstractTierMetadata metadata)
addMetadata
in interface TierTopicAppender
metadata
- metadata to be written to the tier topicpublic boolean isReady()
public boolean isReadyForWrites()
isReadyForWrites
in interface TierTopicAppender
public static Set<org.apache.kafka.common.TopicPartition> partitions(String topicName, int numPartitions)
public boolean tryBecomeReady(boolean startConsumerThread)
public void shutdown()
public boolean detectDataLossInTierTopicHead()
public TierTopicDataLossValidator dataLossValidator()