Recall & Review
beginner
What is a punctuator in Kafka Streams?
A punctuator is a callback function in Kafka Streams that is triggered at regular time intervals or stream time to perform periodic actions like emitting results or cleaning up state.
Click to reveal answer
intermediate
How do you schedule a punctuator in Kafka Streams?
You schedule a punctuator by calling the
context.schedule() method inside the Processor or Transformer API, specifying the interval and the type of time (stream time or wall-clock time).Click to reveal answer
beginner
What are the two types of time used for punctuators in Kafka Streams?
The two types are STREAM_TIME, which is based on the timestamps of the records processed, and WALL_CLOCK_TIME, which is based on the system clock.
Click to reveal answer
intermediate
Why would you use a punctuator with WALL_CLOCK_TIME instead of STREAM_TIME?
You use WALL_CLOCK_TIME when you want actions to happen at real-world time intervals regardless of data arrival, such as periodic cleanup or emitting results even if no new data arrives.
Click to reveal answer
advanced
What happens if you schedule a punctuator with a very small interval?
Scheduling a punctuator with a very small interval can cause high CPU usage and reduce performance because the punctuator will be triggered very frequently, possibly more often than needed.
Click to reveal answer
What method is used to schedule a punctuator in Kafka Streams?
✗ Incorrect
The correct method to schedule a punctuator is context.schedule() inside the Processor or Transformer API.
Which time type triggers punctuators based on record timestamps?
✗ Incorrect
STREAM_TIME triggers punctuators based on the timestamps of the records processed.
If you want a punctuator to run every 5 seconds regardless of data arrival, which time type should you use?
✗ Incorrect
WALL_CLOCK_TIME triggers punctuators based on real-world clock time, so it runs regardless of data arrival.
What is a potential downside of scheduling punctuators too frequently?
✗ Incorrect
Scheduling punctuators too frequently can cause high CPU usage and reduce performance.
Where do you typically implement punctuators in Kafka Streams?
✗ Incorrect
Punctuators are implemented inside the Processor or Transformer API in Kafka Streams.
Explain what a punctuator is and how it is used for time-based triggers in Kafka Streams.
Think about how Kafka Streams can perform actions periodically based on time.
You got /4 concepts.
Describe the difference between STREAM_TIME and WALL_CLOCK_TIME when scheduling punctuators.
Consider whether the trigger depends on data arrival or real-world time.
You got /4 concepts.