java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.ServiceNamenodeHeartbeatService, RouterHeartbeatService, RouterQuotaUpdateService, RouterSafemodeService, StateStoreCacheUpdateService, StateStoreConnectionMonitorServicepublic abstract class PeriodicService
extends org.apache.hadoop.service.AbstractService
| Constructor | Description |
|---|---|
PeriodicService(java.lang.String name) |
Create a new periodic update service.
|
PeriodicService(java.lang.String name,
long interval) |
Create a new periodic update service.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected long |
getErrorCount() |
Get how many times we failed to run the periodic service.
|
protected long |
getIntervalMs() |
Get the interval for the periodic service.
|
protected long |
getLastUpdate() |
Get the last time the periodic service was executed.
|
protected long |
getRunCount() |
Get how many times we run the periodic service.
|
protected abstract void |
periodicInvoke() |
Method that the service will run periodically.
|
protected void |
serviceStart() |
|
protected void |
serviceStop() |
|
protected void |
setIntervalMs(long interval) |
Set the interval for the periodic service.
|
protected void |
startPeriodic() |
Start the periodic execution.
|
protected void |
stopPeriodic() |
Stop the periodic task.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic PeriodicService(java.lang.String name)
name - Name of the service.public PeriodicService(java.lang.String name,
long interval)
name - Name of the service.interval - Interval for the periodic service in milliseconds.protected void setIntervalMs(long interval)
interval - Interval in milliseconds.protected long getIntervalMs()
protected long getErrorCount()
protected long getRunCount()
protected long getLastUpdate()
protected void serviceStart()
throws java.lang.Exception
serviceStart in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStop()
throws java.lang.Exception
serviceStop in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void stopPeriodic()
protected void startPeriodic()
protected abstract void periodicInvoke()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.