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()
SubscriberState
ids
in interface StatusStorage
public int numStates()
numStates
in interface StatusStorage
public 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 StatusStorage
id
- the id of the state to getpublic void updateState(org.nd4j.parameterserver.model.SubscriberState subscriberState)
updateState
in interface StatusStorage
subscriberState
- the subscriber state to updateCopyright © 2019. All rights reserved.