use of com.linkedin.thirdeye.hadoop.config.TimeSpec in project pinot by linkedin.
the class ThirdEyeConfig method getInputTimeFromProperties.
private static TimeSpec getInputTimeFromProperties(Properties props) {
TimeSpec inputTime = null;
String timeColumnName = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_TIMECOLUMN_NAME.toString());
String timeColumnType = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_INPUT_TIMECOLUMN_TYPE.toString(), null);
String timeColumnSize = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_INPUT_TIMECOLUMN_SIZE.toString(), null);
String timeFormat = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_INPUT_TIMECOLUMN_FORMAT.toString(), DEFAULT_TIME_FORMAT);
if (timeColumnType != null && timeColumnSize != null) {
TimeGranularity timeGranularity = new TimeGranularity(Integer.parseInt(timeColumnSize), TimeUnit.valueOf(timeColumnType));
inputTime = new TimeSpec(timeColumnName, timeGranularity, timeFormat);
}
return inputTime;
}
use of com.linkedin.thirdeye.hadoop.config.TimeSpec in project pinot by linkedin.
the class AggregationPhaseConfig method fromThirdEyeConfig.
public static AggregationPhaseConfig fromThirdEyeConfig(ThirdEyeConfig config) {
// metrics
List<String> metricNames = new ArrayList<String>(config.getMetrics().size());
List<MetricType> metricTypes = new ArrayList<MetricType>(config.getMetrics().size());
for (MetricSpec spec : config.getMetrics()) {
metricNames.add(spec.getName());
metricTypes.add(spec.getType());
}
// dimensions
List<String> dimensionNames = new ArrayList<String>(config.getDimensions().size());
for (DimensionSpec dimensionSpec : config.getDimensions()) {
dimensionNames.add(dimensionSpec.getName());
}
// time
TimeSpec time = config.getTime();
// input time
TimeSpec inputTime = config.getInputTime();
if (inputTime == null) {
throw new IllegalStateException("Must provide input time configs for aggregation job");
}
return new AggregationPhaseConfig(dimensionNames, metricNames, metricTypes, time, inputTime);
}
use of com.linkedin.thirdeye.hadoop.config.TimeSpec in project pinot by linkedin.
the class ThirdEyeConfig method getTimeFromProperties.
private static TimeSpec getTimeFromProperties(Properties props) {
String timeColumnName = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_TIMECOLUMN_NAME.toString());
String timeColumnType = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_TIMECOLUMN_TYPE.toString(), DEFAULT_TIME_TYPE);
String timeColumnSize = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_TIMECOLUMN_SIZE.toString(), DEFAULT_TIME_SIZE);
TimeGranularity timeGranularity = new TimeGranularity(Integer.parseInt(timeColumnSize), TimeUnit.valueOf(timeColumnType));
String timeFormat = getAndCheck(props, ThirdEyeConfigProperties.THIRDEYE_TIMECOLUMN_FORMAT.toString(), DEFAULT_TIME_FORMAT);
TimeSpec time = new TimeSpec(timeColumnName, timeGranularity, timeFormat);
return time;
}
use of com.linkedin.thirdeye.hadoop.config.TimeSpec in project pinot by linkedin.
the class ThirdEyeConfig method fromProperties.
/**
* Creates a ThirdEyeConfig object from the Properties object
* @param props
* @return
*/
public static ThirdEyeConfig fromProperties(Properties props) {
String collection = getCollectionFromProperties(props);
List<DimensionSpec> dimensions = getDimensionFromProperties(props);
List<MetricSpec> metrics = getMetricsFromProperties(props);
TimeSpec inputTime = getInputTimeFromProperties(props);
TimeSpec time = getTimeFromProperties(props);
SplitSpec split = getSplitFromProperties(props);
TopkWhitelistSpec topKWhitelist = getTopKWhitelistFromProperties(props);
ThirdEyeConfig thirdeyeConfig = new ThirdEyeConfig(collection, dimensions, metrics, inputTime, time, topKWhitelist, split);
return thirdeyeConfig;
}
Aggregations