public class TcpDiscoveryJdbcIpFinder extends TcpDiscoveryIpFinderAdapter
setDataSource(DataSource)
).setInitSchema(boolean)
)The database will contain 1 table which will hold IP addresses.
Modifier and Type | Field and Description |
---|---|
static String |
CHK_QRY
Query to check database validity.
|
static String |
CREATE_ADDRS_TABLE_QRY
Query to create addresses table.
|
static String |
GET_ADDRS_QRY
Query to get addresses.
|
static String |
REG_ADDR_QRY
Query to register address.
|
static String |
UNREG_ADDR_QRY
Query to unregister address.
|
ignite
Constructor and Description |
---|
TcpDiscoveryJdbcIpFinder()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Collection<InetSocketAddress> |
getRegisteredAddresses()
Gets all addresses registered in this finder.
|
void |
registerAddresses(Collection<InetSocketAddress> addrs)
Registers new addresses.
|
void |
setDataSource(DataSource dataSrc)
Sets data source.
|
void |
setInitSchema(boolean initSchema)
Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
was explicitly created by user.
|
String |
toString() |
void |
unregisterAddresses(Collection<InetSocketAddress> addrs)
Unregisters provided addresses.
|
close, discoveryClientMode, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, setShared, spiContext
public static final String GET_ADDRS_QRY
public static final String REG_ADDR_QRY
public static final String UNREG_ADDR_QRY
public static final String CREATE_ADDRS_TABLE_QRY
public static final String CHK_QRY
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.@IgniteSpiConfiguration(optional=false) public void setDataSource(DataSource dataSrc)
Data source should be fully configured and ready-to-use.
dataSrc
- Data source.@IgniteSpiConfiguration(optional=true) public void setInitSchema(boolean initSchema)
initSchema
- True
if DB schema should be initialized by Ignite (default behaviour),
{code @false} if schema was explicitly created by user.public String toString()
toString
in class TcpDiscoveryIpFinderAdapter
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015