|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Apache20LicenseCompatible public interface GridNode
Interface representing a single grid node. Use GridNode.getAttribute(String) or
GridNode.getMetrics() to get static and dynamic information about remote nodes.
GridNode list, which includes all nodes within task topology, is provided
to GridTask.map(List, Object) method. You can also get a handle on
discovered nodes by calling any of the following methods:
GridConfiguration.getUserAttributes() method to initialize your custom
node attributes at startup. For example, to provide benchmark data about
every node from Spring XML configuration file, you would do the following:
<bean id="grid.cfg" class="org.gridgain.grid.GridConfigurationAdapter" scope="singleton">
...
<property name="userAttributes">
<map>
<entry key="grid.node.benchmark">
<bean class="org.gridgain.grid.benchmarks.GridLocalNodeBenchmark" init-method="start"/>
</entry>
</map>
</property>
...
</bean>
The system adds the following attributes automatically:
System.getProperties() - All system properties.System.getenv(String) - All environment properties.Grid.getName()).GridSpi.getName().
GridSpi.getName().
Note that all System and Environment properties for all nodes are automatically included
into node attributes. This gives you an ability to get any information specified
in System.getProperties() about any node. So for example, in order to print out
information about Operating System for all nodes you would do the following:
for (GridNode node : GridFactory.getGrid().getAllNodes()) {
System.out.println("Operating system name: " + node.getAttribute("os.name"));
System.out.println("Operating system architecture: " + node.getAttribute("os.arch"));
System.out.println("Operating system version: " + node.getAttribute("os.version"));
}
GridNode.getMetrics()) are updated frequently for all nodes
and can be used to get dynamic information about a node. The frequency of update
is often directly related to the heartbeat exchange between nodes. So if, for example,
default GridMulticastDiscoverySpi is used,
the metrics data will be updated every 3 seconds by default.
Grid node metrics provide information about other nodes that can frequently change,
such as Heap and Non-Heap memory utilization, CPU load, number of active and waiting
grid jobs, etc... This information can become useful during job collision resolution or
GridTask.map(List, Object) operation when jobs are assigned to remote nodes
for execution. For example, you can only pick nodes that don't have any jobs waiting
to be executed.
Local node metrics are registered as MBean and can be accessed from
any JMX management console. The simplest way is to use standard jconsole
that comes with JDK as it also provides ability to view any node parameter
as a graph.
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0
![]() |
![]() |
| Method Summary | ||
|---|---|---|
|
getAttribute(String name)
Gets a node attribute. |
|
|
getAttributes()
Gets all node attributes. |
|
UUID |
getId()
Gets globally unique node ID. |
|
GridNodeMetrics |
getMetrics()
Gets metrics for this node. |
|
String |
getPhysicalAddress()
Gets physical address of the node. |
|
| Method Detail |
|---|
UUID getId()
String getPhysicalAddress()
<T extends Serializable> T getAttribute(String name)
GridConfiguration.getUserAttributes() method.
The system adds the following attributes automatically:
System.getProperties() - All system properties.System.getenv(String) - All environment properties.Grid.getName()).GridSpi.getName().
GridSpi.getName().
Note that attributes cannot be changed at runtime.
T - Attribute Type.name - Attribute name. Note that attribute names starting with
org.gridgain are reserved for internal use.
GridNodeMetrics getMetrics()
GridNodeMetrics.getCurrentCpuLoad()
method and use it during GridTask.map(List, Object) or during collision
resolution.
Node metrics are updated with some delay which is directly related to heartbeat
frequency. For example, when used with default
GridMulticastDiscoverySpi
the update will happen every 2 seconds.
<T extends Serializable> Map<String,T> getAttributes()
GridConfiguration.getUserAttributes() method.
The system adds the following attributes automatically:
System.getProperties() - All system properties.System.getenv(String) - All environment properties.Grid.getName()).GridSpi.getName().
GridSpi.getName().
Note that attributes cannot be changed at runtime.
T - Attribute Type.
|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|