deniskuzZ commented on code in PR #6142:
URL: https://github.com/apache/hive/pull/6142#discussion_r2444180152
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/leader/LeaderElectionContext.java:
##########
@@ -100,8 +101,14 @@ public void start() throws Exception {
Map<TTYPE, List<LeadershipStateListener>> listenerMap = this.listeners;
if (conf.getBoolean(LEADER_IN_TEST, false)) {
Map<TTYPE, List<LeadershipStateListener>> newListeners = new HashMap<>();
- newListeners.put(TTYPE.HOUSEKEEPING, new ArrayList<>());
- listenerMap.forEach((k, v) ->
newListeners.get(TTYPE.HOUSEKEEPING).addAll(v));
+ List<LeadershipStateListener> listeners = new ArrayList<>();
+ listenerMap.forEach((k, v) -> listeners.addAll(v));
+ String testListenerCls = conf.get("metastore.leader.test.listener");
Review Comment:
That is a very bad practice to bring test related things into production
code! Try mocking/stubbing, etc..
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]