This project has retired. For details please refer to its Attic page.
QueryEndNotifier (Lens 2.0.1-beta-incubating API)

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.


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, String from, String to, String cc, String subject, String mailMessage, 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,
                            String from,
                            String to,
                            String cc,
                            String subject,
                            String mailMessage,
                            int mailSmtpTimeout,
                            int mailSmtpConnectionTimeout)
Send mail.

Parameters:
host - the host
port - the port
from - the from
to - the to
cc - the cc
subject - the subject
mailMessage - the mail message
mailSmtpTimeout - the mail smtp timeout
mailSmtpConnectionTimeout - the mail smtp connection timeout


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