Fix issue that tasks failed because of no sink for identifier (#6724)

* Fix issue that tasks failed because of no sink for identifier

* make find sinks to persist run in one callable together with the actual persist work

* Revert "make find sinks to persist run in one callable together with the actual persist work"

This reverts commit a24a2d80ae.
This commit is contained in:
Mingming Qiu 2019-01-05 09:09:11 +08:00 committed by Jonathan Wei
parent c08f391605
commit 636964fcb5
1 changed files with 7 additions and 2 deletions

View File

@ -90,6 +90,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -485,8 +486,12 @@ public class AppenderatorImpl implements Appenderator
final List<Pair<FireHydrant, SegmentIdentifier>> indexesToPersist = new ArrayList<>();
int numPersistedRows = 0;
long bytesPersisted = 0L;
for (SegmentIdentifier identifier : sinks.keySet()) {
final Sink sink = sinks.get(identifier);
Iterator<Map.Entry<SegmentIdentifier, Sink>> iterator = sinks.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<SegmentIdentifier, Sink> entry = iterator.next();
final SegmentIdentifier identifier = entry.getKey();
final Sink sink = entry.getValue();
if (sink == null) {
throw new ISE("No sink for identifier: %s", identifier);
}