addressing comments
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/f621cf2b Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f621cf2b Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f621cf2b Branch: refs/heads/master Commit: f621cf2b05be59b7327f598450336e58250b8823 Parents: 0d616ba Author: Boyang Jerry Peng <jerryp...@yahoo-inc.com> Authored: Tue Oct 11 10:16:00 2016 -0500 Committer: Boyang Jerry Peng <jerryp...@yahoo-inc.com> Committed: Tue Oct 11 10:16:00 2016 -0500 ---------------------------------------------------------------------- .../storm/scheduler/resource/RAS_Node.java | 12 +++++++++++ .../eviction/TestDefaultEvictionStrategy.java | 21 +++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/f621cf2b/storm-core/src/jvm/org/apache/storm/scheduler/resource/RAS_Node.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/org/apache/storm/scheduler/resource/RAS_Node.java b/storm-core/src/jvm/org/apache/storm/scheduler/resource/RAS_Node.java index 79502d7..0bb36e8 100644 --- a/storm-core/src/jvm/org/apache/storm/scheduler/resource/RAS_Node.java +++ b/storm-core/src/jvm/org/apache/storm/scheduler/resource/RAS_Node.java @@ -514,4 +514,16 @@ public class RAS_Node { consumeCPU(taskCpuReq); consumeMemory(taskMemReq); } + + /** + * frees the amount of resources for a executor in a topology. + * @param exec is the executor for which the resources are freed for + * @param topo the topology the executor is a part + */ + public void freeResourcesForTask(ExecutorDetails exec, TopologyDetails topo) { + Double taskMemReq = topo.getTotalMemReqTask(exec); + Double taskCpuReq = topo.getTotalCpuReqTask(exec); + freeCPU(taskCpuReq); + freeMemory(taskMemReq); + } } http://git-wip-us.apache.org/repos/asf/storm/blob/f621cf2b/storm-core/test/jvm/org/apache/storm/scheduler/resource/strategies/eviction/TestDefaultEvictionStrategy.java ---------------------------------------------------------------------- diff --git a/storm-core/test/jvm/org/apache/storm/scheduler/resource/strategies/eviction/TestDefaultEvictionStrategy.java b/storm-core/test/jvm/org/apache/storm/scheduler/resource/strategies/eviction/TestDefaultEvictionStrategy.java index 1d199b1..f2d65bd 100644 --- a/storm-core/test/jvm/org/apache/storm/scheduler/resource/strategies/eviction/TestDefaultEvictionStrategy.java +++ b/storm-core/test/jvm/org/apache/storm/scheduler/resource/strategies/eviction/TestDefaultEvictionStrategy.java @@ -1,3 +1,21 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.storm.scheduler.resource.strategies.eviction; import org.apache.storm.Config; @@ -16,9 +34,6 @@ import org.junit.Test; import java.util.HashMap; import java.util.Map; -/** - * Created by jerrypeng on 10/6/16. - */ public class TestDefaultEvictionStrategy { private static int currentTime = 1450418597;