Class GridClientNodeImpl
- java.lang.Object
-
- org.apache.ignite.internal.client.impl.GridClientNodeImpl
-
- All Implemented Interfaces:
GridClientNode
public class GridClientNodeImpl extends Object implements GridClientNode
Client node implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridClientNodeImpl.BuilderBuilder for instances of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tattribute(String name)Gets specific attribute of remote node.Map<String,Object>attributes()Gets all attributes of remote node.Collection<InetSocketAddress>availableAddresses(GridClientProtocol proto, boolean filterResolved)Gets collection of addresses on which REST binary protocol is bound.static GridClientNodeImpl.Builderbuilder()Creates and returns a builder for a new instance of this class.static GridClientNodeImpl.Builderbuilder(GridClientNode from, boolean skipAttrs, boolean skipMetrics)Creates and returns a builder for a new instance of this class, copying data from an input instance.Map<String,GridClientCacheMode>caches()Gets all configured caches and their types on remote node.booleanconnectable()Indicates whether client can establish direct connection with this node.ObjectconsistentId()Gets consistent globally unique node ID.booleanequals(Object o)inthashCode()booleanisClient()Whether this node is client (seeIgniteConfiguration.isClientMode()).GridClientNodeMetricsmetrics()Gets various dynamic metrics of remote node.UUIDnodeId()Gets ID of a remote node.longorder()Node order within grid topology.List<String>tcpAddresses()Gets list of REST TCP server addresses of remote node.List<String>tcpHostNames()Gets list of REST TCP server host names of remote node.inttcpPort()Gets client TCP port of remote node.StringtoString()
-
-
-
Method Detail
-
builder
public static GridClientNodeImpl.Builder builder()
Creates and returns a builder for a new instance of this class.- Returns:
- Builder for new instance.
-
builder
public static GridClientNodeImpl.Builder builder(GridClientNode from, boolean skipAttrs, boolean skipMetrics)
Creates and returns a builder for a new instance of this class, copying data from an input instance.- Parameters:
from- Instance to copy data from.skipAttrs- Whether to skip attributes.skipMetrics- Whether to skip metrics.- Returns:
- Builder for new instance.
-
nodeId
public UUID nodeId()
Gets ID of a remote node.- Specified by:
nodeIdin interfaceGridClientNode- Returns:
- Node ID.
-
consistentId
public Object consistentId()
Gets consistent globally unique node ID. UnlikeGridClientNode.nodeId()method, this method returns consistent node ID which survives node restarts.- Specified by:
consistentIdin interfaceGridClientNode- Returns:
- Consistent globally unique node ID.
-
tcpAddresses
public List<String> tcpAddresses()
Gets list of REST TCP server addresses of remote node.- Specified by:
tcpAddressesin interfaceGridClientNode- Returns:
- REST TCP server addresses.
-
tcpHostNames
public List<String> tcpHostNames()
Gets list of REST TCP server host names of remote node.- Specified by:
tcpHostNamesin interfaceGridClientNode- Returns:
- REST TCP server host names.
-
tcpPort
public int tcpPort()
Gets client TCP port of remote node.- Specified by:
tcpPortin interfaceGridClientNode- Returns:
- Remote tcp port.
-
attributes
public Map<String,Object> attributes()
Gets all attributes of remote node. Note that all system and environment properties are automatically includes in node attributes. User can also attach custom attributes and then use them to further filter remote nodes into virtual subgrids for task execution.- Specified by:
attributesin interfaceGridClientNode- Returns:
- All node attributes.
-
attribute
@Nullable public <T> T attribute(String name)
Gets specific attribute of remote node.- Specified by:
attributein interfaceGridClientNode- Parameters:
name- Attribute name.- Returns:
- Attribute value.
- See Also:
GridClientNode.attributes()
-
metrics
public GridClientNodeMetrics metrics()
Gets various dynamic metrics of remote node.- Specified by:
metricsin interfaceGridClientNode- Returns:
- Metrics of remote node.
-
caches
public Map<String,GridClientCacheMode> caches()
Gets all configured caches and their types on remote node.- Specified by:
cachesin interfaceGridClientNode- Returns:
- Map in which key is a configured cache name on the node, value is mode of configured cache.
-
availableAddresses
public Collection<InetSocketAddress> availableAddresses(GridClientProtocol proto, boolean filterResolved)
Gets collection of addresses on which REST binary protocol is bound.- Specified by:
availableAddressesin interfaceGridClientNode- Parameters:
proto- Protocol for which addresses are obtained.filterResolved- Whether to filter resolved addresses (InetSocketAddress.isUnresolved()returnsFalse) or not.- Returns:
- List of addresses.
-
order
public long order()
Node order within grid topology.- Specified by:
orderin interfaceGridClientNode- Returns:
- Node startup order.
-
connectable
public boolean connectable()
Indicates whether client can establish direct connection with this node. So it is guaranteed that that any request will take only one network 'hop' before it will be processed by a Grid node.- Specified by:
connectablein interfaceGridClientNode- Returns:
trueif node can be directly connected,falseif request may be passed through a router.
-
isClient
public boolean isClient()
Whether this node is client (seeIgniteConfiguration.isClientMode()).- Specified by:
isClientin interfaceGridClientNode- Returns:
True if client.- See Also:
IgniteConfiguration.isClientMode()
-
-