|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.GridConfigurationAdapter
@Apache20LicenseCompatible public class GridConfigurationAdapter
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 |
|---|
public GridConfigurationAdapter()
public GridConfigurationAdapter(GridConfiguration cfg)
cfg - Grid configuration to copy from.| Method Detail |
|---|
public String getGridName()
getGridName in interface GridConfigurationpublic void setGridName(String gridName)
gridName - Grid name to set. Can be null, which is default
grid name.public Map<String,? extends Serializable> getUserAttributes()
GridNode.getAttribute(String) or
GridNode.getAttributes() methods.
Note that system adds the following attributes automatically (so you don't have to add them manually):
System.getProperties() - All system properties.System.getenv(String) - All environment properties.Grid.getName()).GridSpi.getName().
GridSpi.getName().
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.
getUserAttributes in interface GridConfigurationpublic void setUserAttributes(Map<String,? extends Serializable> userAttrs)
userAttrs - User attributes for this node.GridConfiguration.getUserAttributes()public GridLogger getGridLogger()
GridFactory for information on default configuration.
getGridLogger in interface GridConfigurationpublic void setGridLogger(GridLogger log)
log - Logger to use within grid.GridConfiguration.getGridLogger()public ExecutorService getExecutorService()
GridTasks
and GridJobs.
If not provided, default value will be used. See GridFactory for
information on default configuration.
getExecutorService in interface GridConfigurationpublic ExecutorService getSystemExecutorService()
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.
getSystemExecutorService in interface GridConfigurationpublic ExecutorService getPeerClassLoadingExecutorService()
If not provided, default value will be used. See GridFactory for
information on default configuration.
getPeerClassLoadingExecutorService in interface GridConfigurationpublic void setExecutorService(ExecutorService execSvc)
execSvc - Thread pool to use within grid.GridConfiguration.getExecutorService()public void setSystemExecutorService(ExecutorService systemSvc)
systemSvc - Thread pool to use within grid.GridConfiguration.getSystemExecutorService()public void setPeerClassLoadingExecutorService(ExecutorService p2PSvc)
p2PSvc - Thread pool to use within grid.GridConfiguration.getPeerClassLoadingExecutorService()public String getGridGainHome()
getGridGainHome in interface GridConfigurationpublic void setGridGainHome(String ggHome)
ggHome - GridGain installation folder.GridConfiguration.getGridGainHome()public MBeanServer getMBeanServer()
getMBeanServer in interface GridConfigurationManagementFactory.getPlatformMBeanServer()public void setMBeanServer(MBeanServer mbeanServer)
mbeanServer - Initialized and started MBean server.public UUID getNodeId()
GridFactory for information on default configuration.
getNodeId in interface GridConfigurationpublic void setNodeId(UUID nodeId)
nodeId - Unique identifier for local node.GridConfiguration.getNodeId()public GridMarshaller getMarshaller()
GridFactory for information on default configuration.
getMarshaller in interface GridConfigurationpublic void setMarshaller(GridMarshaller marshaller)
marshaller - Marshaller to use within grid.GridConfiguration.getMarshaller()public boolean isPeerClassLoadingEnabled()
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.
isPeerClassLoadingEnabled in interface GridConfigurationpublic void setPeerClassLoadingEnabled(boolean isPeerClsLoadingEnabled)
isPeerClsLoadingEnabled - true if peer class loading is
enabled, false otherwise.public List<String> getP2PLocalClassPathExclude()
getP2PLocalClassPathExclude in interface GridConfigurationpublic void setP2PLocalClassPathExclude(List<String> localClassPathExclude)
localClassPathExclude - List of P2P loaded packages. Package
name supports '*' at the end like in package import clause.public int getMetricsHistorySize()
GridConfiguration.DFLT_METRICS_HISTORY_SIZE is used.
getMetricsHistorySize in interface GridConfigurationpublic void setMetricsHistorySize(int metricsHistorySize)
metricsHistorySize - Number of metrics kept in history to use for
metric totals and averages calculations.public long getMetricsExpireTime()
GridConfiguration.DFLT_METRICS_EXPIRE_TIME is used.
getMetricsExpireTime in interface GridConfigurationpublic void setMetricsExpireTime(long metricsExpireTime)
metricsExpireTime - The metricsExpireTime to set.public long getPeerClassLoadingTimeout()
ClassNotFoundException
will be thrown.
If not provided (value is 0), then default value
GridConfiguration.DFLT_PEER_CLASS_LOADING_TIMEOUT is used.
getPeerClassLoadingTimeout in interface GridConfigurationpublic void setPeerClassLoadingTimeout(long peerClsLoadingTimeout)
ClassNotFoundException
will be thrown.
If not provided (value is 0), the default vlaue is 10,000 or 10 seconds.
peerClsLoadingTimeout - Maximum timeout for peer-class-loading requests.public Collection<? extends GridLifecycleBean> getLifecycleBeans()
getLifecycleBeans in interface GridConfigurationGridLifecycleBean,
GridLifecycleEventTypepublic void setLifecycleBeans(Collection<? extends GridLifecycleBean> lifecycleBeans)
lifecycleBeans - Collection of lifecycle beans.GridLifecycleEventTypepublic GridEventStorageSpi getEventStorageSpi()
GridFactory for information on default configuration.
getEventStorageSpi in interface GridConfigurationpublic void setEventStorageSpi(GridEventStorageSpi evtSpi)
GridEventStorageSpi.
evtSpi - Fully configured instance of GridEventStorageSpi.GridConfiguration.getEventStorageSpi()public GridDiscoverySpi getDiscoverySpi()
GridFactory for information on default configuration.
getDiscoverySpi in interface GridConfigurationpublic void setDiscoverySpi(GridDiscoverySpi discoSpi)
GridDiscoverySpi.
discoSpi - Fully configured instance of GridDiscoverySpi.GridConfiguration.getDiscoverySpi()public GridCommunicationSpi getCommunicationSpi()
GridFactory for information on default configuration.
getCommunicationSpi in interface GridConfigurationpublic void setCommunicationSpi(GridCommunicationSpi commSpi)
GridCommunicationSpi.
commSpi - Fully configured instance of GridCommunicationSpi.GridConfiguration.getCommunicationSpi()public GridCollisionSpi getCollisionSpi()
GridFactory for information on default configuration.
getCollisionSpi in interface GridConfigurationpublic void setCollisionSpi(GridCollisionSpi colSpi)
GridCollisionSpi.
colSpi - Fully configured instance of GridCollisionSpi or
null if no SPI provided.GridConfiguration.getCollisionSpi()public GridLocalMetricsSpi getMetricsSpi()
GridFactory for information on default configuration.
getMetricsSpi in interface GridConfigurationpublic void setMetricsSpi(GridLocalMetricsSpi metricsSpi)
GridLocalMetricsSpi.
metricsSpi - Fully configured instance of GridLocalMetricsSpi or
null if no SPI provided.GridConfiguration.getMetricsSpi()public GridDeploymentSpi getDeploymentSpi()
GridFactory for information on default configuration.
getDeploymentSpi in interface GridConfigurationpublic void setDeploymentSpi(GridDeploymentSpi deploySpi)
GridDeploymentSpi.
deploySpi - Fully configured instance of GridDeploymentSpi.GridConfiguration.getDeploymentSpi()public GridCheckpointSpi[] getCheckpointSpi()
GridFactory for information on default configuration.
getCheckpointSpi in interface GridConfigurationpublic void setCheckpointSpi(GridCheckpointSpi... cpSpi)
GridCheckpointSpi.
cpSpi - Fully configured instance of GridCheckpointSpi.GridConfiguration.getCheckpointSpi()public GridTracingSpi[] getTracingSpi()
getTracingSpi in interface GridConfigurationpublic void setTracingSpi(GridTracingSpi... traceSpi)
GridTracingSpi.
traceSpi - Fully configured instance of GridTracingSpi or
null if no SPI provided.GridConfiguration.getTracingSpi()public GridFailoverSpi[] getFailoverSpi()
GridFactory for information on default configuration.
getFailoverSpi in interface GridConfigurationpublic void setFailoverSpi(GridFailoverSpi... failSpi)
GridFailoverSpi.
failSpi - Fully configured instance of GridFailoverSpi or
null if no SPI provided.GridConfiguration.getFailoverSpi()public GridTopologySpi[] getTopologySpi()
GridFactory for information on default configuration.
getTopologySpi in interface GridConfigurationpublic void setTopologySpi(GridTopologySpi... topSpi)
GridTopologySpi.
topSpi - Fully configured instance of GridTopologySpi or
null if no SPI provided.GridConfiguration.getTopologySpi()public GridLoadBalancingSpi[] getLoadBalancingSpi()
GridFactory for information on default configuration.
getLoadBalancingSpi in interface GridConfigurationpublic long getDiscoveryStartupDelay()
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.
getDiscoveryStartupDelay in interface GridConfigurationpublic void setDiscoveryStartupDelay(long discoStartupDelay)
discoStartupDelay - Time in milliseconds for when nodes
can be out-of-sync during startup.public void setLoadBalancingSpi(GridLoadBalancingSpi... loadBalancingSpi)
GridLoadBalancingSpi.
loadBalancingSpi - Fully configured instance of GridLoadBalancingSpi or
null if no SPI provided.GridConfiguration.getLoadBalancingSpi()public String toString()
toString in class Objectpublic void setDeploymentMode(GridDeploymentMode deployMode)
deployMode - Task classes and resources sharing mode.public GridDeploymentMode getDeploymentMode()
GridDeploymentMode documentation for more information.
getDeploymentMode in interface GridConfigurationpublic void setPeerClassLoadingMissedResourcesCacheSize(int missedRsrcsCacheSize)
missedRsrcsCacheSize - size of missed resources cache.public int getPeerClassLoadingMissedResourcesCacheSize()
getPeerClassLoadingMissedResourcesCacheSize in interface GridConfiguration
|
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. |
|
|