Merge pull request #1774 from himanshug/merge_task_updates

update doc about aggregation field in merge task and a null check
This commit is contained in:
Fangjin Yang 2015-09-24 21:29:30 -07:00
commit 9dfc74bb4e
2 changed files with 3 additions and 1 deletions

View File

@ -294,6 +294,7 @@ Merge tasks merge a list of segments together. Any common timestamps are merged.
"type": "merge",
"id": <task_id>,
"dataSource": <task_datasource>,
"aggregations": <list of aggregators>,
"segments": <JSON list of DataSegment objects to merge>
}
```

View File

@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
@ -56,7 +57,7 @@ public class MergeTask extends MergeTaskBase
)
{
super(id, dataSource, segments, context);
this.aggregators = aggregators;
this.aggregators = Preconditions.checkNotNull(aggregators, "null aggregations");
this.indexSpec = indexSpec == null ? new IndexSpec() : indexSpec;
}