You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by je...@apache.org on 2016/10/13 20:36:14 UTC
[6/6] storm git commit: addressing comments
addressing comments
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/20b612c2
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/20b612c2
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/20b612c2
Branch: refs/heads/1.x-branch
Commit: 20b612c25f28057a26f0355acc289bcef3543333
Parents: 667fc5e
Author: Boyang Jerry Peng <je...@yahoo-inc.com>
Authored: Tue Oct 11 10:16:00 2016 -0500
Committer: Boyang Jerry Peng <je...@yahoo-inc.com>
Committed: Thu Oct 13 15:26:14 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/20b612c2/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/20b612c2/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;