GridGain™ 2.1.0
Java API Specification

org.gridgain.grid
Class GridConfigurationAdapter

java.lang.Object
  extended by org.gridgain.grid.GridConfigurationAdapter
All Implemented Interfaces:
GridConfiguration

@Apache20LicenseCompatible
public class GridConfigurationAdapter
extends Object
implements GridConfiguration

Adapter for GridConfiguration interface. Use it to add custom configuration for grid. Note that you should only set values that differ from defaults, as grid will automatically pick default values for all values that are not set.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

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

 

Field Summary
 
Fields inherited from interface org.gridgain.grid.GridConfiguration
DFLT_DEPLOYMENT_MODE, DFLT_DISCOVERY_STARTUP_DELAY, DFLT_METRICS_EXPIRE_TIME, DFLT_METRICS_HISTORY_SIZE, DFLT_PEER_CLASS_LOADING_ENABLED, DFLT_PEER_CLASS_LOADING_MISSED_RESROUCES_CACHE_SIZE, DFLT_PEER_CLASS_LOADING_TIMEOUT
 
Constructor Summary
GridConfigurationAdapter()
          Creates valid grid configuration with all default values.
GridConfigurationAdapter(GridConfiguration cfg)
          Creates grid configuration by coping all configuration properties from given configuration.
 
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.
 GridDeploymentMode getDeploymentMode()
          Gets deployment mode for deploying tasks and other classes on this node.
 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 grid name.
 Collection<? extends GridLifecycleBean> getLifecycleBeans()
          Returns a collection of life-cycle beans.
 GridLoadBalancingSpi[] getLoadBalancingSpi()
          Should return fully configured load balancing SPI implementation.
 GridMarshaller getMarshaller()
          Should return an instance of marshaller to use in grid.
 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.
 ExecutorService getPeerClassLoadingExecutorService()
          Should return an instance of fully configured executor service which is in charge of peer class loading requests/responses.
 int getPeerClassLoadingMissedResourcesCacheSize()
          Returns missed resources cache size.
 long getPeerClassLoadingTimeout()
          Maximum timeout in milliseconds to wait for class-loading responses from remote nodes.
 ExecutorService getSystemExecutorService()
          Should return an instance of fully configured executor service that is in charge of processing GridTaskSession requests and user messages sent via Grid.sendMessage(GridNode, Serializable) method.
 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.
 void setCheckpointSpi(GridCheckpointSpi... cpSpi)
          Sets fully configured instance of GridCheckpointSpi.
 void setCollisionSpi(GridCollisionSpi colSpi)
          Sets fully configured instance of GridCollisionSpi.
 void setCommunicationSpi(GridCommunicationSpi commSpi)
          Sets fully configured instance of GridCommunicationSpi.
 void setDeploymentMode(GridDeploymentMode deployMode)
          Sets task classes and resources sharing mode.
 void setDeploymentSpi(GridDeploymentSpi deploySpi)
          Sets fully configured instance of GridDeploymentSpi.
 void setDiscoverySpi(GridDiscoverySpi discoSpi)
          Sets fully configured instance of GridDiscoverySpi.
 void setDiscoveryStartupDelay(long discoStartupDelay)
          Sets time in milliseconds after which a certain metric value is considered expired.
 void setEventStorageSpi(GridEventStorageSpi evtSpi)
          Sets fully configured instance of GridEventStorageSpi.
 void setExecutorService(ExecutorService execSvc)
          Sets thread pool to use within grid.
 void setFailoverSpi(GridFailoverSpi... failSpi)
          Sets fully configured instance of GridFailoverSpi.
 void setGridGainHome(String ggHome)
          Sets GridGain installation folder.
 void setGridLogger(GridLogger log)
          Sets logger to use within grid.
 void setGridName(String gridName)
          Sets grid name.
 void setLifecycleBeans(Collection<? extends GridLifecycleBean> lifecycleBeans)
          Sets a collection of lifecycle beans.
 void setLoadBalancingSpi(GridLoadBalancingSpi... loadBalancingSpi)
          Sets fully configured instance of GridLoadBalancingSpi.
 void setMarshaller(GridMarshaller marshaller)
          Sets marshaller to use within grid.
 void setMBeanServer(MBeanServer mbeanServer)
          Sets initialized and started MBean server.
 void setMetricsExpireTime(long metricsExpireTime)
          Sets time in milliseconds after which a certain metric value is considered expired.
 void setMetricsHistorySize(int metricsHistorySize)
          Sets number of metrics kept in history to compute totals and averages.
 void setMetricsSpi(GridLocalMetricsSpi metricsSpi)
          Sets fully configured instance of GridLocalMetricsSpi.
 void setNodeId(UUID nodeId)
          Sets unique identifier for local node.
 void setP2PLocalClassPathExclude(List<String> localClassPathExclude)
          Sets list of packages in a system class path that should be to P2P loaded even if they exist locally.
 void setPeerClassLoadingEnabled(boolean isPeerClsLoadingEnabled)
          Enables/disables peer class loading.
 void setPeerClassLoadingExecutorService(ExecutorService p2PSvc)
          Sets thread pool to use for peer class loading.
 void setPeerClassLoadingMissedResourcesCacheSize(int missedRsrcsCacheSize)
          Sets size of missed resources cache.
 void setPeerClassLoadingTimeout(long peerClsLoadingTimeout)
          Sets maximum timeout in milliseconds to wait for class-loading responses from remote nodes.
 void setSystemExecutorService(ExecutorService systemSvc)
          Sets system thread pool to use within grid.
 void setTopologySpi(GridTopologySpi... topSpi)
          Sets fully configured instance of GridTopologySpi.
 void setTracingSpi(GridTracingSpi... traceSpi)
          Sets fully configured instance of GridTracingSpi.
 void setUserAttributes(Map<String,? extends Serializable> userAttrs)
          Sets user attributes for this node.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridConfigurationAdapter

public GridConfigurationAdapter()
Creates valid grid configuration with all default values.


GridConfigurationAdapter

public GridConfigurationAdapter(GridConfiguration cfg)
Creates grid configuration by coping all configuration properties from given configuration.

Parameters:
cfg - Grid configuration to copy from.
Method Detail

getGridName

public String getGridName()
Gets optional grid name. Returns null if non-default grid name was not provided.

Specified by:
getGridName in interface GridConfiguration
Returns:
Optional grid name. Can be null, which is default grid name, if non-default grid name was not provided.

setGridName

public void setGridName(String gridName)
Sets grid name. Note that null is a default grid name.

Parameters:
gridName - Grid name to set. Can be null, which is default grid name.

getUserAttributes

public 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 system adds the following attributes automatically (so you don't have to add them manually):

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.

Specified by:
getUserAttributes in interface GridConfiguration
Returns:
User defined attributes for this node.

setUserAttributes

public void setUserAttributes(Map<String,? extends Serializable> userAttrs)
Sets user attributes for this node.

Parameters:
userAttrs - User attributes for this node.
See Also:
GridConfiguration.getUserAttributes()

getGridLogger

public 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.

Specified by:
getGridLogger in interface GridConfiguration
Returns:
Logger to use in grid.

setGridLogger

public void setGridLogger(GridLogger log)
Sets logger to use within grid.

Parameters:
log - Logger to use within grid.
See Also:
GridConfiguration.getGridLogger()

getExecutorService

public ExecutorService getExecutorService()
Should return an instance of fully configured thread pool to be used in grid. This executor service will be in charge of processing GridTasks and GridJobs.

If not provided, default value will be used. See GridFactory for information on default configuration.

Specified by:
getExecutorService in interface GridConfiguration
Returns:
Thread pool implementation to be used in grid to process job execution requests and user messages sent to the node.

getSystemExecutorService

public ExecutorService getSystemExecutorService()
Should return an instance of fully configured executor service that is in charge of processing GridTaskSession requests and user messages sent via Grid.sendMessage(GridNode, Serializable) method.

If not provided, default value will be used. See GridFactory for information on default configuration.

Specified by:
getSystemExecutorService in interface GridConfiguration
Returns:
Thread pool implementation to be used in grid for job responses and session attributes processing.

getPeerClassLoadingExecutorService

public ExecutorService getPeerClassLoadingExecutorService()
Should return an instance of fully configured executor service which is in charge of peer class loading requests/responses. If you don't use P2P class loading and use GAR deployment only we would recommend to decrease the value of total threads to 1.

If not provided, default value will be used. See GridFactory for information on default configuration.

Specified by:
getPeerClassLoadingExecutorService in interface GridConfiguration
Returns:
Thread pool implementation to be used for peer class loading requests handling.

setExecutorService

public void setExecutorService(ExecutorService execSvc)
Sets thread pool to use within grid.

Parameters:
execSvc - Thread pool to use within grid.
See Also:
GridConfiguration.getExecutorService()

setSystemExecutorService

public void setSystemExecutorService(ExecutorService systemSvc)
Sets system thread pool to use within grid.

Parameters:
systemSvc - Thread pool to use within grid.
See Also:
GridConfiguration.getSystemExecutorService()

setPeerClassLoadingExecutorService

public void setPeerClassLoadingExecutorService(ExecutorService p2PSvc)
Sets thread pool to use for peer class loading.

Parameters:
p2PSvc - Thread pool to use within grid.
See Also:
GridConfiguration.getPeerClassLoadingExecutorService()

getGridGainHome

public 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.

Specified by:
getGridGainHome in interface GridConfiguration
Returns:
GridGain installation home or null to make the system attempt to infer it automatically.

setGridGainHome

public void setGridGainHome(String ggHome)
Sets GridGain installation folder.

Parameters:
ggHome - GridGain installation folder.
See Also:
GridConfiguration.getGridGainHome()

getMBeanServer

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

Specified by:
getMBeanServer in interface GridConfiguration
Returns:
MBean server instance or null to make the system create a default one.
See Also:
ManagementFactory.getPlatformMBeanServer()

setMBeanServer

public void setMBeanServer(MBeanServer mbeanServer)
Sets initialized and started MBean server.

Parameters:
mbeanServer - Initialized and started MBean server.

getNodeId

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

Specified by:
getNodeId in interface GridConfiguration
Returns:
Unique identifier for this node within grid.

setNodeId

public void setNodeId(UUID nodeId)
Sets unique identifier for local node.

Parameters:
nodeId - Unique identifier for local node.
See Also:
GridConfiguration.getNodeId()

getMarshaller

public GridMarshaller getMarshaller()
Should return an instance of marshaller to use in grid. If not provided, default value will be used. See GridFactory for information on default configuration.

Specified by:
getMarshaller in interface GridConfiguration
Returns:
Marshaller to use in grid.

setMarshaller

public void setMarshaller(GridMarshaller marshaller)
Sets marshaller to use within grid.

Parameters:
marshaller - Marshaller to use within grid.
See Also:
GridConfiguration.getMarshaller()

isPeerClassLoadingEnabled

public boolean isPeerClassLoadingEnabled()
Returns true if peer class loading is enabled, false otherwise. Default value is true specified by GridConfiguration.DFLT_PEER_CLASS_LOADING_ENABLED.

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.

Specified by:
isPeerClassLoadingEnabled in interface GridConfiguration
Returns:
true if peer class loading is enabled, false otherwise.

setPeerClassLoadingEnabled

public void setPeerClassLoadingEnabled(boolean isPeerClsLoadingEnabled)
Enables/disables peer class loading.

Parameters:
isPeerClsLoadingEnabled - true if peer class loading is enabled, false otherwise.

getP2PLocalClassPathExclude

public 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.

Specified by:
getP2PLocalClassPathExclude in interface GridConfiguration
Returns:
List of peer-to-peer loaded package names.

setP2PLocalClassPathExclude

public void setP2PLocalClassPathExclude(List<String> localClassPathExclude)
Sets list of packages in a system class path that should be to P2P loaded even if they exist locally.

Parameters:
localClassPathExclude - List of P2P loaded packages. Package name supports '*' at the end like in package import clause.

getMetricsHistorySize

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

Specified by:
getMetricsHistorySize in interface GridConfiguration
Returns:
Metrics history size.

setMetricsHistorySize

public void setMetricsHistorySize(int metricsHistorySize)
Sets number of metrics kept in history to compute totals and averages. If not explicitly set, then default value is 10,000.

Parameters:
metricsHistorySize - Number of metrics kept in history to use for metric totals and averages calculations.

getMetricsExpireTime

public long getMetricsExpireTime()
Elapsed time in milliseconds after which metrics are considered expired. If not provided (value is 0), then default value GridConfiguration.DFLT_METRICS_EXPIRE_TIME is used.

Specified by:
getMetricsExpireTime in interface GridConfiguration
Returns:
Metrics expire time.

setMetricsExpireTime

public void setMetricsExpireTime(long metricsExpireTime)
Sets time in milliseconds after which a certain metric value is considered expired. If not set explicitly, then default value is 600,000 milliseconds (10 minutes).

Parameters:
metricsExpireTime - The metricsExpireTime to set.

getPeerClassLoadingTimeout

public long getPeerClassLoadingTimeout()
Maximum timeout in milliseconds to wait for class-loading responses from remote nodes. After reaching this timeout ClassNotFoundException will be thrown.

If not provided (value is 0), then default value GridConfiguration.DFLT_PEER_CLASS_LOADING_TIMEOUT is used.

Specified by:
getPeerClassLoadingTimeout in interface GridConfiguration
Returns:
Maximum timeout for peer-class-loading requests.

setPeerClassLoadingTimeout

public void setPeerClassLoadingTimeout(long peerClsLoadingTimeout)
Sets maximum timeout in milliseconds to wait for class-loading responses from remote nodes. After reaching this timeout ClassNotFoundException will be thrown.

If not provided (value is 0), the default vlaue is 10,000 or 10 seconds.

Parameters:
peerClsLoadingTimeout - Maximum timeout for peer-class-loading requests.

getLifecycleBeans

public Collection<? extends GridLifecycleBean> getLifecycleBeans()
Returns a collection of life-cycle beans. These beans will be automatically notified of grid life-cycle events. Use life-cycle beans whenever you want to perform certain logic before and after grid startup and stopping routines.

Specified by:
getLifecycleBeans in interface GridConfiguration
Returns:
Collection of life-cycle beans.
See Also:
GridLifecycleBean, GridLifecycleEventType

setLifecycleBeans

public void setLifecycleBeans(Collection<? extends GridLifecycleBean> lifecycleBeans)
Sets a collection of lifecycle beans. These beans will be automatically notified of grid lifecycle events. Use lifecycle beans whenever you want to perform certain logic before and after grid startup and stopping routines.

Parameters:
lifecycleBeans - Collection of lifecycle beans.
See Also:
GridLifecycleEventType

getEventStorageSpi

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

Specified by:
getEventStorageSpi in interface GridConfiguration
Returns:
Grid event SPI implementation or null to use default implementation.

setEventStorageSpi

public void setEventStorageSpi(GridEventStorageSpi evtSpi)
Sets fully configured instance of GridEventStorageSpi.

Parameters:
evtSpi - Fully configured instance of GridEventStorageSpi.
See Also:
GridConfiguration.getEventStorageSpi()

getDiscoverySpi

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

Specified by:
getDiscoverySpi in interface GridConfiguration
Returns:
Grid discovery SPI implementation or null to use default implementation.

setDiscoverySpi

public void setDiscoverySpi(GridDiscoverySpi discoSpi)
Sets fully configured instance of GridDiscoverySpi.

Parameters:
discoSpi - Fully configured instance of GridDiscoverySpi.
See Also:
GridConfiguration.getDiscoverySpi()

getCommunicationSpi

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

Specified by:
getCommunicationSpi in interface GridConfiguration
Returns:
Grid communication SPI implementation or null to use default implementation.

setCommunicationSpi

public void setCommunicationSpi(GridCommunicationSpi commSpi)
Sets fully configured instance of GridCommunicationSpi.

Parameters:
commSpi - Fully configured instance of GridCommunicationSpi.
See Also:
GridConfiguration.getCommunicationSpi()

getCollisionSpi

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

Specified by:
getCollisionSpi in interface GridConfiguration
Returns:
Grid collision SPI implementation or null to use default implementation.

setCollisionSpi

public void setCollisionSpi(GridCollisionSpi colSpi)
Sets fully configured instance of GridCollisionSpi.

Parameters:
colSpi - Fully configured instance of GridCollisionSpi or null if no SPI provided.
See Also:
GridConfiguration.getCollisionSpi()

getMetricsSpi

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

Specified by:
getMetricsSpi in interface GridConfiguration
Returns:
Grid metrics SPI implementation or null to use default implementation.

setMetricsSpi

public void setMetricsSpi(GridLocalMetricsSpi metricsSpi)
Sets fully configured instance of GridLocalMetricsSpi.

Parameters:
metricsSpi - Fully configured instance of GridLocalMetricsSpi or null if no SPI provided.
See Also:
GridConfiguration.getMetricsSpi()

getDeploymentSpi

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

Specified by:
getDeploymentSpi in interface GridConfiguration
Returns:
Grid deployment SPI implementation or null to use default implementation.

setDeploymentSpi

public void setDeploymentSpi(GridDeploymentSpi deploySpi)
Sets fully configured instance of GridDeploymentSpi.

Parameters:
deploySpi - Fully configured instance of GridDeploymentSpi.
See Also:
GridConfiguration.getDeploymentSpi()

getCheckpointSpi

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

Specified by:
getCheckpointSpi in interface GridConfiguration
Returns:
Grid checkpoint SPI implementation or null to use default implementation.

setCheckpointSpi

public void setCheckpointSpi(GridCheckpointSpi... cpSpi)
Sets fully configured instance of GridCheckpointSpi.

Parameters:
cpSpi - Fully configured instance of GridCheckpointSpi.
See Also:
GridConfiguration.getCheckpointSpi()

getTracingSpi

public 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).

Specified by:
getTracingSpi in interface GridConfiguration
Returns:
Grid tracing SPI implementation or null to not use tracing.

setTracingSpi

public void setTracingSpi(GridTracingSpi... traceSpi)
Sets fully configured instance of GridTracingSpi.

Parameters:
traceSpi - Fully configured instance of GridTracingSpi or null if no SPI provided.
See Also:
GridConfiguration.getTracingSpi()

getFailoverSpi

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

Specified by:
getFailoverSpi in interface GridConfiguration
Returns:
Grid failover SPI implementation or null to use default implementation.

setFailoverSpi

public void setFailoverSpi(GridFailoverSpi... failSpi)
Sets fully configured instance of GridFailoverSpi.

Parameters:
failSpi - Fully configured instance of GridFailoverSpi or null if no SPI provided.
See Also:
GridConfiguration.getFailoverSpi()

getTopologySpi

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

Specified by:
getTopologySpi in interface GridConfiguration
Returns:
Grid topology SPI implementation or null to use default implementation.

setTopologySpi

public void setTopologySpi(GridTopologySpi... topSpi)
Sets fully configured instance of GridTopologySpi.

Parameters:
topSpi - Fully configured instance of GridTopologySpi or null if no SPI provided.
See Also:
GridConfiguration.getTopologySpi()

getLoadBalancingSpi

public 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.

Specified by:
getLoadBalancingSpi in interface GridConfiguration
Returns:
Grid load balancing SPI implementation or null to use default implementation.

getDiscoveryStartupDelay

public 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,000 specified by GridConfiguration.DFLT_DISCOVERY_STARTUP_DELAY. This should be good enough for vast majority of configurations. However, if you do anticipate an even larger delay, you should increase this value.

Specified by:
getDiscoveryStartupDelay in interface GridConfiguration
Returns:
Time in milliseconds for when nodes can be out-of-sync.

setDiscoveryStartupDelay

public void setDiscoveryStartupDelay(long discoStartupDelay)
Sets time in milliseconds after which a certain metric value is considered expired. If not set explicitly, then default value is 600,000 milliseconds (10 minutes).

Parameters:
discoStartupDelay - Time in milliseconds for when nodes can be out-of-sync during startup.

setLoadBalancingSpi

public void setLoadBalancingSpi(GridLoadBalancingSpi... loadBalancingSpi)
Sets fully configured instance of GridLoadBalancingSpi.

Parameters:
loadBalancingSpi - Fully configured instance of GridLoadBalancingSpi or null if no SPI provided.
See Also:
GridConfiguration.getLoadBalancingSpi()

toString

public String toString()

Overrides:
toString in class Object

setDeploymentMode

public void setDeploymentMode(GridDeploymentMode deployMode)
Sets task classes and resources sharing mode.

Parameters:
deployMode - Task classes and resources sharing mode.

getDeploymentMode

public GridDeploymentMode getDeploymentMode()
Gets deployment mode for deploying tasks and other classes on this node. Refer to GridDeploymentMode documentation for more information.

Specified by:
getDeploymentMode in interface GridConfiguration
Returns:
Deployment mode.

setPeerClassLoadingMissedResourcesCacheSize

public void setPeerClassLoadingMissedResourcesCacheSize(int missedRsrcsCacheSize)
Sets size of missed resources cache. Set 0 to avoid missed resources caching.

Parameters:
missedRsrcsCacheSize - size of missed resources cache.

getPeerClassLoadingMissedResourcesCacheSize

public int getPeerClassLoadingMissedResourcesCacheSize()
Returns missed resources cache size. If size greater than 0, missed resources will be cached and next resource request ignored. If size is 0, then request for the resource will be sent to the remote node every time this resource is requested.

Specified by:
getPeerClassLoadingMissedResourcesCacheSize in interface GridConfiguration
Returns:
Missed resources cache size.

GridGain™ 2.1.0
Java API Specification

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