org.apache.lens.server.query
Class QueryEndNotifier

java.lang.Object
  extended by org.apache.lens.server.api.events.AsyncEventListener<QueryEnded>
      extended by org.apache.lens.server.query.QueryEndNotifier
All Implemented Interfaces:
LensEventListener<QueryEnded>

public class QueryEndNotifier
extends AsyncEventListener<QueryEnded>

The Class QueryEndNotifier.


Nested Class Summary
static class QueryEndNotifier.Email
           
 
Field Summary
static String EMAIL_ERROR_COUNTER
          The Constant EMAIL_ERROR_COUNTER.
static org.apache.commons.logging.Log LOG
          The Constant LOG.
 
Fields inherited from interface org.apache.lens.server.api.events.LensEventListener
HANDLER_METHOD_NAME
 
Constructor Summary
QueryEndNotifier(QueryExecutionServiceImpl queryService, org.apache.hadoop.hive.conf.HiveConf hiveConf)
          Instantiates a new query end notifier.
 
Method Summary
 void process(QueryEnded event)
          Should implement the actual event handling.
static void sendMail(String host, String port, QueryEndNotifier.Email email, int mailSmtpTimeout, int mailSmtpConnectionTimeout)
          Send mail.
 
Methods inherited from class org.apache.lens.server.api.events.AsyncEventListener
getEventQueue, onEvent, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
The Constant LOG.


EMAIL_ERROR_COUNTER

public static final String EMAIL_ERROR_COUNTER
The Constant EMAIL_ERROR_COUNTER.

See Also:
Constant Field Values
Constructor Detail

QueryEndNotifier

public QueryEndNotifier(QueryExecutionServiceImpl queryService,
                        org.apache.hadoop.hive.conf.HiveConf hiveConf)
Instantiates a new query end notifier.

Parameters:
queryService - the query service
hiveConf - the hive conf
Method Detail

process

public void process(QueryEnded event)
Description copied from class: AsyncEventListener
Should implement the actual event handling.

Specified by:
process in class AsyncEventListener<QueryEnded>
Parameters:
event - the event

sendMail

public static void sendMail(String host,
                            String port,
                            QueryEndNotifier.Email email,
                            int mailSmtpTimeout,
                            int mailSmtpConnectionTimeout)
Send mail.

Parameters:
host - the host
port - the port
email - the email
mailSmtpTimeout - the mail smtp timeout
mailSmtpConnectionTimeout - the mail smtp connection timeout


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.