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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
