public final class ServiceOperations extends 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 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 stateIllegalStateException
- 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.NOTINITED
configuration
- the configuration to initialize the service withRuntimeException
- on a state change failureIllegalStateException
- if the service is in the wrong statepublic static void start(Service service)
service
- a service that must be in the state
Service.STATE.INITED
RuntimeException
- on a state change failureIllegalStateException
- 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.NOTINITED
configuration
- the configuration to initialize the service withRuntimeException
- on a state change failureIllegalStateException
- if the service is in the wrong statepublic static void stop(Service service)
service
- a service or nullpublic static Exception stopQuietly(Service service)
service
- a service; may be nullCopyright © 2017 The Apache Software Foundation. All rights reserved.