-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from zapr-oss/develop
v2.14 release
- Loading branch information
Showing
62 changed files
with
3,398 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...va/in/zapr/druid/druidry/extensions/datasketches/aggregator/HllSketchBuildAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package in.zapr.druid.druidry.extensions.datasketches.aggregator; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import in.zapr.druid.druidry.aggregator.DruidAggregator; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class HllSketchBuildAggregator extends DruidAggregator { | ||
|
||
private static final String HLL_SKETCH_BUILD_TYPE_AGGREGATOR = "HLLSketchBuild"; | ||
private String fieldName; | ||
private Integer lgK; | ||
@JsonProperty("tgtHllType") | ||
private TargetHllType targetHllType; | ||
|
||
@Builder | ||
private HllSketchBuildAggregator(@NonNull String name, | ||
@NonNull String fieldName, | ||
Integer lgK, | ||
TargetHllType targetHllType) { | ||
this.type = HLL_SKETCH_BUILD_TYPE_AGGREGATOR; | ||
this.name = name; | ||
this.fieldName = fieldName; | ||
this.lgK = lgK; | ||
this.targetHllType = targetHllType; | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
...va/in/zapr/druid/druidry/extensions/datasketches/aggregator/HllSketchMergeAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package in.zapr.druid.druidry.extensions.datasketches.aggregator; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import in.zapr.druid.druidry.aggregator.DruidAggregator; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class HllSketchMergeAggregator extends DruidAggregator { | ||
|
||
private static final String HLL_SKETCH_MERGE_TYPE_AGGREGATOR = "HLLSketchMerge"; | ||
|
||
private String fieldName; | ||
private Integer lgK; | ||
@JsonProperty("tgtHllType") | ||
private TargetHllType targetHllType; | ||
|
||
@Builder | ||
private HllSketchMergeAggregator(@NonNull String name, | ||
@NonNull String fieldName, | ||
Integer lgK, | ||
TargetHllType targetHllType) { | ||
this.type = HLL_SKETCH_MERGE_TYPE_AGGREGATOR; | ||
this.name = name; | ||
this.fieldName = fieldName; | ||
this.lgK = lgK; | ||
this.targetHllType = targetHllType; | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
...a/in/zapr/druid/druidry/extensions/datasketches/aggregator/QuantilesSketchAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package in.zapr.druid.druidry.extensions.datasketches.aggregator; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.google.common.math.LongMath; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import in.zapr.druid.druidry.aggregator.DruidAggregator; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class QuantilesSketchAggregator extends DruidAggregator { | ||
|
||
private static final String QUANTILES_SKETCH_TYPE_AGGREGATOR = "quantilesDoublesSketch"; | ||
private String fieldName; | ||
private Integer k; | ||
|
||
@Builder | ||
private QuantilesSketchAggregator(@NonNull String name, | ||
@NonNull String fieldName, | ||
Integer k) { | ||
this.type = QUANTILES_SKETCH_TYPE_AGGREGATOR; | ||
this.name = name; | ||
this.fieldName = fieldName; | ||
this.k = k; | ||
|
||
if (k != null) { | ||
Preconditions.checkArgument(LongMath.isPowerOfTwo(k), "k must be a power of 2"); | ||
} | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/in/zapr/druid/druidry/extensions/datasketches/aggregator/TargetHllType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package in.zapr.druid.druidry.extensions.datasketches.aggregator; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum TargetHllType { | ||
|
||
HLL_4("HLL_4"), | ||
HLL_6("HLL_6"), | ||
HLL_8("HLL_8"); | ||
|
||
private String value; | ||
|
||
TargetHllType(String value) { | ||
this.value = value; | ||
} | ||
|
||
@JsonValue | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
.../java/in/zapr/druid/druidry/extensions/datasketches/aggregator/TupleSketchAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2018-present Red Brick Lane Marketing Solutions Pvt. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package in.zapr.druid.druidry.extensions.datasketches.aggregator; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.google.common.math.LongMath; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import java.util.List; | ||
|
||
import in.zapr.druid.druidry.aggregator.DruidAggregator; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@EqualsAndHashCode(callSuper = true) | ||
public class TupleSketchAggregator extends DruidAggregator { | ||
|
||
private static final String TUPLE_SKETCH_TYPE_AGGREGATOR = "arrayOfDoublesSketch"; | ||
private String fieldName; | ||
private Integer nominalEntries; | ||
private Integer numberOfValues; | ||
private List<String> metricColumns; | ||
|
||
@Builder | ||
private TupleSketchAggregator(@NonNull String name, | ||
@NonNull String fieldName, | ||
Integer nominalEntries, | ||
Integer numberOfValues, | ||
List<String> metricColumns) { | ||
this.type = TUPLE_SKETCH_TYPE_AGGREGATOR; | ||
this.name = name; | ||
this.fieldName = fieldName; | ||
this.nominalEntries = nominalEntries; | ||
this.numberOfValues = numberOfValues; | ||
this.metricColumns = metricColumns; | ||
|
||
if (nominalEntries != null) { | ||
Preconditions.checkArgument(LongMath.isPowerOfTwo(nominalEntries), "nominalEntries must be a power of 2"); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.