org.apache.hadoop.lib.service.scheduler
Class SchedulerService

java.lang.Object
  extended by org.apache.hadoop.lib.server.BaseService
      extended by org.apache.hadoop.lib.service.scheduler.SchedulerService
All Implemented Interfaces:
Service, Scheduler

@InterfaceAudience.Private
public class SchedulerService
extends BaseService
implements Scheduler


Field Summary
static String CONF_THREADS
           
static String PREFIX
           
 
Constructor Summary
SchedulerService()
           
 
Method Summary
 void destroy()
          Destroy the services.
 Class getInterface()
          Returns the interface implemented by this service.
 Class[] getServiceDependencies()
          Returns the service dependencies of this service.
 void init()
          Initializes the server.
 void schedule(Callable<?> callable, long delay, long interval, TimeUnit unit)
           
 void schedule(Runnable runnable, long delay, long interval, TimeUnit unit)
           
 
Methods inherited from class org.apache.hadoop.lib.server.BaseService
getPrefix, getPrefixedName, getServer, getServiceConfig, init, postInit, serverStatusChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

CONF_THREADS

public static final String CONF_THREADS
See Also:
Constant Field Values
Constructor Detail

SchedulerService

public SchedulerService()
Method Detail

init

public void init()
          throws ServiceException
Description copied from class: BaseService
Initializes the server.

This method is called by BaseService.init(Server) after all service properties (properties prefixed with

Specified by:
init in class BaseService
Throws:
ServiceException - thrown if the service could not be initialized.

destroy

public void destroy()
Description copied from class: BaseService
Destroy the services. This method is called once, when the Server owning the service is being destroyed.

This method does a NOP.

Specified by:
destroy in interface Service
Overrides:
destroy in class BaseService

getServiceDependencies

public Class[] getServiceDependencies()
Description copied from class: BaseService
Returns the service dependencies of this service. The service will be instantiated only if all the service dependencies are already initialized.

This method returns an empty array (size 0)

Specified by:
getServiceDependencies in interface Service
Overrides:
getServiceDependencies in class BaseService
Returns:
an empty array (size 0).

getInterface

public Class getInterface()
Description copied from interface: Service
Returns the interface implemented by this service. This interface is used the Server when the Server.get(Class) method is used to retrieve a service.

Specified by:
getInterface in interface Service
Returns:
the interface that identifies the service.

schedule

public void schedule(Callable<?> callable,
                     long delay,
                     long interval,
                     TimeUnit unit)
Specified by:
schedule in interface Scheduler

schedule

public void schedule(Runnable runnable,
                     long delay,
                     long interval,
                     TimeUnit unit)
Specified by:
schedule in interface Scheduler


Copyright © 2014 Apache Software Foundation. All Rights Reserved.