public abstract class BaseStatusStorage extends Object implements StatusStorage
| Modifier and Type | Field and Description |
|---|---|
protected Map<Integer,org.nd4j.parameterserver.model.SubscriberState> |
statusStorageMap |
protected Map<Integer,Long> |
updated |
| Constructor and Description |
|---|
BaseStatusStorage() |
BaseStatusStorage(long heartBeatEjectionMilliSeconds,
long checkInterval) |
| Modifier and Type | Method and Description |
|---|---|
abstract Map<Integer,org.nd4j.parameterserver.model.SubscriberState> |
createMap()
Create the storage map
|
abstract Map<Integer,Long> |
createUpdatedMap()
Create the storage map
|
org.nd4j.parameterserver.model.SubscriberState |
getState(int id)
Get the state given an id.
|
List<Integer> |
ids()
The list of state ids
for the given
SubscriberState |
int |
numStates()
Returns the number of states
held by this storage
|
void |
updateState(org.nd4j.parameterserver.model.SubscriberState subscriberState)
Update the state for storage
|
protected Map<Integer,org.nd4j.parameterserver.model.SubscriberState> statusStorageMap
public BaseStatusStorage()
public BaseStatusStorage(long heartBeatEjectionMilliSeconds,
long checkInterval)
heartBeatEjectionMilliSeconds - the amount of time before
ejecting a given subscriber as failedcheckInterval - the interval to check forpublic List<Integer> ids()
SubscriberStateids in interface StatusStoragepublic int numStates()
numStates in interface StatusStoragepublic abstract Map<Integer,Long> createUpdatedMap()
public abstract Map<Integer,org.nd4j.parameterserver.model.SubscriberState> createMap()
public org.nd4j.parameterserver.model.SubscriberState getState(int id)
ParameterServerSubscriber.
A SubscriberState is supposed to be 1 to 1 mapping
for a stream and a MediaDriver.
getState in interface StatusStorageid - the id of the state to getpublic void updateState(org.nd4j.parameterserver.model.SubscriberState subscriberState)
updateState in interface StatusStoragesubscriberState - the subscriber state to updateCopyright © 2017. All rights reserved.