use of com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO in project pinot by linkedin.
the class DataResource method getDimensionsForMetric.
@GET
@Path("autocomplete/dimensions/metric/{metricId}")
public List<String> getDimensionsForMetric(@PathParam("metricId") Long metricId) {
List<String> list = new ArrayList<>();
list.add("All");
try {
MetricConfigDTO metricConfigDTO = metricConfigDAO.findById(metricId);
DatasetConfigDTO datasetConfigDTO = datasetConfigDAO.findByDataset(metricConfigDTO.getDataset());
list.addAll(datasetConfigDTO.getDimensions());
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
return list;
}
use of com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO in project pinot by linkedin.
the class DataResource method getDatasetNames.
@GET
@Path("summary/datasets")
public List<String> getDatasetNames() {
List<String> output = new ArrayList<>();
List<DatasetConfigDTO> datasetConfigDTOs = datasetConfigDAO.findAll();
for (DatasetConfigDTO dto : datasetConfigDTOs) {
output.add(dto.getDataset());
}
return output;
}
use of com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO in project pinot by linkedin.
the class ContributorViewHandler method generateTimeOnTimeComparisonRequest.
private TimeOnTimeComparisonRequest generateTimeOnTimeComparisonRequest(ContributorViewRequest request) throws Exception {
TimeOnTimeComparisonRequest comparisonRequest = new TimeOnTimeComparisonRequest();
String collection = request.getCollection();
DateTime baselineStart = request.getBaselineStart();
DateTime baselineEnd = request.getBaselineEnd();
DateTime currentStart = request.getCurrentStart();
DateTime currentEnd = request.getCurrentEnd();
DatasetConfigDTO datasetConfig = CACHE_REGISTRY.getDatasetConfigCache().get(collection);
TimeSpec timespec = ThirdEyeUtils.getTimeSpecFromDatasetConfig(datasetConfig);
if (!request.getTimeGranularity().getUnit().equals(TimeUnit.DAYS) || !StringUtils.isBlank(timespec.getFormat())) {
comparisonRequest.setEndDateInclusive(true);
}
Multimap<String, String> filters = request.getFilters();
List<String> dimensionsToGroupBy = request.getGroupByDimensions();
if (dimensionsToGroupBy == null || dimensionsToGroupBy.isEmpty()) {
List<String> allDimensions = Utils.getDimensionsToGroupBy(collection, filters);
dimensionsToGroupBy = Lists.newArrayList(allDimensions.get(0));
}
List<MetricExpression> metricExpressions = request.getMetricExpressions();
comparisonRequest.setCollectionName(collection);
comparisonRequest.setBaselineStart(baselineStart);
comparisonRequest.setBaselineEnd(baselineEnd);
comparisonRequest.setCurrentStart(currentStart);
comparisonRequest.setCurrentEnd(currentEnd);
comparisonRequest.setFilterSet(filters);
comparisonRequest.setMetricExpressions(metricExpressions);
comparisonRequest.setAggregationTimeGranularity(request.getTimeGranularity());
comparisonRequest.setGroupByDimensions(dimensionsToGroupBy);
return comparisonRequest;
}
use of com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO in project pinot by linkedin.
the class DatasetConfigManagerImpl method findActive.
@Override
public List<DatasetConfigDTO> findActive() {
Predicate activePredicate = Predicate.EQ("active", true);
List<DatasetConfigBean> list = genericPojoDao.get(activePredicate, DatasetConfigBean.class);
List<DatasetConfigDTO> results = new ArrayList<>();
for (DatasetConfigBean abstractBean : list) {
DatasetConfigDTO result = MODEL_MAPPER.map(abstractBean, DatasetConfigDTO.class);
results.add(result);
}
return results;
}
Aggregations