org.apache.hive.service
Class BreakableService

java.lang.Object
  extended by org.apache.hive.service.AbstractService
      extended by org.apache.hive.service.BreakableService
All Implemented Interfaces:
Service

public class BreakableService
extends AbstractService

This is a service that can be configured to break on any of the lifecycle events, so test the failure handling of other parts of the service infrastructure. It retains a counter to the number of times each entry point is called - these counters are incremented before the exceptions are raised and before the superclass state methods are invoked.


Nested Class Summary
static class BreakableService.BrokenLifecycleEvent
          The exception explicitly raised on a failure
 
Nested classes/interfaces inherited from interface org.apache.hive.service.Service
Service.STATE
 
Constructor Summary
BreakableService()
           
BreakableService(boolean failOnInit, boolean failOnStart, boolean failOnStop)
           
 
Method Summary
 int getCount(Service.STATE state)
           
 void init(HiveConf conf)
          Initialize the service.
 void setFailOnInit(boolean failOnInit)
           
 void setFailOnStart(boolean failOnStart)
           
 void setFailOnStop(boolean failOnStop)
           
 void start()
          Start the service.
 void stop()
          Stop the service.
 
Methods inherited from class org.apache.hive.service.AbstractService
getHiveConf, getName, getServiceState, getStartTime, register, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreakableService

public BreakableService()

BreakableService

public BreakableService(boolean failOnInit,
                        boolean failOnStart,
                        boolean failOnStop)
Method Detail

getCount

public int getCount(Service.STATE state)

init

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

Specified by:
init in interface Service
Overrides:
init in class AbstractService

start

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

Specified by:
start in interface Service
Overrides:
start in class AbstractService

stop

public void stop()
Description copied from class: AbstractService
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.

Specified by:
stop in interface Service
Overrides:
stop in class AbstractService

setFailOnInit

public void setFailOnInit(boolean failOnInit)

setFailOnStart

public void setFailOnStart(boolean failOnStart)

setFailOnStop

public void setFailOnStop(boolean failOnStop)


Copyright © 2013 The Apache Software Foundation