Class RouterState
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
Entry to log the state of a
Router in the
StateStoreService.-
Field Summary
Fields inherited from class org.apache.hadoop.hdfs.server.federation.store.records.BaseRecord
ERROR_MSG_CREATION_TIME_NEGATIVE, ERROR_MSG_MODIFICATION_TIME_NEGATIVE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckExpired(long currentTime) Called when the modification time and current time is available, checks for expirations.intcompareTo(BaseRecord other) abstract Stringabstract Stringabstract Stringabstract longlongGet the deletion time for the expired record.longGet the expiration time for the record.Map of primary key names to values for the record.Get the identifier for the Router.abstract StateStoreVersionabstract RouterServiceStateabstract StringbooleanCheck if this record is expired.booleanlike(BaseRecord o) Check if this record matches a partial record.static RouterStatestatic RouterStatenewInstance(String addr, long startTime, RouterServiceState status) abstract voidsetAddress(String address) abstract voidsetAdminAddress(String adminAddress) abstract voidsetCompileInfo(String info) abstract voidsetDateStarted(long dateStarted) static voidsetDeletionMs(long time) static voidsetExpirationMs(long time) abstract voidsetStateStoreVersion(StateStoreVersion version) abstract voidsetStatus(RouterServiceState newStatus) abstract voidsetVersion(String version) toString()voidvalidate()Validates the record.Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.records.BaseRecord
equals, generateMashupKey, getDateCreated, getDateModified, getPrimaryKey, hashCode, hasOtherFields, init, setDateCreated, setDateModified, shouldBeDeleted
-
Constructor Details
-
RouterState
public RouterState()Constructors.
-
-
Method Details
-
newInstance
-
newInstance
-
setAddress
-
setDateStarted
public abstract void setDateStarted(long dateStarted) -
getAddress
-
getStateStoreVersion
- Throws:
IOException
-
setStateStoreVersion
-
getStatus
-
setStatus
-
getVersion
-
setVersion
-
getCompileInfo
-
setCompileInfo
-
getDateStarted
public abstract long getDateStarted() -
setAdminAddress
-
getAdminAddress
-
getRouterId
Get the identifier for the Router. It uses the address.- Returns:
- Identifier for the Router.
-
like
Description copied from class:BaseRecordCheck if this record matches a partial record.- Overrides:
likein classBaseRecord- Parameters:
o- Partial record.- Returns:
- If this record matches.
-
toString
- Overrides:
toStringin classBaseRecord
-
getPrimaryKeys
Description copied from class:BaseRecordMap 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:
getPrimaryKeysin classBaseRecord- Returns:
- Map of key/value pairs that constitute this object's primary key.
-
validate
public void validate()Description copied from class:BaseRecordValidates 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:
validatein classBaseRecord
-
compareTo
- Specified by:
compareToin interfaceComparable<BaseRecord>- Overrides:
compareToin classBaseRecord
-
checkExpired
public boolean checkExpired(long currentTime) Description copied from class:BaseRecordCalled when the modification time and current time is available, checks for expirations.- Overrides:
checkExpiredin classBaseRecord- 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:BaseRecordGet the expiration time for the record.- Specified by:
getExpirationMsin classBaseRecord- Returns:
- Expiration time for the record.
-
setExpirationMs
public static void setExpirationMs(long time) -
isExpired
public boolean isExpired()Description copied from class:BaseRecordCheck if this record is expired. The default is false. Override for customized behavior.- Overrides:
isExpiredin classBaseRecord- Returns:
- True if the record is expired.
-
getDeletionMs
public long getDeletionMs()Description copied from class:BaseRecordGet the deletion time for the expired record. The default is disabled. Override for customized behavior.- Overrides:
getDeletionMsin classBaseRecord- Returns:
- Deletion time for the expired record.
-
setDeletionMs
public static void setDeletionMs(long time)
-