Package org.nd4j.parameterserver
Class ParameterServerSubscriber
- java.lang.Object
-
- org.nd4j.parameterserver.ParameterServerSubscriber
-
- All Implemented Interfaces:
AutoCloseable
public class ParameterServerSubscriber extends Object implements AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameterServerSubscriber.UpdateTypeUpdate types are for instantiating various kinds of update types
-
Field Summary
Fields Modifier and Type Field Description static StringCUSTOM_UPDATE_TYPESpecify a custom class as a jvm arg.
-
Constructor Summary
Constructors Constructor Description ParameterServerSubscriber(io.aeron.driver.MediaDriver mediaDriver)Allow passing in a media driver that already exists
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SubscriberStateasState()Return the currentSubscriberStateof this subscribervoidclose()io.aeron.Aeron.ContextgetContext()org.nd4j.linalg.api.ndarray.INDArraygetMasterArray()Get the master ndarray from the internalNDArrayHolderstatic voidmain(String[] args)MasterConnectionInfomasterConnectionInfo()When this is a master node, it returns the connection url for this node, it's slaves (if any exist) and the responder connection url in the form of: host:port:streamIdvoidrun(String[] args)SlaveConnectionInfoslaveConnectionInfo()When this is a slave node it returns the connection url for this node and the associated master connection urls in the form of: host:port:streamIdbooleansubscriberLaunched()Returns true if the subscriber is launched
-
-
-
Field Detail
-
CUSTOM_UPDATE_TYPE
public static final String CUSTOM_UPDATE_TYPE
Specify a custom class as a jvm arg. Note that this class must be a fully qualified classname- See Also:
- Constant Field Values
-
-
Method Detail
-
asState
public SubscriberState asState()
Return the currentSubscriberStateof this subscriber- Returns:
- the current state of this subscriber
-
slaveConnectionInfo
public SlaveConnectionInfo slaveConnectionInfo()
When this is a slave node it returns the connection url for this node and the associated master connection urls in the form of: host:port:streamId- Returns:
- the slave connection info
-
masterConnectionInfo
public MasterConnectionInfo masterConnectionInfo()
When this is a master node, it returns the connection url for this node, it's slaves (if any exist) and the responder connection url in the form of: host:port:streamId- Returns:
- the master connection info
-
run
public void run(String[] args)
- Parameters:
args-
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
getContext
public io.aeron.Aeron.Context getContext()
-
getMasterArray
public org.nd4j.linalg.api.ndarray.INDArray getMasterArray()
Get the master ndarray from the internalNDArrayHolder- Returns:
- the master ndarray
-
subscriberLaunched
public boolean subscriberLaunched()
Returns true if the subscriber is launched- Returns:
-
main
public static void main(String[] args)
-
-