|
@@ -265,6 +265,20 @@ public class TimelineReaderWebServices {
|
|
|
* or has a value less than 1, and metrics have to be retrieved, then
|
|
|
* metricsLimit will be considered as 1 i.e. latest single value of
|
|
|
* metric(s) will be returned. (Optional query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If fromIdPrefix
|
|
|
+ * is same for all entities of a given entity type, then the user must
|
|
|
+ * provide fromId as a filter to denote the start entity from which
|
|
|
+ * further entities will be fetched. fromIdPrefix is mandatory even
|
|
|
+ * in the case the entity id prefix is not used and should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing
|
|
|
* a set of <cite>TimelineEntity</cite> instances of the given entity type
|
|
@@ -295,7 +309,9 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
String url = req.getRequestURI() +
|
|
|
(req.getQueryString() == null ? "" :
|
|
|
QUERY_STRING_SEP + req.getQueryString());
|
|
@@ -318,7 +334,8 @@ public class TimelineReaderWebServices {
|
|
|
entities = timelineReaderManager.getEntities(context,
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
- infofilters, conffilters, metricfilters, eventfilters),
|
|
|
+ infofilters, conffilters, metricfilters, eventfilters,
|
|
|
+ fromIdPrefix, fromId),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
confsToRetrieve, metricsToRetrieve, fields, metricsLimit));
|
|
|
} catch (Exception e) {
|
|
@@ -401,6 +418,20 @@ public class TimelineReaderWebServices {
|
|
|
* or has a value less than 1, and metrics have to be retrieved, then
|
|
|
* metricsLimit will be considered as 1 i.e. latest single value of
|
|
|
* metric(s) will be returned. (Optional query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If fromIdPrefix
|
|
|
+ * is same for all entities of a given entity type, then the user must
|
|
|
+ * provide fromId as a filter to denote the start entity from which
|
|
|
+ * further entities will be fetched. fromIdPrefix is mandatory even
|
|
|
+ * in the case the entity id prefix is not used and should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing
|
|
|
* a set of <cite>TimelineEntity</cite> instances of the given entity type
|
|
@@ -436,11 +467,14 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
return getEntities(req, res, null, appId, entityType, userId, flowName,
|
|
|
flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, fromIdPrefix,
|
|
|
+ fromId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -511,6 +545,20 @@ public class TimelineReaderWebServices {
|
|
|
* or has a value less than 1, and metrics have to be retrieved, then
|
|
|
* metricsLimit will be considered as 1 i.e. latest single value of
|
|
|
* metric(s) will be returned. (Optional query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If fromIdPrefix
|
|
|
+ * is same for all entities of a given entity type, then the user must
|
|
|
+ * provide fromId as a filter to denote the start entity from which
|
|
|
+ * further entities will be fetched. fromIdPrefix is mandatory even
|
|
|
+ * in the case the entity id prefix is not used and should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing
|
|
|
* a set of <cite>TimelineEntity</cite> instances of the given entity type
|
|
@@ -547,7 +595,9 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
String url = req.getRequestURI() +
|
|
|
(req.getQueryString() == null ? "" :
|
|
|
QUERY_STRING_SEP + req.getQueryString());
|
|
@@ -560,12 +610,14 @@ public class TimelineReaderWebServices {
|
|
|
TimelineReaderManager timelineReaderManager = getTimelineReaderManager();
|
|
|
Set<TimelineEntity> entities = null;
|
|
|
try {
|
|
|
- entities = timelineReaderManager.getEntities(
|
|
|
- TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
- clusterId, userId, flowName, flowRunId, appId, entityType, null),
|
|
|
+ TimelineReaderContext context = TimelineReaderWebServicesUtils
|
|
|
+ .createTimelineReaderContext(clusterId, userId, flowName, flowRunId,
|
|
|
+ appId, entityType, null, null);
|
|
|
+ entities = timelineReaderManager.getEntities(context,
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
- infofilters, conffilters, metricfilters, eventfilters),
|
|
|
+ infofilters, conffilters, metricfilters, eventfilters,
|
|
|
+ fromIdPrefix, fromId),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
confsToRetrieve, metricsToRetrieve, fields, metricsLimit));
|
|
|
} catch (Exception e) {
|
|
@@ -704,6 +756,8 @@ public class TimelineReaderWebServices {
|
|
|
* or has a value less than 1, and metrics have to be retrieved, then
|
|
|
* metricsLimit will be considered as 1 i.e. latest single value of
|
|
|
* metric(s) will be returned. (Optional query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -730,10 +784,11 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
return getEntity(req, res, null, appId, entityType, entityId, userId,
|
|
|
flowName, flowRunId, confsToRetrieve, metricsToRetrieve, fields,
|
|
|
- metricsLimit);
|
|
|
+ metricsLimit, entityIdPrefix);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -775,6 +830,8 @@ public class TimelineReaderWebServices {
|
|
|
* or has a value less than 1, and metrics have to be retrieved, then
|
|
|
* metricsLimit will be considered as 1 i.e. latest single value of
|
|
|
* metric(s) will be returned. (Optional query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -802,7 +859,8 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
String url = req.getRequestURI() +
|
|
|
(req.getQueryString() == null ? "" :
|
|
|
QUERY_STRING_SEP + req.getQueryString());
|
|
@@ -817,7 +875,8 @@ public class TimelineReaderWebServices {
|
|
|
try {
|
|
|
entity = timelineReaderManager.getEntity(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
- clusterId, userId, flowName, flowRunId, appId, entityType, entityId),
|
|
|
+ clusterId, userId, flowName, flowRunId, appId, entityType,
|
|
|
+ entityIdPrefix, entityId),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
confsToRetrieve, metricsToRetrieve, fields, metricsLimit));
|
|
|
} catch (Exception e) {
|
|
@@ -993,7 +1052,7 @@ public class TimelineReaderWebServices {
|
|
|
entity = timelineReaderManager.getEntity(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
clusterId, userId, flowName, flowRunId, null,
|
|
|
- TimelineEntityType.YARN_FLOW_RUN.toString(), null),
|
|
|
+ TimelineEntityType.YARN_FLOW_RUN.toString(), null, null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
null, metricsToRetrieve, null, null));
|
|
|
} catch (Exception e) {
|
|
@@ -1082,7 +1141,7 @@ public class TimelineReaderWebServices {
|
|
|
entities = timelineReaderManager.getEntities(context,
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
limit, createdTimeStart, createdTimeEnd, null, null, null,
|
|
|
- null, null, null),
|
|
|
+ null, null, null, null, null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
null, metricsToRetrieve, fields, null));
|
|
|
} catch (Exception e) {
|
|
@@ -1218,10 +1277,10 @@ public class TimelineReaderWebServices {
|
|
|
entities = timelineReaderManager.getEntities(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
clusterId, userId, flowName, null, null,
|
|
|
- TimelineEntityType.YARN_FLOW_RUN.toString(), null),
|
|
|
+ TimelineEntityType.YARN_FLOW_RUN.toString(), null, null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
limit, createdTimeStart, createdTimeEnd, null, null, null,
|
|
|
- null, null, null),
|
|
|
+ null, null, null, null, null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
null, metricsToRetrieve, fields, null));
|
|
|
} catch (Exception e) {
|
|
@@ -1340,13 +1399,14 @@ public class TimelineReaderWebServices {
|
|
|
DateRange range = parseDateRange(dateRange);
|
|
|
TimelineEntityFilters entityFilters =
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
- limit, null, null, null, null, null, null, null, null);
|
|
|
+ limit, null, null, null, null, null, null, null, null, null,
|
|
|
+ null);
|
|
|
entityFilters.setCreatedTimeBegin(range.dateStart);
|
|
|
entityFilters.setCreatedTimeEnd(range.dateEnd);
|
|
|
entities = timelineReaderManager.getEntities(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
clusterId, null, null, null, null,
|
|
|
- TimelineEntityType.YARN_FLOW_ACTIVITY.toString(), null),
|
|
|
+ TimelineEntityType.YARN_FLOW_ACTIVITY.toString(), null, null),
|
|
|
entityFilters, TimelineReaderWebServicesUtils.
|
|
|
createTimelineDataToRetrieve(null, null, null, null));
|
|
|
} catch (Exception e) {
|
|
@@ -1585,7 +1645,7 @@ public class TimelineReaderWebServices {
|
|
|
entity = timelineReaderManager.getEntity(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
clusterId, userId, flowName, flowRunId, appId,
|
|
|
- TimelineEntityType.YARN_APPLICATION.toString(), null),
|
|
|
+ TimelineEntityType.YARN_APPLICATION.toString(), null, null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
confsToRetrieve, metricsToRetrieve, fields, metricsLimit));
|
|
|
} catch (Exception e) {
|
|
@@ -1711,7 +1771,8 @@ public class TimelineReaderWebServices {
|
|
|
entities = timelineReaderManager.getEntities(context,
|
|
|
TimelineReaderWebServicesUtils.createTimelineEntityFilters(
|
|
|
limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
- infofilters, conffilters, metricfilters, eventfilters),
|
|
|
+ infofilters, conffilters, metricfilters, eventfilters, null,
|
|
|
+ null),
|
|
|
TimelineReaderWebServicesUtils.createTimelineDataToRetrieve(
|
|
|
confsToRetrieve, metricsToRetrieve, fields, metricsLimit));
|
|
|
} catch (Exception e) {
|
|
@@ -1823,7 +1884,7 @@ public class TimelineReaderWebServices {
|
|
|
TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName,
|
|
|
flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, null, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1925,7 +1986,7 @@ public class TimelineReaderWebServices {
|
|
|
TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName,
|
|
|
flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, null, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2021,7 +2082,7 @@ public class TimelineReaderWebServices {
|
|
|
TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName,
|
|
|
null, limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, null, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2119,7 +2180,7 @@ public class TimelineReaderWebServices {
|
|
|
TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName,
|
|
|
null, limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, null, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2190,6 +2251,21 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If
|
|
|
+ * fromIdPrefix is same for all entities of a given entity type, then
|
|
|
+ * the user must provide fromId as a filter to denote the start
|
|
|
+ * entity from which further entities will be fetched. fromIdPrefix
|
|
|
+ * is mandatory even in the case the entity id prefix is not used and
|
|
|
+ * should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* set of <cite>TimelineEntity</cite> instances of the app-attempt
|
|
@@ -2222,12 +2298,14 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
|
|
|
return getAppAttempts(req, res, null, appId, userId, flowName, flowRunId,
|
|
|
limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
|
|
|
infofilters, conffilters, metricfilters, eventfilters, confsToRetrieve,
|
|
|
- metricsToRetrieve, fields, metricsLimit);
|
|
|
+ metricsToRetrieve, fields, metricsLimit, fromIdPrefix, fromId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2299,6 +2377,21 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If
|
|
|
+ * fromIdPrefix is same for all entities of a given entity type, then
|
|
|
+ * the user must provide fromId as a filter to denote the start
|
|
|
+ * entity from which further entities will be fetched. fromIdPrefix
|
|
|
+ * is mandatory even in the case the entity id prefix is not used and
|
|
|
+ * should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* set of <cite>TimelineEntity</cite> instances of the app-attempts
|
|
@@ -2332,13 +2425,16 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
|
|
|
return getEntities(req, res, clusterId, appId,
|
|
|
TimelineEntityType.YARN_APPLICATION_ATTEMPT.toString(), userId,
|
|
|
flowName, flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit,
|
|
|
+ fromIdPrefix, fromId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2381,6 +2477,8 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -2405,9 +2503,11 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
return getAppAttempt(req, res, null, appId, appAttemptId, userId, flowName,
|
|
|
- flowRunId, confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ flowRunId, confsToRetrieve, metricsToRetrieve, fields, metricsLimit,
|
|
|
+ entityIdPrefix);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2450,6 +2550,8 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -2476,11 +2578,12 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
return getEntity(req, res, clusterId, appId,
|
|
|
TimelineEntityType.YARN_APPLICATION_ATTEMPT.toString(), appAttemptId,
|
|
|
userId, flowName, flowRunId, confsToRetrieve, metricsToRetrieve, fields,
|
|
|
- metricsLimit);
|
|
|
+ metricsLimit, entityIdPrefix);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2553,6 +2656,21 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If
|
|
|
+ * fromIdPrefix is same for all entities of a given entity type, then
|
|
|
+ * the user must provide fromId as a filter to denote the start
|
|
|
+ * entity from which further entities will be fetched. fromIdPrefix
|
|
|
+ * is mandatory even in the case the entity id prefix is not used and
|
|
|
+ * should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* set of <cite>TimelineEntity</cite> instances of the containers
|
|
@@ -2586,11 +2704,14 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
return getContainers(req, res, null, appId, appattemptId, userId, flowName,
|
|
|
flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilters, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, fromIdPrefix,
|
|
|
+ fromId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2664,6 +2785,21 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param fromIdPrefix If specified, retrieve entities with an id prefix
|
|
|
+ * greater than or equal to the specified fromIdPrefix. If
|
|
|
+ * fromIdPrefix is same for all entities of a given entity type, then
|
|
|
+ * the user must provide fromId as a filter to denote the start
|
|
|
+ * entity from which further entities will be fetched. fromIdPrefix
|
|
|
+ * is mandatory even in the case the entity id prefix is not used and
|
|
|
+ * should be set to 0.
|
|
|
+ * @param fromId If specified along with fromIdPrefix, retrieve entities with
|
|
|
+ * an id prefix greater than or equal to specified id prefix in
|
|
|
+ * fromIdPrefix and entity id lexicographically greater than or equal
|
|
|
+ * to entity id specified in fromId. Please note than fromIdPrefix is
|
|
|
+ * mandatory if fromId is specified, otherwise, the filter will be
|
|
|
+ * ignored. It is recommended to provide both fromIdPrefix and fromId
|
|
|
+ * filters for more accurate results as id prefix may not be unique
|
|
|
+ * for an entity.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* set of <cite>TimelineEntity</cite> instances of the containers
|
|
@@ -2699,7 +2835,9 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("fromidprefix") String fromIdPrefix,
|
|
|
+ @QueryParam("fromid") String fromId) {
|
|
|
|
|
|
String entityType = TimelineEntityType.YARN_CONTAINER.toString();
|
|
|
String parentEntityType =
|
|
@@ -2717,7 +2855,8 @@ public class TimelineReaderWebServices {
|
|
|
return getEntities(req, res, clusterId, appId, entityType, userId, flowName,
|
|
|
flowRunId, limit, createdTimeStart, createdTimeEnd, relatesTo,
|
|
|
isRelatedTo, infofilter, conffilters, metricfilters, eventfilters,
|
|
|
- confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ confsToRetrieve, metricsToRetrieve, fields, metricsLimit, fromIdPrefix,
|
|
|
+ fromId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2759,6 +2898,8 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -2783,9 +2924,11 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
return getContainer(req, res, null, appId, containerId, userId, flowName,
|
|
|
- flowRunId, confsToRetrieve, metricsToRetrieve, fields, metricsLimit);
|
|
|
+ flowRunId, confsToRetrieve, metricsToRetrieve, fields, metricsLimit,
|
|
|
+ entityIdPrefix);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2828,6 +2971,8 @@ public class TimelineReaderWebServices {
|
|
|
* have to be retrieved, then metricsLimit will be considered as 1
|
|
|
* i.e. latest single value of metric(s) will be returned. (Optional
|
|
|
* query param).
|
|
|
+ * @param entityIdPrefix Defines the id prefix for the entity to be fetched.
|
|
|
+ * If specified, then entity retrieval will be faster.
|
|
|
*
|
|
|
* @return If successful, a HTTP 200(OK) response having a JSON representing a
|
|
|
* <cite>TimelineEntity</cite> instance is returned.<br>
|
|
@@ -2854,11 +2999,12 @@ public class TimelineReaderWebServices {
|
|
|
@QueryParam("confstoretrieve") String confsToRetrieve,
|
|
|
@QueryParam("metricstoretrieve") String metricsToRetrieve,
|
|
|
@QueryParam("fields") String fields,
|
|
|
- @QueryParam("metricslimit") String metricsLimit) {
|
|
|
+ @QueryParam("metricslimit") String metricsLimit,
|
|
|
+ @QueryParam("entityidprefix") String entityIdPrefix) {
|
|
|
return getEntity(req, res, clusterId, appId,
|
|
|
TimelineEntityType.YARN_CONTAINER.toString(), containerId, userId,
|
|
|
flowName, flowRunId, confsToRetrieve, metricsToRetrieve, fields,
|
|
|
- metricsLimit);
|
|
|
+ metricsLimit, entityIdPrefix);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2953,7 +3099,7 @@ public class TimelineReaderWebServices {
|
|
|
results = timelineReaderManager.getEntityTypes(
|
|
|
TimelineReaderWebServicesUtils.createTimelineReaderContext(
|
|
|
clusterId, userId, flowName, flowRunId, appId,
|
|
|
- null, null));
|
|
|
+ null, null, null));
|
|
|
} catch (Exception e) {
|
|
|
handleException(e, url, startTime, "flowrunid");
|
|
|
}
|