mirror of https://github.com/apache/druid.git
Make LinearShardSpec require a partitionNum
This commit is contained in:
parent
5ad023cd3f
commit
7834ffe6fc
|
@ -1,6 +1,8 @@
|
||||||
package com.metamx.druid.shard;
|
package com.metamx.druid.shard;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import com.metamx.druid.input.InputRow;
|
import com.metamx.druid.input.InputRow;
|
||||||
import com.metamx.druid.partition.LinearPartitionChunk;
|
import com.metamx.druid.partition.LinearPartitionChunk;
|
||||||
import com.metamx.druid.partition.PartitionChunk;
|
import com.metamx.druid.partition.PartitionChunk;
|
||||||
|
@ -10,12 +12,11 @@ import java.util.Map;
|
||||||
public class LinearShardSpec implements ShardSpec {
|
public class LinearShardSpec implements ShardSpec {
|
||||||
private int partitionNum;
|
private int partitionNum;
|
||||||
|
|
||||||
public LinearShardSpec() {
|
@JsonCreator
|
||||||
this(-1);
|
public LinearShardSpec(
|
||||||
}
|
@JsonProperty("partitionNum") Integer partitionNum
|
||||||
|
) {
|
||||||
public LinearShardSpec(int partitionNum) {
|
this.partitionNum = Preconditions.checkNotNull(partitionNum, "Must set partitionNum on LinearShardSpec");
|
||||||
this.partitionNum = partitionNum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty("partitionNum")
|
@JsonProperty("partitionNum")
|
||||||
|
|
Loading…
Reference in New Issue