@ThreadSafe public class MetadataCollectorEventQueue extends Object implements AutoCloseable
KafkaEventQueue
with some custom method for ZKTopicMetadataCollector.Constructor and Description |
---|
MetadataCollectorEventQueue(org.apache.kafka.common.utils.Time time)
Create the MetadataCollectorEventQueue.
|
Modifier and Type | Method and Description |
---|---|
void |
append(MetadataCollectorEvent event)
Append a TopicChangeEvent to this queue.
|
void |
appendWithTag(String tag,
MetadataCollectorEvent event)
A custom function to append a TopicChangeEvent to this queue with a tag.
|
void |
cancel(String tag)
A custom function to cancel event of tag in this queue.
|
void |
close()
Synchronously shutdown the event queue.
|
void |
scheduleDeferred(String tag,
Function<OptionalLong,OptionalLong> deadlineNsCalculator,
MetadataCollectorEvent event)
Schedule a TopicChangeEvent to run with delay.
|
public MetadataCollectorEventQueue(org.apache.kafka.common.utils.Time time)
public void close() throws InterruptedException
close
in interface AutoCloseable
InterruptedException
KafkaEventQueue.close()
public void scheduleDeferred(String tag, Function<OptionalLong,OptionalLong> deadlineNsCalculator, MetadataCollectorEvent event)
IllegalStateException
- if the queue is closedEventQueue.scheduleDeferred(String, Function, EventQueue.Event)
public void append(MetadataCollectorEvent event)
IllegalStateException
- if the queue is closedEventQueue.append(EventQueue.Event)
public void appendWithTag(String tag, MetadataCollectorEvent event)
tag
- the tag for the eventevent
- the TopicChangeEvent to appendIllegalStateException
- if the queue is closedpublic void cancel(String tag)
tag
- the tag for the event