|
@@ -58,8 +58,6 @@ import org.apache.hadoop.yarn.server.timelineservice.storage.common.RowKeyPrefix
|
|
|
import org.apache.hadoop.yarn.server.timelineservice.storage.common.TimelineStorageUtils;
|
|
|
import org.apache.hadoop.yarn.webapp.BadRequestException;
|
|
|
|
|
|
-import org.apache.hadoop.util.Preconditions;
|
|
|
-
|
|
|
/**
|
|
|
* Timeline entity reader for application entities that are stored in the
|
|
|
* application table.
|
|
@@ -336,21 +334,29 @@ class ApplicationEntityReader extends GenericEntityReader {
|
|
|
|
|
|
@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().getEntityType(),
|
|
|
- "entityType shouldn't be null");
|
|
|
+ if (getContext() == null) {
|
|
|
+ throw new NullPointerException("context shouldn't be null");
|
|
|
+ }
|
|
|
+ if (getDataToRetrieve() == null) {
|
|
|
+ throw new NullPointerException("data to retrieve shouldn't be null");
|
|
|
+ }
|
|
|
+ if (getContext().getClusterId() == null) {
|
|
|
+ throw new NullPointerException("clusterId shouldn't be null");
|
|
|
+ }
|
|
|
+ if (getContext().getEntityType() == null) {
|
|
|
+ throw new NullPointerException("entityType shouldn't be null");
|
|
|
+ }
|
|
|
if (isSingleEntityRead()) {
|
|
|
- Preconditions.checkNotNull(getContext().getAppId(),
|
|
|
- "appId shouldn't be null");
|
|
|
+ if (getContext().getAppId() == null) {
|
|
|
+ throw new NullPointerException("appId shouldn't be null");
|
|
|
+ }
|
|
|
} else {
|
|
|
- Preconditions.checkNotNull(getContext().getUserId(),
|
|
|
- "userId shouldn't be null");
|
|
|
- Preconditions.checkNotNull(getContext().getFlowName(),
|
|
|
- "flowName shouldn't be null");
|
|
|
+ if (getContext().getUserId() == null) {
|
|
|
+ throw new NullPointerException("userId shouldn't be null");
|
|
|
+ }
|
|
|
+ if (getContext().getFlowName() == null) {
|
|
|
+ throw new NullPointerException("flowName shouldn't be null");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|