
Answer-first summary for fast verification
Answer: Use session windows with a 15-minute gap duration.
The correct answer is A. To detect average noise levels from sensors, the best approach is to use session windows with a 15-minute gap duration. Session windows are ideal for cases like this where the events (sensor data) are sporadic. They group events that occur within a certain time interval (15 minutes in your case) and a new window is started if no data is received for the duration of the gap. This matches your requirement to end the window when no data is received for 15 minutes, ensuring that the average noise level is calculated over periods of continuous data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are tasked with developing a streaming Dataflow pipeline to monitor noise levels from hundreds of sensors stationed near various construction sites throughout a city. Each sensor records noise levels every ten seconds and sends data to the pipeline whenever the noise level exceeds 70 dBA. Your objective is to calculate the average noise level from a specific sensor when the duration of received data extends beyond 30 minutes; however, the calculation window should close if no data is received for a continuous 15-minute period. What steps should you take to achieve this?
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 withAllowedLateness operator.