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

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

                Author: ASF GitHub Bot
            Created on: 27/Jun/19 18:30
            Start Date: 27/Jun/19 18:30
    Worklog Time Spent: 10m 
      Work Description: odraese commented on pull request #691: HIVE-21911: 
Pluggable LlapMetricsListener on Tez side to disable / resize Daemons
URL: https://github.com/apache/hive/pull/691#discussion_r298310874
 
 

 ##########
 File path: 
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/metrics/LlapMetricsCollector.java
 ##########
 @@ -58,26 +61,44 @@
   private final Map<String, LlapManagementProtocolClientImpl> llapClients;
   private final Map<String, LlapMetrics> instanceStatisticsMap;
   private final long metricsCollectionMs;
+  @VisibleForTesting
+  final LlapMetricsListener listener;
 
 
-  public LlapMetricsCollector(Configuration conf) {
+  public LlapMetricsCollector(Configuration conf, LlapRegistryService 
registry) {
     this(
             conf,
             Executors.newSingleThreadScheduledExecutor(
                     new 
ThreadFactoryBuilder().setDaemon(true).setNameFormat(THREAD_NAME)
                             .build()),
-            LlapManagementProtocolClientImplFactory.basicInstance(conf));
+            LlapManagementProtocolClientImplFactory.basicInstance(conf),
+            registry);
   }
 
   @VisibleForTesting
   LlapMetricsCollector(Configuration conf, ScheduledExecutorService 
scheduledMetricsExecutor,
-                       LlapManagementProtocolClientImplFactory clientFactory) {
+                       LlapManagementProtocolClientImplFactory clientFactory,
+                       LlapRegistryService registry) {
     this.scheduledMetricsExecutor = scheduledMetricsExecutor;
     this.clientFactory = clientFactory;
     this.llapClients = new HashMap<>();
     this.instanceStatisticsMap = new ConcurrentHashMap<>();
     this.metricsCollectionMs = HiveConf.getTimeVar(conf,
             
HiveConf.ConfVars.LLAP_TASK_SCHEDULER_AM_COLLECT_DAEMON_METRICS_MS, 
TimeUnit.MILLISECONDS);
+    String listenerClass = HiveConf.getVar(conf,
+        
HiveConf.ConfVars.LLAP_TASK_SCHEDULER_AM_COLLECT_DAEMON_METRICS_LISTENER);
+    if (Strings.isBlank(listenerClass)) {
+      listener = null;
+    } else {
+      try {
+        listener = 
(LlapMetricsListener)Class.forName(listenerClass.trim()).newInstance();
 
 Review comment:
   Maybe the instance should be created through something like the 
ReflectionUtil?
   This would ensure that we have an accessible constructor and be the common 
way.... (I believe).
 
----------------------------------------------------------------
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]


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

    Worklog Id:     (was: 268725)
    Time Spent: 40m  (was: 0.5h)

> Pluggable LlapMetricsListener on Tez side to disable / resize Daemons
> ---------------------------------------------------------------------
>
>                 Key: HIVE-21911
>                 URL: https://issues.apache.org/jira/browse/HIVE-21911
>             Project: Hive
>          Issue Type: Sub-task
>          Components: llap, Tez
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21911.patch
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> We need to have a way to plug in different listeners which act upon the 
> LlapDaemon statistics.
> This listener should be able to disable / resize the LlapDaemons based on 
> health data.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to