Repository: incubator-slider Updated Branches: refs/heads/develop ad0be5567 -> 8d0e5b71e
Minor cleanup/tuning alongside SLIDER-82 Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8d0e5b71 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8d0e5b71 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8d0e5b71 Branch: refs/heads/develop Commit: 8d0e5b71e4e1758a2c96fc41736f452d496b4f2b Parents: ad0be55 Author: Steve Loughran <[email protected]> Authored: Mon Sep 14 19:17:59 2015 +0100 Committer: Steve Loughran <[email protected]> Committed: Mon Sep 14 19:17:59 2015 +0100 ---------------------------------------------------------------------- .../appmaster/operations/AsyncRMOperationHandler.java | 2 ++ .../org/apache/slider/server/appmaster/state/AppState.java | 9 +++++---- .../apache/slider/server/appmaster/state/RoleHistory.java | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8d0e5b71/slider-core/src/main/java/org/apache/slider/server/appmaster/operations/AsyncRMOperationHandler.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/operations/AsyncRMOperationHandler.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/operations/AsyncRMOperationHandler.java index 11afc0e..03231ef 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/operations/AsyncRMOperationHandler.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/operations/AsyncRMOperationHandler.java @@ -63,6 +63,7 @@ public class AsyncRMOperationHandler extends RMOperationHandler { * @param count count to cancel * @return number of requests cancelled */ + @SuppressWarnings("unchecked") protected int cancelSinglePriorityRequests(Priority priority, int count) { List<Collection<AMRMClient.ContainerRequest>> requestSets = @@ -88,6 +89,7 @@ public class AsyncRMOperationHandler extends RMOperationHandler { } @Override + @SuppressWarnings("unchecked") public void cancelSingleRequest(AMRMClient.ContainerRequest request) { // a single release client.removeContainerRequest(request); http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8d0e5b71/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 18eb578..6990a24 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 @@ -92,8 +92,8 @@ import static org.apache.slider.api.ResourceKeys.YARN_CORES; import static org.apache.slider.api.ResourceKeys.YARN_LABEL_EXPRESSION; import static org.apache.slider.api.ResourceKeys.YARN_MEMORY; import static org.apache.slider.api.RoleKeys.ROLE_FAILED_INSTANCES; -import static org.apache.slider.api.RoleKeys.ROLE_FAILED_STARTING_INSTANCES; import static org.apache.slider.api.RoleKeys.ROLE_FAILED_RECENTLY_INSTANCES; +import static org.apache.slider.api.RoleKeys.ROLE_FAILED_STARTING_INSTANCES; import static org.apache.slider.api.RoleKeys.ROLE_NODE_FAILED_INSTANCES; import static org.apache.slider.api.RoleKeys.ROLE_PREEMPTED_INSTANCES; import static org.apache.slider.api.RoleKeys.ROLE_RELEASING_INSTANCES; @@ -1931,7 +1931,7 @@ public class AppState { if (delta > 0) { log.info("{}: Asking for {} more nodes(s) for a total of {} ", name, delta, expected); - //more workers needed than we have -ask for more + // more workers needed than we have -ask for more for (int i = 0; i < delta; i++) { Resource capability = recordFactory.newResource(); AMRMClient.ContainerRequest containerAsk = @@ -1948,9 +1948,9 @@ public class AppState { log.info("{}: Asking for {} fewer node(s) for a total of {}", name, -delta, expected); - //reduce the number expected (i.e. subtract the delta) + // reduce the number expected (i.e. subtract the delta) - //then pick some containers to kill + // then pick some containers to kill int excess = -delta; // how many requests are outstanding @@ -2125,6 +2125,7 @@ public class AppState { assignments.clear(); releaseOperations.clear(); List<Container> ordered = roleHistory.prepareAllocationList(allocatedContainers); + log.debug("onContainersAllocated(): Total containers allocated = {}", ordered.size()); for (Container container : ordered) { String containerHostInfo = container.getNodeId().getHost() + ":" + http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8d0e5b71/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java index 926d440..1a7f537 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java @@ -717,8 +717,7 @@ public class RoleHistory { if (desiredCount <= actualCount) { // all outstanding requests have been satisfied // clear all the lists, so returning nodes to the available set - List<NodeInstance> - hosts = outstandingRequests.resetOutstandingRequests(role); + List<NodeInstance> hosts = outstandingRequests.resetOutstandingRequests(role); if (!hosts.isEmpty()) { //add the list log.info("Adding {} hosts for role {}", hosts.size(), role);
