Class MetadataNodeManager
java.lang.Object
io.confluent.security.store.kafka.coordinator.MetadataNodeManager
- All Implemented Interfaces:
MetadataServiceRebalanceListener
Node manager for Metadata Service. A Kafka group coordinator is used to manage active nodes
and elect a single master writer.
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataNodeManager(Collection<URL> nodeUrls, KafkaStoreConfig config, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionactiveNodeUrls(String protocol) voidbooleanmasterWriterUrl(String protocol) voidonAssigned(MetadataServiceAssignment assignment, int generationId) Assignment completion notification generated when rebalance completes.voidonRevoked(int generationId) Assignment revocation notification generated when rebalance commences.voidonWriterResigned(int generationId) Writer resignation notification generated by the writer when an error is encountered, cache refresh times out or a generation marker with newer generation is is received.voidregisterWriter(Writer writer) Registers a writer with this node manager.start()
-
Constructor Details
-
MetadataNodeManager
public MetadataNodeManager(Collection<URL> nodeUrls, KafkaStoreConfig config, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
registerWriter
Registers a writer with this node manager. Can be called before or afterstart():- Pre-start: the writer joins the registry; the next
onAssignedwill start it alongside the others. - Post-start: the writer is enqueued on the manager-thread so we observe a consistent
master state. If we are currently the master writer,
startWriteris invoked on the late registrant for the active generation so it doesn't miss the assignment. If we are not master, it just joins the registry — the nextonAssigned(oronRevoked) will pick it up.
Independence requirement. Registered writers must be independent of each other. This manager makes no ordering guarantees on either start or stop.
- Pre-start: the writer joins the registry; the next
-
start
-
isMasterWriter
public boolean isMasterWriter() -
masterWriterUrl
-
activeNodeUrls
-
onAssigned
Description copied from interface:MetadataServiceRebalanceListenerAssignment completion notification generated when rebalance completes.- Specified by:
onAssignedin interfaceMetadataServiceRebalanceListener
-
onRevoked
public void onRevoked(int generationId) Description copied from interface:MetadataServiceRebalanceListenerAssignment revocation notification generated when rebalance commences.- Specified by:
onRevokedin interfaceMetadataServiceRebalanceListener
-
onWriterResigned
public void onWriterResigned(int generationId) Description copied from interface:MetadataServiceRebalanceListenerWriter resignation notification generated by the writer when an error is encountered, cache refresh times out or a generation marker with newer generation is is received. This is used to trigger re-election.- Specified by:
onWriterResignedin interfaceMetadataServiceRebalanceListener
-
close
-