private synchronized List<TaskSource> getSources() {
   return Stream.concat(
           Stream.of(planFragment.getPartitionedSourceNode()),
           planFragment.getRemoteSourceNodes().stream())
       .filter(Objects::nonNull)
       .map(PlanNode::getId)
       .map(this::getSource)
       .filter(Objects::nonNull)
       .collect(toImmutableList());
 }