|
|
|
@ -264,12 +264,13 @@ public class KStreamSessionWindowAggregate<KIn, VIn, VAgg> implements KStreamAgg
@@ -264,12 +264,13 @@ public class KStreamSessionWindowAggregate<KIn, VIn, VAgg> implements KStreamAgg
|
|
|
|
|
final long emitRangeUpperBound) { |
|
|
|
|
final long startMs = time.milliseconds(); |
|
|
|
|
|
|
|
|
|
int emittedCount = 0; |
|
|
|
|
|
|
|
|
|
// Only time ordered (indexed) session store should have implemented
|
|
|
|
|
// this function, otherwise a not-supported exception would throw
|
|
|
|
|
final KeyValueIterator<Windowed<KIn>, VAgg> windowToEmit = store |
|
|
|
|
.findSessions(emitRangeLowerBound, emitRangeUpperBound); |
|
|
|
|
try (final KeyValueIterator<Windowed<KIn>, VAgg> windowToEmit = store |
|
|
|
|
.findSessions(emitRangeLowerBound, emitRangeUpperBound)) { |
|
|
|
|
|
|
|
|
|
int emittedCount = 0; |
|
|
|
|
while (windowToEmit.hasNext()) { |
|
|
|
|
emittedCount++; |
|
|
|
|
final KeyValue<Windowed<KIn>, VAgg> kv = windowToEmit.next(); |
|
|
|
@ -281,6 +282,7 @@ public class KStreamSessionWindowAggregate<KIn, VIn, VAgg> implements KStreamAgg
@@ -281,6 +282,7 @@ public class KStreamSessionWindowAggregate<KIn, VIn, VAgg> implements KStreamAgg
|
|
|
|
|
.withTimestamp(kv.key.window().end()) |
|
|
|
|
.withHeaders(record.headers())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
emittedRecordsSensor.record(emittedCount); |
|
|
|
|
emitFinalLatencySensor.record(time.milliseconds() - startMs); |
|
|
|
|
|
|
|
|
|