public class EventHandlerService extends Object implements Service
Modifier and Type | Class and Description |
---|---|
class |
EventHandlerService.EventWorker |
Modifier and Type | Field and Description |
---|---|
static String |
CONF_BATCH_SIZE |
static String |
CONF_EVENT_QUEUE |
static String |
CONF_FILTER_APP_TYPES |
static String |
CONF_LISTENERS |
static String |
CONF_PREFIX |
static String |
CONF_QUEUE_SIZE |
static String |
CONF_WORKER_INTERVAL |
static String |
CONF_WORKER_THREADS |
DEFAULT_LOCK_TIMEOUT, lockTimeout
Constructor and Description |
---|
EventHandlerService() |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(Object listener,
org.apache.hadoop.conf.Configuration conf,
String name) |
void |
destroy()
Destroy the service.
|
Set<String> |
getAppTypes() |
EventQueue |
getEventQueue() |
Class<? extends Service> |
getInterface()
Return the public interface of the service.
|
void |
init(Services services)
Initialize the service.
|
static boolean |
isEnabled() |
boolean |
isSupportedApptype(String appType) |
String |
listEventListeners() |
void |
queueEvent(Event event) |
void |
setAppTypes(Set<String> types) |
public static final String CONF_PREFIX
public static final String CONF_QUEUE_SIZE
public static final String CONF_EVENT_QUEUE
public static final String CONF_LISTENERS
public static final String CONF_FILTER_APP_TYPES
public static final String CONF_BATCH_SIZE
public static final String CONF_WORKER_THREADS
public static final String CONF_WORKER_INTERVAL
public EventHandlerService()
public void init(Services services) throws ServiceException
Service
Invoked by the Service
singleton at start up time.
init
in interface Service
services
- services singleton initializing the service.ServiceException
- thrown if the service could not initialize.public void addEventListener(Object listener, org.apache.hadoop.conf.Configuration conf, String name) throws Exception
Exception
public static boolean isEnabled()
public void destroy()
Service
Invoked by the Service
singleton at shutdown time.
public Class<? extends Service> getInterface()
Service
Services are retrieved by its public interface. Specializations of services must return the public interface.
getInterface
in interface Service
public boolean isSupportedApptype(String appType)
public void setAppTypes(Set<String> types)
public Set<String> getAppTypes()
public String listEventListeners()
public void queueEvent(Event event)
public EventQueue getEventQueue()
Copyright © 2018 Apache Software Foundation. All rights reserved.