java.lang.Object
org.apache.hadoop.hdfs.server.federation.store.records.BaseRecord
org.apache.hadoop.hdfs.server.federation.store.records.RouterState
All Implemented Interfaces:
Comparable<BaseRecord>
Direct Known Subclasses:
RouterStatePBImpl

public abstract class RouterState extends BaseRecord
Entry to log the state of a Router in the StateStoreService.
  • Constructor Details

    • RouterState

      public RouterState()
      Constructors.
  • Method Details

    • newInstance

      public static RouterState newInstance()
    • newInstance

      public static RouterState newInstance(String addr, long startTime, RouterServiceState status)
    • setAddress

      public abstract void setAddress(String address)
    • setDateStarted

      public abstract void setDateStarted(long dateStarted)
    • getAddress

      public abstract String getAddress()
    • getStateStoreVersion

      public abstract StateStoreVersion getStateStoreVersion() throws IOException
      Throws:
      IOException
    • setStateStoreVersion

      public abstract void setStateStoreVersion(StateStoreVersion version)
    • getStatus

      public abstract RouterServiceState getStatus()
    • setStatus

      public abstract void setStatus(RouterServiceState newStatus)
    • getVersion

      public abstract String getVersion()
    • setVersion

      public abstract void setVersion(String version)
    • getCompileInfo

      public abstract String getCompileInfo()
    • setCompileInfo

      public abstract void setCompileInfo(String info)
    • getDateStarted

      public abstract long getDateStarted()
    • setAdminAddress

      public abstract void setAdminAddress(String adminAddress)
    • getAdminAddress

      public abstract String getAdminAddress()
    • getRouterId

      public String getRouterId()
      Get the identifier for the Router. It uses the address.
      Returns:
      Identifier for the Router.
    • like

      public boolean like(BaseRecord o)
      Description copied from class: BaseRecord
      Check if this record matches a partial record.
      Overrides:
      like in class BaseRecord
      Parameters:
      o - Partial record.
      Returns:
      If this record matches.
    • toString

      public String toString()
      Overrides:
      toString in class BaseRecord
    • getPrimaryKeys

      public SortedMap<String,String> getPrimaryKeys()
      Description copied from class: BaseRecord
      Map of primary key names to values for the record. The primary key can be a combination of 1-n different State Store serialized values.
      Specified by:
      getPrimaryKeys in class BaseRecord
      Returns:
      Map of key/value pairs that constitute this object's primary key.
    • validate

      public void validate()
      Description copied from class: BaseRecord
      Validates the record. Called when the record is created, populated from the state store, and before committing to the state store. If validate failed, there throws an exception.
      Overrides:
      validate in class BaseRecord
    • compareTo

      public int compareTo(BaseRecord other)
      Specified by:
      compareTo in interface Comparable<BaseRecord>
      Overrides:
      compareTo in class BaseRecord
    • checkExpired

      public boolean checkExpired(long currentTime)
      Description copied from class: BaseRecord
      Called when the modification time and current time is available, checks for expirations.
      Overrides:
      checkExpired in class BaseRecord
      Parameters:
      currentTime - The current timestamp in ms from the data store, to be compared against the modification and creation dates of the object.
      Returns:
      boolean True if the record has been updated and should be committed to the data store. Override for customized behavior.
    • getExpirationMs

      public long getExpirationMs()
      Description copied from class: BaseRecord
      Get the expiration time for the record.
      Specified by:
      getExpirationMs in class BaseRecord
      Returns:
      Expiration time for the record.
    • setExpirationMs

      public static void setExpirationMs(long time)
    • isExpired

      public boolean isExpired()
      Description copied from class: BaseRecord
      Check if this record is expired. The default is false. Override for customized behavior.
      Overrides:
      isExpired in class BaseRecord
      Returns:
      True if the record is expired.
    • getDeletionMs

      public long getDeletionMs()
      Description copied from class: BaseRecord
      Get the deletion time for the expired record. The default is disabled. Override for customized behavior.
      Overrides:
      getDeletionMs in class BaseRecord
      Returns:
      Deletion time for the expired record.
    • setDeletionMs

      public static void setDeletionMs(long time)