public final class ServiceOperations
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
deploy(Service service,
HiveConf configuration)
Initialize then start a service.
|
static void |
ensureCurrentState(Service.STATE state,
Service.STATE expectedState)
Verify that that a service is in a given state.
|
static void |
init(Service service,
HiveConf configuration)
Initialize a service.
|
static void |
start(Service service)
Start a service.
|
static void |
stop(Service service)
Stop a service.
|
static java.lang.Exception |
stopQuietly(Service service)
Stop a service; if it is null do nothing.
|
public static void ensureCurrentState(Service.STATE state, Service.STATE expectedState)
state - the actual state a service is inexpectedState - the desired statejava.lang.IllegalStateException - if the service state is different from
the desired statepublic static void init(Service service, HiveConf configuration)
service - a service that must be in the state
Service.STATE.NOTINITEDconfiguration - the configuration to initialize the service withjava.lang.RuntimeException - on a state change failurejava.lang.IllegalStateException - if the service is in the wrong statepublic static void start(Service service)
service - a service that must be in the state
Service.STATE.INITEDjava.lang.RuntimeException - on a state change failurejava.lang.IllegalStateException - if the service is in the wrong statepublic static void deploy(Service service, HiveConf configuration)
service - a service that must be in the state
Service.STATE.NOTINITEDconfiguration - the configuration to initialize the service withjava.lang.RuntimeException - on a state change failurejava.lang.IllegalStateException - if the service is in the wrong statepublic static void stop(Service service)
service - a service or nullpublic static java.lang.Exception stopQuietly(Service service)
service - a service; may be nullCopyright © 2012 The Apache Software Foundation