use of org.apache.flink.runtime.state.changelog.StateChangelogHandleReader in project flink by apache.
the class StateChangelogStorageTest method extract.
private Map<Integer, List<byte[]>> extract(T handle, StateChangelogHandleReader<T> reader) throws Exception {
Map<Integer, List<byte[]>> changes = new HashMap<>();
try (CloseableIterator<StateChange> it = reader.getChanges(handle)) {
while (it.hasNext()) {
StateChange change = it.next();
changes.computeIfAbsent(change.getKeyGroup(), k -> new ArrayList<>()).add(change.getChange());
}
}
return changes;
}
Aggregations