asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [NO ISSUE][HYR] Avoid redundant touch of heartbeat time
Date Tue, 24 Oct 2017 22:17:16 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2100

Change subject: [NO ISSUE][HYR] Avoid redundant touch of heartbeat time
......................................................................

[NO ISSUE][HYR] Avoid redundant touch of heartbeat time

Change-Id: I88bc16c354cc0de59fa33d47705e9a4ddd617569
---
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractHeartbeatWork.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractTaskLifecycleWork.java
3 files changed, 35 insertions(+), 38 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/00/2100/1

diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
index fe4ce89..06af01f 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/NodeControllerState.java
@@ -213,39 +213,37 @@
     public synchronized void notifyHeartbeat(HeartbeatData hbData) {
         touchHeartbeat();
         hbTime[rrdPtr] = System.currentTimeMillis();
-        if (hbData != null) {
-            heapInitSize[rrdPtr] = hbData.heapInitSize;
-            heapUsedSize[rrdPtr] = hbData.heapUsedSize;
-            heapCommittedSize[rrdPtr] = hbData.heapCommittedSize;
-            heapMaxSize[rrdPtr] = hbData.heapMaxSize;
-            nonheapInitSize[rrdPtr] = hbData.nonheapInitSize;
-            nonheapUsedSize[rrdPtr] = hbData.nonheapUsedSize;
-            nonheapCommittedSize[rrdPtr] = hbData.nonheapCommittedSize;
-            nonheapMaxSize[rrdPtr] = hbData.nonheapMaxSize;
-            threadCount[rrdPtr] = hbData.threadCount;
-            peakThreadCount[rrdPtr] = hbData.peakThreadCount;
-            systemLoadAverage[rrdPtr] = hbData.systemLoadAverage;
-            int gcN = hbSchema.getGarbageCollectorInfos().length;
-            for (int i = 0; i < gcN; ++i) {
-                gcCollectionCounts[i][rrdPtr] = hbData.gcCollectionCounts[i];
-                gcCollectionTimes[i][rrdPtr] = hbData.gcCollectionTimes[i];
-            }
-            netPayloadBytesRead[rrdPtr] = hbData.netPayloadBytesRead;
-            netPayloadBytesWritten[rrdPtr] = hbData.netPayloadBytesWritten;
-            netSignalingBytesRead[rrdPtr] = hbData.netSignalingBytesRead;
-            netSignalingBytesWritten[rrdPtr] = hbData.netSignalingBytesWritten;
-            datasetNetPayloadBytesRead[rrdPtr] = hbData.datasetNetPayloadBytesRead;
-            datasetNetPayloadBytesWritten[rrdPtr] = hbData.datasetNetPayloadBytesWritten;
-            datasetNetSignalingBytesRead[rrdPtr] = hbData.datasetNetSignalingBytesRead;
-            datasetNetSignalingBytesWritten[rrdPtr] = hbData.datasetNetSignalingBytesWritten;
-            ipcMessagesSent[rrdPtr] = hbData.ipcMessagesSent;
-            ipcMessageBytesSent[rrdPtr] = hbData.ipcMessageBytesSent;
-            ipcMessagesReceived[rrdPtr] = hbData.ipcMessagesReceived;
-            ipcMessageBytesReceived[rrdPtr] = hbData.ipcMessageBytesReceived;
-            diskReads[rrdPtr] = hbData.diskReads;
-            diskWrites[rrdPtr] = hbData.diskWrites;
-            rrdPtr = (rrdPtr + 1) % RRD_SIZE;
+        heapInitSize[rrdPtr] = hbData.heapInitSize;
+        heapUsedSize[rrdPtr] = hbData.heapUsedSize;
+        heapCommittedSize[rrdPtr] = hbData.heapCommittedSize;
+        heapMaxSize[rrdPtr] = hbData.heapMaxSize;
+        nonheapInitSize[rrdPtr] = hbData.nonheapInitSize;
+        nonheapUsedSize[rrdPtr] = hbData.nonheapUsedSize;
+        nonheapCommittedSize[rrdPtr] = hbData.nonheapCommittedSize;
+        nonheapMaxSize[rrdPtr] = hbData.nonheapMaxSize;
+        threadCount[rrdPtr] = hbData.threadCount;
+        peakThreadCount[rrdPtr] = hbData.peakThreadCount;
+        systemLoadAverage[rrdPtr] = hbData.systemLoadAverage;
+        int gcN = hbSchema.getGarbageCollectorInfos().length;
+        for (int i = 0; i < gcN; ++i) {
+            gcCollectionCounts[i][rrdPtr] = hbData.gcCollectionCounts[i];
+            gcCollectionTimes[i][rrdPtr] = hbData.gcCollectionTimes[i];
         }
+        netPayloadBytesRead[rrdPtr] = hbData.netPayloadBytesRead;
+        netPayloadBytesWritten[rrdPtr] = hbData.netPayloadBytesWritten;
+        netSignalingBytesRead[rrdPtr] = hbData.netSignalingBytesRead;
+        netSignalingBytesWritten[rrdPtr] = hbData.netSignalingBytesWritten;
+        datasetNetPayloadBytesRead[rrdPtr] = hbData.datasetNetPayloadBytesRead;
+        datasetNetPayloadBytesWritten[rrdPtr] = hbData.datasetNetPayloadBytesWritten;
+        datasetNetSignalingBytesRead[rrdPtr] = hbData.datasetNetSignalingBytesRead;
+        datasetNetSignalingBytesWritten[rrdPtr] = hbData.datasetNetSignalingBytesWritten;
+        ipcMessagesSent[rrdPtr] = hbData.ipcMessagesSent;
+        ipcMessageBytesSent[rrdPtr] = hbData.ipcMessageBytesSent;
+        ipcMessagesReceived[rrdPtr] = hbData.ipcMessagesReceived;
+        ipcMessageBytesReceived[rrdPtr] = hbData.ipcMessageBytesReceived;
+        diskReads[rrdPtr] = hbData.diskReads;
+        diskWrites[rrdPtr] = hbData.diskWrites;
+        rrdPtr = (rrdPtr + 1) % RRD_SIZE;
     }
 
     public void touchHeartbeat() {
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractHeartbeatWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractHeartbeatWork.java
index fa5dcd0..8e7faff 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractHeartbeatWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractHeartbeatWork.java
@@ -42,7 +42,11 @@
         INodeManager nodeManager = ccs.getNodeManager();
         NodeControllerState state = nodeManager.getNodeControllerState(nodeId);
         if (state != null) {
-            state.notifyHeartbeat(hbData);
+            if (hbData != null) {
+                state.notifyHeartbeat(hbData);
+            } else {
+                state.touchHeartbeat();
+            }
         }
         runWork();
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractTaskLifecycleWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractTaskLifecycleWork.java
index 446bfd1..3babf00 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractTaskLifecycleWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/AbstractTaskLifecycleWork.java
@@ -27,7 +27,6 @@
 import org.apache.hyracks.api.job.ActivityCluster;
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.control.cc.ClusterControllerService;
-import org.apache.hyracks.control.cc.NodeControllerState;
 import org.apache.hyracks.control.cc.job.ActivityPlan;
 import org.apache.hyracks.control.cc.job.IJobManager;
 import org.apache.hyracks.control.cc.job.JobRun;
@@ -75,10 +74,6 @@
                     }
                 }
             }
-        }
-        final NodeControllerState ncState = ccs.getNodeManager().getNodeControllerState(nodeId);
-        if (ncState != null) {
-            ncState.touchHeartbeat();
         }
     }
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2100
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88bc16c354cc0de59fa33d47705e9a4ddd617569
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message