org.apache.hive.service
Interface Service

All Known Implementing Classes:
AbstractService, BreakableService, CLIService, CompositeService, EmbeddedThriftCLIService, FilterService, HiveServer2, OperationManager, SessionManager, ThriftCLIService

public interface Service

Service.


Nested Class Summary
static class Service.STATE
          Service states
 
Method Summary
 HiveConf getHiveConf()
          Get the configuration of this service.
 String getName()
          Get the name of this service.
 Service.STATE getServiceState()
          Get the current service state
 long getStartTime()
          Get the service start time
 void init(HiveConf conf)
          Initialize the service.
 void register(ServiceStateChangeListener listener)
          Register an instance of the service state change events.
 void start()
          Start the service.
 void stop()
          Stop the service.
 void unregister(ServiceStateChangeListener listener)
          Unregister a previously instance of the service state change events.
 

Method Detail

init

void init(HiveConf conf)
Initialize the service. The transition must be from Service.STATE.NOTINITED to Service.STATE.INITED unless the operation failed and an exception was raised.

Parameters:
config - the configuration of the service

start

void start()
Start the service. The transition should be from Service.STATE.INITED to Service.STATE.STARTED unless the operation failed and an exception was raised.


stop

void stop()
Stop the service. This operation must be designed to complete regardless of the initial state of the service, including the state of all its internal fields.


register

void register(ServiceStateChangeListener listener)
Register an instance of the service state change events.

Parameters:
listener - a new listener

unregister

void unregister(ServiceStateChangeListener listener)
Unregister a previously instance of the service state change events.

Parameters:
listener - the listener to unregister.

getName

String getName()
Get the name of this service.

Returns:
the service name

getHiveConf

HiveConf getHiveConf()
Get the configuration of this service. This is normally not a clone and may be manipulated, though there are no guarantees as to what the consequences of such actions may be

Returns:
the current configuration, unless a specific implementation chooses otherwise.

getServiceState

Service.STATE getServiceState()
Get the current service state

Returns:
the state of the service

getStartTime

long getStartTime()
Get the service start time

Returns:
the start time of the service. This will be zero if the service has not yet been started.


Copyright © 2013 The Apache Software Foundation