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)
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)
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.
|
boolean |
isReady()
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)
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 topicpublic TierTopicManager(TierTopicManagerConfig config, TierTopicConsumer tierTopicConsumer, Supplier<kafka.server.InternalAdmin> internalAdminSupplier, org.apache.kafka.common.utils.Time time)
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 testingpublic void startup()
public CompletableFuture<TierPartitionState.AppendResult> addMetadata(AbstractTierMetadata metadata)
addMetadata
in interface TierTopicAppender
metadata
- metadata to be written to the tier topicpublic boolean isReady()
isReady
in interface TierTopicAppender
public static Set<org.apache.kafka.common.TopicPartition> partitions(String topicName, int numPartitions)
public boolean tryBecomeReady(boolean startConsumerThread)
public void shutdown()