You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/06/07 08:03:27 UTC

[GitHub] [hive] ayushtkn opened a new pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

ayushtkn opened a new pull request #2356:
URL: https://github.com/apache/hive/pull/2356


   JMX output in UI- First:
   ![image](https://user-images.githubusercontent.com/25608848/120980860-aa3ace80-c794-11eb-8166-8cd2b84db27d.png)
   JMX output in UI- Second:
   ![image](https://user-images.githubusercontent.com/25608848/120980917-ba52ae00-c794-11eb-836e-113dca5fe8ed.png)
   JMX output in UI- Third:
   ![image](https://user-images.githubusercontent.com/25608848/120980956-c474ac80-c794-11eb-9b95-346c65f83317.png)
   
   Sample Output from JConsole:
   ![image](https://user-images.githubusercontent.com/25608848/120981000-d35b5f00-c794-11eb-88b5-d51ab31c7eb0.png)
   
   JConsole-MBeans Values:
   ![image](https://user-images.githubusercontent.com/25608848/120981035-de15f400-c794-11eb-9c0c-d3f2bf00bc6b.png)
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #2356:
URL: https://github.com/apache/hive/pull/2356#issuecomment-865509568


   **First Snap:**
   ![image](https://user-images.githubusercontent.com/25608848/122861071-720ec080-d33c-11eb-99d3-fd03a10b0738.png)
   **Second Snap**
   ![image](https://user-images.githubusercontent.com/25608848/122861110-8226a000-d33c-11eb-92ec-8854aeb7c07c.png)
   
   **Third Snap**
   ![image](https://user-images.githubusercontent.com/25608848/122861138-8d79cb80-d33c-11eb-843a-c325e6efc48d.png)
   
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #2356:
URL: https://github.com/apache/hive/pull/2356#issuecomment-860582666


   New Output with the added Fields:
   **1st Snap:**
   ![image](https://user-images.githubusercontent.com/25608848/121879490-8fcf9a80-cd2a-11eb-8cae-de6460e09fc7.png)
   
   **2nd Snap:**
   ![image](https://user-images.githubusercontent.com/25608848/121879525-978f3f00-cd2a-11eb-91f2-431e7d29d149.png)
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #2356:
URL: https://github.com/apache/hive/pull/2356#issuecomment-865509568


   **First Snap:**
   ![image](https://user-images.githubusercontent.com/25608848/122861071-720ec080-d33c-11eb-99d3-fd03a10b0738.png)
   **Second Snap**
   ![image](https://user-images.githubusercontent.com/25608848/122861110-8226a000-d33c-11eb-92ec-8854aeb7c07c.png)
   
   **Third Snap**
   ![image](https://user-images.githubusercontent.com/25608848/122861138-8d79cb80-d33c-11eb-843a-c325e6efc48d.png)
   
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] aasha commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
aasha commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r650648742



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {

Review comment:
       dump dir also we can expose?

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplStatsTracker.java
##########
@@ -29,6 +32,7 @@
  * Tracks the replication statistics per event type.
  */
 public class ReplStatsTracker {
+  private static final Logger LOG = LoggerFactory.getLogger(ReplStatsTracker.class);

Review comment:
       unused?

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -4663,6 +4678,26 @@ public void testIncrementalStatisticsMetrics() throws Throwable {
         }
       }
     }
+    verifyMBeanStatistics(testName, replDbName, nameStri, events);
+    // Clean up the test setup.
+    ReplLoadWork.setMbeansParamsForTesting(false,false);
+    MBeans.unregister(ObjectName.getInstance(nameStri));
+  }
+
+  private void verifyMBeanStatistics(String testName, String replDbName, String nameStri, String[] events)
+      throws MalformedObjectNameException, MBeanException, AttributeNotFoundException, InstanceNotFoundException,
+      ReflectionException {
+    ObjectName name = ObjectName.getInstance(nameStri);
+
+    assertTrue(
+        ManagementFactory.getPlatformMBeanServer().getAttribute(name, "Stage").toString().contains("INCREMENTAL"));

Review comment:
       in metrics we call repl dump and load as stage
   bootstrap and incremental is referred to as replication type. better to keep same convention

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {
+
+  /**
+   * Gets the name of the database which is being loaded.
+   * @return the source database name.
+   */
+  public String getSourceDatabase();
+
+  /**
+   * Gets the name of the database on which load is happening.
+   * @return the target database name.
+   */
+  public String getTargetDatabase();
+
+  /**
+   * Gets the stage of Replication.
+   * @return INCREMENTAL or BOOTSTRAP load.
+   */
+  public String getStage();
+
+  /**
+   * Gets the name of scheduled query being run.
+   * @return the name of the scheduled query.
+   */
+  public String getScheduledQueryName();

Review comment:
       Add current event id processed and last repl id?




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] aasha commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
aasha commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r650972687



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {
+
+  /**
+   * Gets the name of the database which is being loaded.
+   * @return the source database name.
+   */
+  public String getSourceDatabase();
+
+  /**
+   * Gets the name of the database on which load is happening.
+   * @return the target database name.
+   */
+  public String getTargetDatabase();
+
+  /**
+   * Gets the stage of Replication.
+   * @return INCREMENTAL or BOOTSTRAP load.
+   */
+  public String getStage();
+
+  /**
+   * Gets the name of scheduled query being run.
+   * @return the name of the scheduled query.
+   */
+  public String getScheduledQueryName();

Review comment:
       what about current event id?




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] aasha commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
aasha commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r656177643



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWork.java
##########
@@ -347,6 +348,27 @@ public String getReplStats() {
     }
   }
 
+  @Override
+  public String getCurrentEventId() {
+    try {
+      if (replStatsTracker != null) {
+        return replStatsTracker.getLastEventId();
+      } else {
+        return "";
+      }
+    } catch (Exception e) {
+      return "Got Error" + e.getMessage();
+    }
+  }
+
+  @Override
+  public Long getLastEventId() {
+    if (incrementalLoadTasksBuilder != null) {
+      return incrementalLoadTasksBuilder.eventTo();
+    }
+    return -1L;

Review comment:
       this will be eventFrom for bootstrap




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r650834227



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {
+
+  /**
+   * Gets the name of the database which is being loaded.
+   * @return the source database name.
+   */
+  public String getSourceDatabase();
+
+  /**
+   * Gets the name of the database on which load is happening.
+   * @return the target database name.
+   */
+  public String getTargetDatabase();
+
+  /**
+   * Gets the stage of Replication.
+   * @return INCREMENTAL or BOOTSTRAP load.
+   */
+  public String getStage();
+
+  /**
+   * Gets the name of scheduled query being run.
+   * @return the name of the scheduled query.
+   */
+  public String getScheduledQueryName();

Review comment:
       The repl stats tracks what comes to replLogger, the Last event id is there, I have added that in the JMX




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r655061875



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {
+
+  /**
+   * Gets the name of the database which is being loaded.
+   * @return the source database name.
+   */
+  public String getSourceDatabase();
+
+  /**
+   * Gets the name of the database on which load is happening.
+   * @return the target database name.
+   */
+  public String getTargetDatabase();
+
+  /**
+   * Gets the stage of Replication.
+   * @return INCREMENTAL or BOOTSTRAP load.
+   */
+  public String getStage();
+
+  /**
+   * Gets the name of scheduled query being run.
+   * @return the name of the scheduled query.
+   */
+  public String getScheduledQueryName();

Review comment:
       added




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] aasha merged pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
aasha merged pull request #2356:
URL: https://github.com/apache/hive/pull/2356


   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ayushtkn commented on a change in pull request #2356: HIVE-25207. Expose incremental load statistics via JMX.

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2356:
URL: https://github.com/apache/hive/pull/2356#discussion_r650833522



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadWorkMBean.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.hadoop.hive.ql.exec.repl;
+
+public interface ReplLoadWorkMBean {

Review comment:
       Done

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplStatsTracker.java
##########
@@ -29,6 +32,7 @@
  * Tracks the replication statistics per event type.
  */
 public class ReplStatsTracker {
+  private static final Logger LOG = LoggerFactory.getLogger(ReplStatsTracker.class);

Review comment:
       Removed

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -4663,6 +4678,26 @@ public void testIncrementalStatisticsMetrics() throws Throwable {
         }
       }
     }
+    verifyMBeanStatistics(testName, replDbName, nameStri, events);
+    // Clean up the test setup.
+    ReplLoadWork.setMbeansParamsForTesting(false,false);
+    MBeans.unregister(ObjectName.getInstance(nameStri));
+  }
+
+  private void verifyMBeanStatistics(String testName, String replDbName, String nameStri, String[] events)
+      throws MalformedObjectNameException, MBeanException, AttributeNotFoundException, InstanceNotFoundException,
+      ReflectionException {
+    ObjectName name = ObjectName.getInstance(nameStri);
+
+    assertTrue(
+        ManagementFactory.getPlatformMBeanServer().getAttribute(name, "Stage").toString().contains("INCREMENTAL"));

Review comment:
       Done




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org