suppress warn message if metricsSpec is absent when using no-rollup ingestion (#4211)

This commit is contained in:
David Lim 2017-04-25 22:52:49 -06:00 committed by GitHub
parent ee9b5a619a
commit 52f7bb091d
1 changed files with 14 additions and 14 deletions

View File

@ -66,26 +66,26 @@ public class DataSchema
this.dataSource = Preconditions.checkNotNull(dataSource, "dataSource cannot be null. Please provide a dataSource.");
this.parser = parser;
if (aggregators == null || aggregators.length == 0) {
log.warn("No metricsSpec has been specified. Are you sure this is what you want?");
} else {
//validate for no duplication
Set<String> names = new HashSet<>();
for (AggregatorFactory factory : aggregators) {
if (!names.add(factory.getName())) {
throw new IAE("duplicate aggregators found with name [%s].", factory.getName());
}
}
}
this.aggregators = aggregators;
if (granularitySpec == null) {
log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default.");
this.granularitySpec = new UniformGranularitySpec(null, null, null);
} else {
this.granularitySpec = granularitySpec;
}
if (aggregators != null && aggregators.length != 0) {
// validate for no duplication
Set<String> names = new HashSet<>();
for (AggregatorFactory factory : aggregators) {
if (!names.add(factory.getName())) {
throw new IAE("duplicate aggregators found with name [%s].", factory.getName());
}
}
} else if (this.granularitySpec.isRollup()) {
log.warn("No metricsSpec has been specified. Are you sure this is what you want?");
}
this.aggregators = aggregators;
}
@JsonProperty