org.apache.oozie.service
Class InstrumentationService

java.lang.Object
  extended by org.apache.oozie.service.InstrumentationService
All Implemented Interfaces:
Service
Direct Known Subclasses:
MetricsInstrumentationService

public class InstrumentationService
extends Object
implements Service

This service provides an Instrumentation instance configured to support samplers.

This service depends on the SchedulerService.

The CONF_LOGGING_INTERVAL configuration property indicates how often snapshots of the instrumentation should be logged.


Field Summary
static String CONF_LOGGING_INTERVAL
           
static String CONF_PREFIX
           
protected static Instrumentation instrumentation
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
InstrumentationService()
           
 
Method Summary
 void destroy()
          Destroy the instrumentation service.
 Instrumentation get()
          Return the instrumentation instance used by the service.
 Class<? extends Service> getInterface()
          Return the public interface for instrumentation service.
 void init(Services services)
          Initialize the instrumentation service.
protected  void initLogging(Services services, Instrumentation instr, int interval)
           
static boolean isEnabled()
          Returns if the InstrumentationService is enabled or not.
protected  String mapToString(Map<String,String> map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_PREFIX

public static final String CONF_PREFIX
See Also:
Constant Field Values

CONF_LOGGING_INTERVAL

public static final String CONF_LOGGING_INTERVAL
See Also:
Constant Field Values

instrumentation

protected static Instrumentation instrumentation
Constructor Detail

InstrumentationService

public InstrumentationService()
Method Detail

init

public void init(Services services)
          throws ServiceException
Initialize the instrumentation service.

Specified by:
init in interface Service
Parameters:
services - services instance.
Throws:
ServiceException - thrown if the service could not initialize.

initLogging

protected void initLogging(Services services,
                           Instrumentation instr,
                           int interval)
                    throws ServiceException
Throws:
ServiceException

mapToString

protected String mapToString(Map<String,String> map)

destroy

public void destroy()
Destroy the instrumentation service.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Return the public interface for instrumentation service.

Specified by:
getInterface in interface Service
Returns:
InstrumentationService.

get

public Instrumentation get()
Return the instrumentation instance used by the service.

Returns:
the instrumentation instance.

isEnabled

public static boolean isEnabled()
Returns if the InstrumentationService is enabled or not.

Returns:
true if the InstrumentationService is enabled; false if not


Copyright © 2015 Apache Software Foundation. All Rights Reserved.