protected Split computeNext()
{
if (sourceIterator.hasNext()) {
Split sourceSplit = sourceIterator.next();
NativeSplit writingSplit = new NativeSplit(shardManager.allocateShard(tableWriterNode.getTable()), ImmutableList.<HostAddress>of());
String partition = "unpartitioned";
boolean lastSplit = false;
List<? extends PartitionKey> partitionKeys = ImmutableList.of();
if (sourceSplit instanceof PartitionedSplit) {
PartitionedSplit partitionedSplit = (PartitionedSplit) sourceSplit;
partition = partitionedSplit.getPartitionId();
lastSplit = partitionedSplit.isLastSplit();
partitionKeys = partitionedSplit.getPartitionKeys();
}
addPartitionShard(partition, lastSplit, partitionKeys, writingSplit.getShardId());
CollocatedSplit collocatedSplit = new CollocatedSplit(
ImmutableMap.of(
planNodeId, sourceSplit,
tableWriterNode.getId(), writingSplit),
sourceSplit.getAddresses(),