
Answer-first summary for fast verification
Answer: Use session windows with a 15-minute gap duration.
**Correct Answer: A** Using session windows with a 15-minute gap duration is the optimal approach for this scenario. It allows the definition of windows based on activity (data reception) and inactivity (no data reception). A session window initiates when a sensor sends data and remains active until no data is received for 15 minutes, then closes. This method meets the requirement of calculating the average noise level for durations exceeding 30 minutes, while ensuring the window closes after 15 minutes of inactivity. **Why Other Options Are Incorrect:** - **B:** A 30-minute gap duration would not align with the requirement to close the window after 15 minutes of inactivity. - **C:** Hopping windows advance by a fixed period (30 minutes here) and are unsuitable for closing based on 15 minutes of inactivity. - **D:** Tumbling windows reset at fixed intervals and do not support closing based on inactivity, even with the .withAllowedLateness operator.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are designing a streaming Dataflow pipeline to monitor noise levels from sensors near construction sites in a city. These sensors send noise level readings every ten seconds to the pipeline, but only when the levels exceed 70 dBA. How should you configure the pipeline to calculate the average noise level from a sensor when data is available for over 30 minutes, but the window closes if no data is received for 15 minutes?
A
Use session windows with a 15-minute gap duration.
B
Use session windows with a 30-minute gap duration.
C
Use hopping windows with a 15-minute window, and a thirty-minute period.
D
Use tumbling windows with a 15-minute window and a fifteen-minute .withAllowedLateness operator.
No comments yet.