GridGain™ 2.0.3
Java API Specification

org.gridgain.grid
Interface GridConfiguration

All Known Implementing Classes:
GridConfigurationAdapter

@Apache20LicenseCompatible
public interface GridConfiguration

This interface defines grid runtime configuration. This configuration is passed to GridFactory.start(GridConfiguration) method. It defines all configuration parameters required to start a grid instance. Usually, a special class called "loader" will create an instance of this interface and call GridFactory.start(GridConfiguration) method to initialize GridGain instance.

Note, that absolutely every configuration property in GridConfiguration is optional. Once can simply create new instance of GridConfigurationAdapter, for example, and pass it to GridFactory.start(GridConfiguration) to start grid with default configuration. See GridFactory documentation for information about default configuration properties used and more information on how to start grid.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

Author:   2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

 

Method Summary
 GridCheckpointSpi getCheckpointSpi()
          Should return fully configured checkpoint SPI implementation.
 GridCollisionSpi getCollisionSpi()
          Should return fully configured collision SPI implementation.
 GridCommunicationSpi getCommunicationSpi()
          Should return fully configured SPI communication implementation.
 GridDeploymentSpi getDeploymentSpi()
          Should return fully configured deployment SPI implementation.
 GridDiscoverySpi getDiscoverySpi()
          Should return fully configured discovery SPI implementation.
 long getDiscoveryStartupDelay()
          This value is used to expire messages from waiting list whenever node discovery discrepancies happen.
 GridEventStorageSpi getEventStorageSpi()
          Should return fully configured event SPI implementation.
 ExecutorService getExecutorService()
          Should return an instance of fully configured thread pool to be used in grid.
 GridFailoverSpi getFailoverSpi()
          Should return fully configured failover SPI implementation.
 String getGridGainHome()
          Should return GridGain installation home folder.
 GridLogger getGridLogger()
          Should return an instance of logger to use in grid.
 String getGridName()
          Gets optional name of this grid instance.
 GridLoadBalancingSpi getLoadBalancingSpi()
          Should return fully configured load balancing SPI implementation.
 MBeanServer getMBeanServer()
          Should return MBean server instance.
 long getMetricsExpireTime()
          Elapsed time in milliseconds after which metrics are considered expired.
 int getMetricsHistorySize()
          Number of metrics to keep in memory to calculate totals and averages.
 GridLocalMetricsSpi getMetricsSpi()
          Should return fully configured metrics SPI implementation.
 UUID getNodeId()
          Unique identifier for this node within grid.
 List<String> getP2PLocalClassPathExclude()
          Should return list of packages from the system classpath that need to be peer-to-peer loaded from task originating node. '*' is supported at the end of the package name which means that all sub-packages and their classes are included like in Java package import clause.
 GridTopologySpi getTopologySpi()
          Should return fully configured topology SPI implementation.
 GridTracingSpi getTracingSpi()
          Should return fully configured tracing SPI implementation.
 Map<String,? extends Serializable> getUserAttributes()
          Should return any user-defined attributes to be added to this node.
 boolean isPeerClassLoadingEnabled()
          Returns true if peer class loading is enabled, false otherwise.
 

Method Detail

getGridName

String getGridName()
Gets optional name of this grid instance. If name is not provides, null will be used as a default name for the grid instance.

Returns:
Grid name. Can be null which is default if non-default name was not provided.

getUserAttributes

Map<String,? extends Serializable> getUserAttributes()
Should return any user-defined attributes to be added to this node. These attributes can then be accessed on nodes by calling GridNode.getAttribute(String) or GridNode.getAttributes() methods.

Note that grid will add all System properties and environment properties to grid node attributes also. SPI's may also add node attributes that are used for SPI implementation.

NOTE: attributes names starting with org.gridgain are reserved for internal use.

Returns:
User defined attributes for this node.

getGridLogger

GridLogger getGridLogger()
Should return an instance of logger to use in grid. If not provided, default value will be used. See GridFactory for information on default configuration.

Returns:
Logger to use in grid.

getExecutorService

ExecutorService getExecutorService()
Should return an instance of fully configured thread pool to be used in grid. If not provided, default value will be used. See GridFactory for information on default configuration.

Returns:
Thread pool implementation to be used in grid.

getGridGainHome

String getGridGainHome()
Should return GridGain installation home folder. If not provided, the system will check GRIDGAIN_HOME system property and environment variable in that order. If GRIDGAIN_HOME still could not be obtained, then grid will not start and exception will be thrown.

Returns:
GridGain installation home or null to make the system attempt to infer it automatically.

getMBeanServer

MBeanServer getMBeanServer()
Should return MBean server instance. If not provided, the system will use default platform MBean server.

Returns:
MBean server instance or null to make the system create a default one.
See Also:
ManagementFactory.getPlatformMBeanServer()

getNodeId

UUID getNodeId()
Unique identifier for this node within grid. If not provided, default value will be used. See GridFactory for information on default configuration.

Returns:
Unique identifier for this node within grid.

isPeerClassLoadingEnabled

boolean isPeerClassLoadingEnabled()
Returns true if peer class loading is enabled, false otherwise. Default value is true.

When peer class loading is enabled and task is not deployed on local node, local node will try to load classes from the node that initiated task execution. This way, a task can be physically deployed only on one node and then internally penetrate to all other nodes.

See GridTask documentation for more information about task deployment.

Returns:
true if peer class loading is enabled, false otherwise.

getDiscoverySpi

GridDiscoverySpi getDiscoverySpi()
Should return fully configured discovery SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid discovery SPI implementation or null to use default implementation.

getCommunicationSpi

GridCommunicationSpi getCommunicationSpi()
Should return fully configured SPI communication implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid communication SPI implementation or null to use default implementation.

getDeploymentSpi

GridDeploymentSpi getDeploymentSpi()
Should return fully configured deployment SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid deployment SPI implementation or null to use default implementation.

getCheckpointSpi

GridCheckpointSpi getCheckpointSpi()
Should return fully configured checkpoint SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid checkpoint SPI implementation or null to use default implementation.

getEventStorageSpi

GridEventStorageSpi getEventStorageSpi()
Should return fully configured event SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid event SPI implementation or null to use default implementation.

getFailoverSpi

GridFailoverSpi getFailoverSpi()
Should return fully configured failover SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid failover SPI implementation or null to use default implementation.

getTopologySpi

GridTopologySpi getTopologySpi()
Should return fully configured topology SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid topology SPI implementation or null to use default implementation.

getCollisionSpi

GridCollisionSpi getCollisionSpi()
Should return fully configured collision SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid collision SPI implementation or null to use default implementation.

getMetricsSpi

GridLocalMetricsSpi getMetricsSpi()
Should return fully configured metrics SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid metrics SPI implementation or null to use default implementation.

getLoadBalancingSpi

GridLoadBalancingSpi getLoadBalancingSpi()
Should return fully configured load balancing SPI implementation. If not provided, default implementation will be used. See GridFactory for information on default configuration.

Returns:
Grid load balancing SPI implementation or null to use default implementation.

getTracingSpi

GridTracingSpi getTracingSpi()
Should return fully configured tracing SPI implementation. If not provided, returns null. Note that tracing SPI is optional. If not provided - no tracing will be configured (i.e. there is no default tracing SPI implementation).

Returns:
Grid tracing SPI implementation or null to not use tracing.

getP2PLocalClassPathExclude

List<String> getP2PLocalClassPathExclude()
Should return list of packages from the system classpath that need to be peer-to-peer loaded from task originating node. '*' is supported at the end of the package name which means that all sub-packages and their classes are included like in Java package import clause.

Returns:
List of peer-to-peer loaded package names.

getMetricsHistorySize

int getMetricsHistorySize()
Number of metrics to keep in memory to calculate totals and averages. If not provided (value is 0), then default of 10,000 is used.

Returns:
Metrics history size.

getMetricsExpireTime

long getMetricsExpireTime()
Elapsed time in milliseconds after which metrics are considered expired. If not provided (value is 0), then the default value is Long.MAX_VALUE.

Returns:
Metrics expire time.

getDiscoveryStartupDelay

long getDiscoveryStartupDelay()
This value is used to expire messages from waiting list whenever node discovery discrepancies happen.

During startup, it is possible for some SPI's, such as GridMuleDiscoverySpi or GridJmsDiscoverySpi, to have a small time window when Node A has discovered Node B, but Node B has not discovered Node A yet. Such time window is usually very small, a matter of milliseconds, but certain JMS providers or some Mule messaging protocols may be very slow and hence have larger discovery delay window.

The default value of this property is 60,000ms or 1 minute which should be good enough for vast majority of configurations. However, if you do anticipate an even larger delay, you should increase this value.

Returns:
Time in milliseconds for when nodes can be out-of-sync.

GridGain™ 2.0.3
Java API Specification

GridGain™ - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved.