@Override public boolean tryProcessWatermark(@Nonnull Watermark wm) { currentWatermark = wm.timestamp(); assert totalWindows.get() == deadlineToKeys.values().stream().mapToInt(Set::size).sum() : "unexpected totalWindows. Expected=" + deadlineToKeys.values().stream().mapToInt(Set::size).sum() + ", actual=" + totalWindows.get(); return closedWindowFlatmapper.tryProcess(wm); }
@Override @SuppressWarnings("unchecked") protected boolean tryProcess(int ordinal, @Nonnull Object item) { return flatMapper.tryProcess((T) item); } }
@Override @SuppressWarnings("unchecked") protected boolean tryProcess(int ordinal, @Nonnull Object item) { return flatMapper.tryProcess((T) item); }
@Override protected boolean tryProcess0(@Nonnull Object item) { if (((Entry) item).getKey() instanceof SnapshotValidationRecord.SnapshotValidationKey) { // ignore the validation record return true; } Entry<SnapshotDataKey, byte[]> casted = (Entry<SnapshotDataKey, byte[]>) item; String vertexName = casted.getKey().vertexName(); FlatMapper<byte[], Object> flatMapper = vertexToFlatMapper.get(vertexName); if (flatMapper == null) { if (!vertexToFlatMapper.containsKey(vertexName)) { // log only once vertexToFlatMapper.put(vertexName, null); getLogger().warning("Data for unknown vertex found in the snapshot, ignoring. Vertex=" + vertexName); } return true; } long snapshotId = casted.getKey().snapshotId(); if (snapshotId != expectedSnapshotId) { getLogger().warning("Data for unexpected snapshot ID encountered, ignoring. Expected=" + expectedSnapshotId + ", found=" + snapshotId); return true; } return flatMapper.tryProcess(casted.getValue()); } }
@Override protected boolean tryProcess(int ordinal, @Nonnull Object item) { return mapper.tryProcess(((TimestampedEntry<String, String>) item)); } }
@Override public boolean tryProcessWatermark(@Nonnull Watermark wm) { return wmFlatMapper.tryProcess(wm); }
@Override public boolean complete() { inComplete = true; return closedWindowFlatmapper.tryProcess(COMPLETING_WM); }
@Override @SuppressWarnings("unchecked") protected boolean tryProcess1(@Nonnull Object item) { return flatMapper.tryProcess((Entry<Long, String>) item); } }