InvisibleProgrammer commented on code in PR #3489:
URL: https://github.com/apache/hive/pull/3489#discussion_r946679677


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -142,65 +139,10 @@ public void run() {
   public void init(AtomicBoolean stop) throws Exception {
     super.init(stop);
     this.workerName = getWorkerId();
+    this.statsUpdater = new StatsUpdater();

Review Comment:
   If we go back to the single instance, it will be static. And the reason why 
we extracted the logic into its own service class is to avoid static and to be 
able to do unit tests. We can still do it as static but if we want to do that, 
it will introduce a larger refactor that affects existing test classes that use 
PowerMock. 
   All the solutions have their drawback. I see no solution that can meet all 
the requirements. 
   In case you want to make sure that will be a single instance only, I highly 
recommend removing PowerMock first. 
   
   So my question is: what we should do first? Stop computing statistics or 
make the code easier to test in case of using static? 
   
   To be honest, I would prefer using some dependency injection framework that 
can provide us with a single instance easily but I'm afraid it is too far from 
our current scope. 
   



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

Reply via email to