[ 
https://issues.apache.org/jira/browse/HIVE-27019?focusedWorklogId=846560&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-846560
 ]

ASF GitHub Bot logged work on HIVE-27019:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Feb/23 08:56
            Start Date: 21/Feb/23 08:56
    Worklog Time Spent: 10m 
      Work Description: SourabhBadhya commented on code in PR #4032:
URL: https://github.com/apache/hive/pull/4032#discussion_r1112751420


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java:
##########
@@ -97,23 +47,31 @@ public class Cleaner extends MetaStoreCompactorThread {
   static final private Logger LOG = LoggerFactory.getLogger(CLASS_NAME);
   private boolean metricsEnabled = false;
 
-  private ReplChangeManager replChangeManager;
   private ExecutorService cleanerExecutor;
+  private List<CleaningRequestHandler> cleaningRequestHandlers;
+  private FSRemover fsRemover;
+
+  public Cleaner() {
+  }
+
+  public Cleaner(List<CleaningRequestHandler> cleaningRequestHandlers) {

Review Comment:
   Done.



##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java:
##########
@@ -97,23 +47,31 @@ public class Cleaner extends MetaStoreCompactorThread {
   static final private Logger LOG = LoggerFactory.getLogger(CLASS_NAME);
   private boolean metricsEnabled = false;
 
-  private ReplChangeManager replChangeManager;
   private ExecutorService cleanerExecutor;
+  private List<CleaningRequestHandler> cleaningRequestHandlers;
+  private FSRemover fsRemover;
+
+  public Cleaner() {
+  }
+
+  public Cleaner(List<CleaningRequestHandler> cleaningRequestHandlers) {
+    this.cleaningRequestHandlers = cleaningRequestHandlers;
+  }
 
   @Override
   public void init(AtomicBoolean stop) throws Exception {
     super.init(stop);
-    replChangeManager = ReplChangeManager.getInstance(conf);
     checkInterval = conf.getTimeVar(
             HiveConf.ConfVars.HIVE_COMPACTOR_CLEANER_RUN_INTERVAL, 
TimeUnit.MILLISECONDS);
     cleanerExecutor = CompactorUtil.createExecutorWithThreadFactory(
             
conf.getIntVar(HiveConf.ConfVars.HIVE_COMPACTOR_CLEANER_THREADS_NUM),
             COMPACTOR_CLEANER_THREAD_NAME_FORMAT);
     metricsEnabled = MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.METRICS_ENABLED) &&
         MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.METASTORE_ACIDMETRICS_EXT_ON);
-    boolean tableCacheOn = MetastoreConf.getBoolVar(conf,
-            MetastoreConf.ConfVars.COMPACTOR_CLEANER_TABLECACHE_ON);
-    initializeCache(tableCacheOn);
+    if (cleaningRequestHandlers == null || cleaningRequestHandlers.isEmpty()) {

Review Comment:
   Done.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 846560)
    Time Spent: 6h 20m  (was: 6h 10m)

> Split Cleaner into separate manageable modular entities
> -------------------------------------------------------
>
>                 Key: HIVE-27019
>                 URL: https://issues.apache.org/jira/browse/HIVE-27019
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Sourabh Badhya
>            Assignee: Sourabh Badhya
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 6h 20m
>  Remaining Estimate: 0h
>
> As described by the parent task - 
> Cleaner can be divided into separate entities like -
> *1) Handler* - This entity fetches the data from the metastore DB from 
> relevant tables and converts it into a request entity called CleaningRequest. 
> It would also do SQL operations post cleanup (postprocess). Every type of 
> cleaning request is provided by a separate handler.
> *2) Filesystem remover* - This entity fetches the cleaning requests from 
> various handlers and deletes them according to the cleaning request.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to