public class KRaftMetadataCollector extends Object implements org.apache.kafka.image.publisher.MetadataPublisher
Constructor and Description |
---|
KRaftMetadataCollector(org.apache.kafka.common.metrics.Metrics metrics,
boolean fullConfigsEnable,
int snapshotInitDelaySec,
int snapshotIntervalSec,
int maxBytesInSnapshot,
String destTopic,
int nodeId,
kafka.server.KafkaConfig kafkaConfig,
org.apache.kafka.common.utils.Time time,
String clusterId) |
Modifier and Type | Method and Description |
---|---|
Runnable |
emitMetadataSnapshot() |
io.confluent.protobuf.events.catalog.v1.MetadataEvent |
getMetadataUpdateEventFromClusterLinkImage(org.apache.kafka.image.MetadataImage metadataImage,
org.apache.kafka.metadata.ClusterLink clusterLinkImage,
boolean isDelta,
boolean isUpdate)
Generate the metadata event for the target cluster link.
|
io.confluent.protobuf.events.catalog.v1.MetadataEvent |
getMetadataUpdateEventFromTopicImage(org.apache.kafka.image.MetadataImage metadataImage,
org.apache.kafka.image.TopicImage topicImage,
boolean isDelta,
boolean isUpdate,
org.apache.kafka.metadata.MirrorTopic mirrorInfo)
Generate the metadata event for the target topic.
|
boolean |
isActive()
An active collector means it is emitting snapshots and change deltas.
|
String |
name() |
void |
onControllerChange(org.apache.kafka.raft.LeaderAndEpoch leader)
Called on each change to leadership.
|
void |
onMetadataUpdate(org.apache.kafka.image.MetadataDelta metadataDelta,
org.apache.kafka.image.MetadataImage newMetadataImage,
org.apache.kafka.image.loader.LoaderManifest loaderManifest) |
void |
start()
Start collector, it does not necessarily mean this collector is immediately going to emit snapshots or change deltas.
|
void |
stop()
Stop collector, it will eventually stop emitting snapshots and change deltas.
|
public KRaftMetadataCollector(org.apache.kafka.common.metrics.Metrics metrics, boolean fullConfigsEnable, int snapshotInitDelaySec, int snapshotIntervalSec, int maxBytesInSnapshot, String destTopic, int nodeId, kafka.server.KafkaConfig kafkaConfig, org.apache.kafka.common.utils.Time time, String clusterId)
public String name()
name
in interface org.apache.kafka.image.publisher.MetadataPublisher
public void start()
public void stop() throws InterruptedException
InterruptedException
public boolean isActive()
public void onControllerChange(org.apache.kafka.raft.LeaderAndEpoch leader)
onControllerChange
in interface org.apache.kafka.image.publisher.MetadataPublisher
public void onMetadataUpdate(org.apache.kafka.image.MetadataDelta metadataDelta, org.apache.kafka.image.MetadataImage newMetadataImage, org.apache.kafka.image.loader.LoaderManifest loaderManifest)
onMetadataUpdate
in interface org.apache.kafka.image.publisher.MetadataPublisher
public Runnable emitMetadataSnapshot()
public io.confluent.protobuf.events.catalog.v1.MetadataEvent getMetadataUpdateEventFromTopicImage(org.apache.kafka.image.MetadataImage metadataImage, org.apache.kafka.image.TopicImage topicImage, boolean isDelta, boolean isUpdate, @Nullable org.apache.kafka.metadata.MirrorTopic mirrorInfo)
metadataImage
- the current metadata imagetopicImage
- the image for the target topicisDelta
- whether the generated event is a delta event, i.e. creation or updateisUpdate
- whether the generated event is update event, valid only if isDelta is truepublic io.confluent.protobuf.events.catalog.v1.MetadataEvent getMetadataUpdateEventFromClusterLinkImage(org.apache.kafka.image.MetadataImage metadataImage, org.apache.kafka.metadata.ClusterLink clusterLinkImage, boolean isDelta, boolean isUpdate)
metadataImage
- the current metadata imageclusterLinkImage
- the image for cluster linkisDelta
- whether the generated event is a delta event, i.e. creation or updateisUpdate
- whether the generated event is update event, valid only if isDelta is true