public abstract class HouseKeeperServiceBase extends Object implements HouseKeeperService
Modifier and Type | Field and Description |
---|---|
protected HiveConf |
hiveConf |
protected AtomicInteger |
isAliveCounter |
Constructor and Description |
---|
HouseKeeperServiceBase() |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
getIntervalMs()
Determines how frequently the service is running its task.
|
int |
getIsAliveCounter()
This is used for testing only.
|
protected abstract Runnable |
getScheduedAction(HiveConf hiveConf,
AtomicInteger isAliveCounter)
The actual task implementation.
|
protected abstract long |
getStartDelayMs()
Delay in millis before first run of the task of this service.
|
void |
start(HiveConf hiveConf) |
void |
stop()
Should perform orderly shutdown
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getServiceDescription
protected final AtomicInteger isAliveCounter
protected HiveConf hiveConf
public void start(HiveConf hiveConf) throws Exception
start
in interface HouseKeeperService
Exception
public void stop()
HouseKeeperService
stop
in interface HouseKeeperService
public int getIsAliveCounter()
Integer.MIN_VALUE
getIsAliveCounter
in interface HouseKeeperService
protected abstract long getStartDelayMs()
protected abstract long getIntervalMs()
protected abstract Runnable getScheduedAction(HiveConf hiveConf, AtomicInteger isAliveCounter)
Copyright © 2016 The Apache Software Foundation. All rights reserved.