Class AbstractLivelinessMonitor<O>

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.util.AbstractLivelinessMonitor<O>
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service

@Public @Evolving public abstract class AbstractLivelinessMonitor<O> extends org.apache.hadoop.service.AbstractService
A simple liveliness monitor with which clients can register, trust the component to monitor liveliness, get a call-back on expiry and then finally unregister.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    expire(O ob)
     
    protected long
     
    void
     
    void
    register(O ob)
     
    void
    register(O ob, long expireTime)
     
    void
     
    protected void
     
    protected void
     
    protected void
    setExpireInterval(long expireInterval)
     
    protected void
    setMonitorInterval(long monitorInterval)
     
    protected void
    setResetTimeOnStart(boolean resetTimeOnStart)
     
    void
     

    Methods inherited from class org.apache.hadoop.service.AbstractService

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • AbstractLivelinessMonitor

      public AbstractLivelinessMonitor(String name, Clock clock)
    • AbstractLivelinessMonitor

      public AbstractLivelinessMonitor(String name)
  • Method Details

    • serviceStart

      protected void serviceStart() throws Exception
      Overrides:
      serviceStart in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStop

      protected void serviceStop() throws Exception
      Overrides:
      serviceStop in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • expire

      protected abstract void expire(O ob)
    • setExpireInterval

      protected void setExpireInterval(long expireInterval)
    • getExpireInterval

      protected long getExpireInterval(O o)
    • setMonitorInterval

      protected void setMonitorInterval(long monitorInterval)
    • receivedPing

      public void receivedPing(O ob)
    • register

      public void register(O ob)
    • register

      public void register(O ob, long expireTime)
    • unregister

      public void unregister(O ob)
    • resetTimer

      public void resetTimer()
    • setResetTimeOnStart

      protected void setResetTimeOnStart(boolean resetTimeOnStart)