public class TcpDiscoverySharedFsIpFinder extends TcpDiscoveryIpFinderAdapter
setPath(String)
)setShared(boolean)
) If getPath()
is not
provided, then DFLT_PATH
will be used and only local nodes will discover each other. To enable discovery
over network you must provide a path to a shared directory explicitly.
The directory will contain empty files named like the following 192.168.1.136#1001.
Note that this finder is shared by default (see TcpDiscoveryIpFinder.isShared()
.
Modifier and Type | Field and Description |
---|---|
static String |
DELIM
Delimiter to use between address and port tokens in file names.
|
static String |
DFLT_PATH
Default path for discovering of local nodes (testing only).
|
ignite
Constructor and Description |
---|
TcpDiscoverySharedFsIpFinder()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getPath()
Gets path.
|
Collection<InetSocketAddress> |
getRegisteredAddresses()
Gets all addresses registered in this finder.
|
void |
registerAddresses(Collection<InetSocketAddress> addrs)
Registers new addresses.
|
TcpDiscoverySharedFsIpFinder |
setPath(String path)
Sets path.
|
TcpDiscoverySharedFsIpFinder |
setShared(boolean shared)
Sets shared flag.
|
String |
toString() |
void |
unregisterAddresses(Collection<InetSocketAddress> addrs)
Unregisters provided addresses.
|
close, discoveryClientMode, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, spiContext
public static final String DFLT_PATH
IGNITE_HOME/work
folder if IGNITE_HOME
system or environment variable specified, otherwise it is
relative to work
folder under system java.io.tmpdir
folder.public static final String DELIM
public String getPath()
@IgniteSpiConfiguration(optional=true) public TcpDiscoverySharedFsIpFinder setPath(String path)
path
- Shared path.this
for chaining.public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException
null
.IgniteSpiException
- In case of error.public void registerAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
Implementation should accept duplicates quietly, but should not register address if it is already registered.
addrs
- Addresses to register. Not null
and not empty.IgniteSpiException
- In case of error.public void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException
Implementation should accept addresses that are currently not registered quietly (just no-op).
addrs
- Addresses to unregister. Not null
and not empty.IgniteSpiException
- In case of error.public TcpDiscoverySharedFsIpFinder setShared(boolean shared)
true
then it is expected that IP addresses registered
with IP finder will be seen by IP finders on all other nodes.setShared
in class TcpDiscoveryIpFinderAdapter
shared
- true
if this IP finder is shared.this
for chaining.public String toString()
toString
in class TcpDiscoveryIpFinderAdapter
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024