Search in sources :

Example 1 with TimeGranularity

use of com.linkedin.thirdeye.hadoop.config.TimeGranularity 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;
}
Also used : TimeGranularity(com.linkedin.thirdeye.hadoop.config.TimeGranularity) TimeSpec(com.linkedin.thirdeye.hadoop.config.TimeSpec)

Example 2 with TimeGranularity

use of com.linkedin.thirdeye.hadoop.config.TimeGranularity 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;
}
Also used : TimeGranularity(com.linkedin.thirdeye.hadoop.config.TimeGranularity) TimeSpec(com.linkedin.thirdeye.hadoop.config.TimeSpec)

Aggregations

TimeGranularity (com.linkedin.thirdeye.hadoop.config.TimeGranularity)2 TimeSpec (com.linkedin.thirdeye.hadoop.config.TimeSpec)2