ayushtkn commented on code in PR #304:
URL: https://github.com/apache/tez/pull/304#discussion_r1325767649


##########
tez-dag/src/main/java/org/apache/tez/state/StateMachineTez.java:
##########
@@ -34,6 +38,10 @@ public class StateMachineTez<STATE extends Enum<STATE>, 
EVENTTYPE extends Enum<E
 
   private final StateMachine<STATE, EVENTTYPE, EVENT> realStatemachine;
 
+  private boolean isStateIntervalMonitorEnabled = false;
+  private long lastStateChangedTime = Time.monotonicNow();
+  private Map<String, Long> intervalSpentInStatesMs = new HashMap<>();

Review Comment:
   this can be final



##########
tez-api/src/main/java/org/apache/tez/common/counters/TaskAttemptCounter.java:
##########
@@ -0,0 +1,22 @@
+/**
+ * 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
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.tez.common.counters;
+
+public class TaskAttemptCounter {

Review Comment:
   I couldn't decode the usage of this 'empty' class, we are only using the 
name of this class, if only name is required can't we have a string constant or 
an enum 



##########
tez-dag/src/main/java/org/apache/tez/state/StateMachineTez.java:
##########
@@ -34,6 +38,10 @@ public class StateMachineTez<STATE extends Enum<STATE>, 
EVENTTYPE extends Enum<E
 
   private final StateMachine<STATE, EVENTTYPE, EVENT> realStatemachine;
 
+  private boolean isStateIntervalMonitorEnabled = false;
+  private long lastStateChangedTime = Time.monotonicNow();

Review Comment:
   shouldn't this be set as part of ``enableStateIntervalMonitor``?



##########
tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java:
##########
@@ -484,6 +493,18 @@ public TezCounters getCounters() {
     }
   }
 
+  private void maybeMergeAllTaskAttemptCounters(TezCounters taskCounters) {

Review Comment:
   nit
   I think we can ditch maybe from the name & just have 
```mergeAllTaskAttemptCounters(```, if stateIntervalMontior is enabled it does 
merge always



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@tez.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to