apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gauravgopi...@apache.org
Subject [1/2] incubator-apex-core git commit: APEX-101 #resolve store memory allocated in megabytes instead of bytes
Date Thu, 10 Sep 2015 21:43:02 GMT
Repository: incubator-apex-core
Updated Branches:
  refs/heads/devel-3 b57972bd3 -> 9d83a4445


APEX-101 #resolve store memory allocated in megabytes instead of bytes


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/b82f9052
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/b82f9052
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/b82f9052

Branch: refs/heads/devel-3
Commit: b82f90523f01019443220db7ceefa9f44c055e8e
Parents: b57972b
Author: David Yan <david@datatorrent.com>
Authored: Wed Sep 9 18:18:29 2015 -0700
Committer: David Yan <david@datatorrent.com>
Committed: Thu Sep 10 14:22:27 2015 -0700

----------------------------------------------------------------------
 .../com/datatorrent/stram/StreamingContainerManager.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/b82f9052/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
index 7944a4b..41738f4 100644
--- a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
+++ b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
@@ -174,7 +174,7 @@ public class StreamingContainerManager implements PlanContext
   private long completeEndWindowStatsWindowId;
   private final ConcurrentHashMap<String, MovingAverageLong> rpcLatencies = new ConcurrentHashMap<String,
MovingAverageLong>();
   private final AtomicLong nodeToStramRequestIds = new AtomicLong(1);
-  private long allocatedMemoryBytes = 0;
+  private int allocatedMemoryMB = 0;
   private List<AppDataSource> appDataSources = null;
   private final Cache<Long, Object> commandResponse = CacheBuilder.newBuilder().expireAfterWrite(1,
TimeUnit.MINUTES).build();
   private long lastLatencyWarningTime;
@@ -395,7 +395,7 @@ public class StreamingContainerManager implements PlanContext
       }
       if (nmHttpPort != null) {
         String nodeHttpAddress = nmHost + ":" + nmHttpPort;
-        if (allocatedMemoryBytes == 0) {
+        if (allocatedMemoryMB == 0) {
           String url = ConfigUtils.getSchemePrefix(conf) + nodeHttpAddress + "/ws/v1/node/containers/"
+ ci.id;
           WebServicesClient webServicesClient = new WebServicesClient();
           try {
@@ -403,7 +403,7 @@ public class StreamingContainerManager implements PlanContext
             JSONObject json = new JSONObject(content);
             int totalMemoryNeededMB = json.getJSONObject("container").getInt("totalMemoryNeededMB");
             if (totalMemoryNeededMB > 0) {
-              allocatedMemoryBytes = totalMemoryNeededMB * 1024 * 1024;
+              allocatedMemoryMB = totalMemoryNeededMB;
             } else {
               LOG.warn("Could not determine the memory allocated for the streaming application
master.  Node manager is reporting {} MB from {}", totalMemoryNeededMB, url);
             }
@@ -416,7 +416,7 @@ public class StreamingContainerManager implements PlanContext
         ci.rawContainerLogsUrl = ConfigUtils.getRawContainerLogsUrl(conf, nodeHttpAddress,
plan.getLogicalPlan().getAttributes().get(LogicalPlan.APPLICATION_ID), ci.id);
       }
     }
-    ci.memoryMBAllocated = (int)(allocatedMemoryBytes / (1024 * 1024));
+    ci.memoryMBAllocated = allocatedMemoryMB;
     ci.memoryMBFree = ((int)(Runtime.getRuntime().freeMemory() / (1024 * 1024)));
     ci.lastHeartbeat = -1;
     ci.startedTime = startTime;


Mime
View raw message