need to provide details on pending AA requests for Web UI to be accurate
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/7278c39c Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/7278c39c Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/7278c39c Branch: refs/heads/develop Commit: 7278c39c9bf85c7a217ce5568760f6738cb34a2e Parents: 8c5065d Author: Steve Loughran <[email protected]> Authored: Sun Nov 15 19:19:52 2015 +0000 Committer: Steve Loughran <[email protected]> Committed: Sun Nov 15 19:19:52 2015 +0000 ---------------------------------------------------------------------- .../slider/server/appmaster/state/AppState.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7278c39c/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java index 4a3cc45..d977323 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java @@ -243,13 +243,19 @@ public class AppState { */ private final LongGauge surplusContainers = new LongGauge(); - /** - * Track the number of requested Containers + * Track the number of requested containers. + * Important: this does not include AA requests which are yet to be issued. */ private final LongGauge outstandingContainerRequests = new LongGauge(); /** + * Track the number of pending (not yet active) requests + * Important: this does not include AA requests which are yet to be issued. + */ + private final LongGauge pendingAARequests = new LongGauge(); + + /** * Map of requested nodes. This records the command used to start it, * resources, etc. When container started callback is received, * the node is promoted from here to the containerMap @@ -376,6 +382,10 @@ public class AppState { startFailedContainerCount.inc(); } + public long getTotalOutstandingRequests() { + return outstandingContainerRequests.get() + + pendingAARequests.get(); + } public AtomicInteger getCompletionOfNodeNotInLiveListEvent() { return completionOfNodeNotInLiveListEvent; } @@ -405,7 +415,6 @@ public class AppState { return completedContainers; } - public Map<ContainerId, RoleInstance> getFailedContainers() { return failedContainers; }
