use of org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader.Field in project hadoop by apache.
the class FlowRunEntityReader method validateParams.
@Override
protected void validateParams() {
Preconditions.checkNotNull(getContext(), "context shouldn't be null");
Preconditions.checkNotNull(getDataToRetrieve(), "data to retrieve shouldn't be null");
Preconditions.checkNotNull(getContext().getClusterId(), "clusterId shouldn't be null");
Preconditions.checkNotNull(getContext().getUserId(), "userId shouldn't be null");
Preconditions.checkNotNull(getContext().getFlowName(), "flowName shouldn't be null");
if (isSingleEntityRead()) {
Preconditions.checkNotNull(getContext().getFlowRunId(), "flowRunId shouldn't be null");
}
EnumSet<Field> fieldsToRetrieve = getDataToRetrieve().getFieldsToRetrieve();
if (!isSingleEntityRead() && fieldsToRetrieve != null) {
for (Field field : fieldsToRetrieve) {
if (field != Field.ALL && field != Field.METRICS) {
throw new BadRequestException("Invalid field " + field + " specified while querying flow runs.");
}
}
}
}
Aggregations