Your e-commerce site streams user clicks from Pub/Sub into a Dataflow pipeline built with Apache Beam. A session is any sequence of events for one user with no more than 30 minutes of inactivity. Product managers expect provisional per-user session counts every 5 minutes of processing time, yet final results must still include events that arrive up to 15 minutes after the session gap closes. Which windowing and triggering setup best satisfies these needs while avoiding unnecessary windows?
Use 30-minute fixed windows; add an AfterProcessingTime trigger that fires 5 minutes after the first element and set allowed lateness to 15 minutes.
Use sliding windows of 30 minutes that advance every 5 minutes with the default watermark trigger and no allowed lateness.
Use session windows with a 30-minute gap; add an early AfterProcessingTime trigger that fires 5 minutes after the first element, keep the default on-time watermark firing, set allowed lateness to 15 minutes, and accumulate fired panes.
Use the global window; set an AfterProcessingTime trigger to fire 30 minutes after each element and discard fired panes with no allowed lateness.
Session windows naturally group events that are separated by less than a specified gap, matching the 30-minute inactivity rule for user sessions. Adding an early processing-time trigger such as AfterProcessingTime.pastFirstElementInPane().plusDelayOf(5 minutes) produces interim aggregates every five minutes. Leaving the default on-time firing (watermark past end of window) ensures a pane is emitted when the 30-minute gap elapses, and setting allowedLateness to 15 minutes lets late events merge into the existing session. Using accumulating mode updates prior results without opening new windows. Fixed, sliding, or global windows fail to capture true user sessions or to meet late-data requirements without extra complexity.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a session window in Apache Beam?
Open an interactive chat with Bash
What is the purpose of an AfterProcessingTime trigger in Apache Beam?
Open an interactive chat with Bash
What does allowed lateness mean in windowing in Apache Beam?
Open an interactive chat with Bash
What is the difference between session windows and fixed windows in Apache Beam?
Open an interactive chat with Bash
What is an early processing-time trigger in Apache Beam and why is it useful?
Open an interactive chat with Bash
What does allowed lateness mean in the context of Apache Beam windows?
Open an interactive chat with Bash
GCP Professional Data Engineer
Ingesting and processing the data
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .