Package org.apache.ignite.internal
Class GridKernalContextImpl
- java.lang.Object
-
- org.apache.ignite.internal.GridKernalContextImpl
-
- All Implemented Interfaces:
Externalizable,Serializable,Iterable<GridComponent>,GridKernalContext
@GridToStringExclude public class GridKernalContextImpl extends Object implements GridKernalContext, Externalizable
Implementation of kernal context.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description GridKernalContextImpl()No-arg constructor is required by externalization.protectedGridKernalContextImpl(GridLoggerProxy log, IgniteEx grid, IgniteConfiguration cfg, GridKernalGateway gw, List<PluginProvider> plugins, IgnitePredicate<String> clsFilter, WorkersRegistry workerRegistry, Thread.UncaughtExceptionHandler hnd, LongJVMPauseDetector pauseDetector)Creates new kernal context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(GridComponent comp)voidadd(GridComponent comp, boolean addToList)voidaddHelper(Object helper)ObjectaddNodeAttribute(String key, Object val)Add attribute to node attributes.GridAffinityProcessoraffinity()Gets cache data affinity processor.GridCacheProcessorcache()Gets caches processor.IgniteCacheObjectProcessorcacheObjects()Gets cache object processor.GridCheckpointManagercheckpoint()Gets checkpoint manager.booleanclientDisconnected()ClientListenerProcessorclientListener()Gets client listener processor.booleanclientNode()GridClosureProcessorclosure()Gets closure processor.ClusterProcessorcluster()Gets Cluster processor.GridCollisionManagercollision()Gets collision manager.List<GridComponent>components()Gets list of all grid components in the order they were added.CompressionProcessorcompress()IgniteConfigurationconfig()Gets grid configuration.GridContinuousProcessorcontinuous()Gets event continuous processor.<T> TcreateComponent(Class<T> cls)Creates optional component.<K,V>
DataStreamProcessor<K,V>dataStream()Gets data streamer processor.DataStructuresProcessordataStructures()Gets data structures processor.IgniteDefragmentationdefragmentation()Gets defragmentation manager.GridDeploymentManagerdeploy()Gets deployment manager.DiagnosticProcessordiagnostic()Gets diagnostic processor.GridDiscoveryManagerdiscovery()Gets discovery manager.DistributedConfigurationProcessordistributedConfiguration()Gets distributed configuration processor.DistributedMetaStoragedistributedMetastorage()Gets global metastorage.DurableBackgroundTasksProcessordurableBackgroundTask()GridEncryptionManagerencryption()Gets encryption manager.GridEventStorageManagerevent()Gets event storage manager.IgniteExceptionRegistryexceptionRegistry()Gets exception registry.GridFailoverManagerfailover()Gets failover manager.FailureProcessorfailure()Gets failure processor.GridKernalGatewaygateway()Gets kernal gateway.ExecutorgetAsyncContinuationExecutor()Executor that is in charge of processing user async continuations.IgniteExgrid()Gets grid instance managed by kernal.booleanhasNodeAttribute(String key)Check if node has specified attribute.StringigniteInstanceName()Gets Ignite instance name.GridIndexingManagerindexing()Gets indexing manager.IndexProcessorindexProcessor()Indexes processor.GridInternalSubscriptionProcessorinternalSubscriptionProcessor()booleaninvalid()Checks whether this node is invalid due to a critical error or not.GridIoManagerio()Gets communication manager.booleanisStopping()Iterator<GridComponent>iterator()GridJobProcessorjob()Gets job processor.GridJobMetricsProcessorjobMetric()Gets job metric processor.GridLoadBalancerManagerloadBalancing()Gets load balancing manager.UUIDlocalNodeId()Gets local node ID.IgniteLoggerlog(Class<?> cls)Gets logger for given class.IgniteLoggerlog(String ctgr)Gets logger for given category.LongJVMPauseDetectorlongJvmPauseDetector()Gets long JVM pause detector.MaintenanceRegistrymaintenanceRegistry()Gets maintenance registry.GridMarshallerMappingProcessormapping()Gets grid marshaller mapping processor.MarshallerContextImplmarshallerContext()Gets marshaller context.GridMetricManagermetric()Gets metric manager.ObjectnodeAttribute(String key)Get node attribute by name.Map<String,Object>nodeAttributes()PdsFoldersResolverpdsFolderResolver()GridPerformanceSuggestionsperformance()PerformanceStatisticsProcessorperformanceStatistics()Gets Performance statistics processor.PlatformProcessorplatform()PluginProviderpluginProvider(String name)IgnitePluginProcessorplugins()PoolProcessorpools()Gets pool processor.GridPortProcessorports()Gets port processor.voidprintMemoryStats()Print grid kernal memory stats (sizes of internal structures, etc.).GridQueryProcessorquery()Gets query processor.voidreadExternal(ObjectInput in)protected ObjectreadResolve()Reconstructs object on unmarshalling.booleanrecoveryMode()voidrecoveryMode(boolean recoveryMode)GridResourceProcessorresource()Gets resource processor.IgniteRestProcessorrest()Gets REST processor.IgniteScheduleProcessorAdapterschedule()Gets schedule processor.IgniteSecuritysecurity()Gets instance ofIgniteSecurity.GridSegmentationProcessorsegmentation()Gets segmentation processor.booleansegmented()Checks whether this node detected its segmentation from the rest of the grid.IgniteServiceProcessorservice()Gets service processor.GridTaskSessionProcessorsession()Gets task session processor.GridClusterStateProcessorstate()Gets cluster state processor.GridSystemViewManagersystemView()Gets system view manager.GridTaskProcessortask()Gets task processor.GridTimeoutProcessortimeout()Gets timeout processor.StringtoString()Tracingtracing()Gets tracing processor.CacheObjectTransformerProcessortransformer()Gets transformation processor.Thread.UncaughtExceptionHandleruncaughtExceptionHandler()StringuserVersion(ClassLoader ldr)Gets user version for given class loader by checkingMETA-INF/ignite.xmlfile foruserVersionattribute.WorkersRegistryworkersRegistry()Gets workers registry.voidwriteExternal(ObjectOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
GridKernalContextImpl
public GridKernalContextImpl()
No-arg constructor is required by externalization.
-
GridKernalContextImpl
protected GridKernalContextImpl(GridLoggerProxy log, IgniteEx grid, IgniteConfiguration cfg, GridKernalGateway gw, List<PluginProvider> plugins, IgnitePredicate<String> clsFilter, WorkersRegistry workerRegistry, Thread.UncaughtExceptionHandler hnd, LongJVMPauseDetector pauseDetector)
Creates new kernal context.- Parameters:
log- Logger.grid- Grid instance managed by kernal.cfg- Grid configuration.gw- Kernal gateway.plugins- Plugin providers.hnd- Default uncaught exception handler used by thread pools.pauseDetector- Long JVM pause detector.
-
-
Method Detail
-
iterator
public Iterator<GridComponent> iterator()
- Specified by:
iteratorin interfaceIterable<GridComponent>
-
components
public List<GridComponent> components()
Gets list of all grid components in the order they were added.- Specified by:
componentsin interfaceGridKernalContext- Returns:
- List of all grid components in the order they were added.
-
add
public void add(GridComponent comp)
- Parameters:
comp- Manager to add.
-
add
public void add(GridComponent comp, boolean addToList)
- Parameters:
comp- Manager to add.addToList- Iftruecomponent is added to components list.
-
addHelper
public void addHelper(Object helper)
- Parameters:
helper- Helper to add.
-
isStopping
public boolean isStopping()
- Specified by:
isStoppingin interfaceGridKernalContext- Returns:
Trueif grid is in the process of stopping.
-
localNodeId
public UUID localNodeId()
Gets local node ID.- Specified by:
localNodeIdin interfaceGridKernalContext- Returns:
- Local node ID.
-
igniteInstanceName
public String igniteInstanceName()
Gets Ignite instance name.- Specified by:
igniteInstanceNamein interfaceGridKernalContext- Returns:
- Ignite instance name.
-
gateway
public GridKernalGateway gateway()
Gets kernal gateway.- Specified by:
gatewayin interfaceGridKernalContext- Returns:
- Kernal gateway.
-
grid
public IgniteEx grid()
Gets grid instance managed by kernal.- Specified by:
gridin interfaceGridKernalContext- Returns:
- Grid instance.
-
config
public IgniteConfiguration config()
Gets grid configuration.- Specified by:
configin interfaceGridKernalContext- Returns:
- Grid configuration.
-
task
public GridTaskProcessor task()
Gets task processor.- Specified by:
taskin interfaceGridKernalContext- Returns:
- Task processor.
-
job
public GridJobProcessor job()
Gets job processor.- Specified by:
jobin interfaceGridKernalContext- Returns:
- Job processor
-
timeout
public GridTimeoutProcessor timeout()
Gets timeout processor.- Specified by:
timeoutin interfaceGridKernalContext- Returns:
- Timeout processor.
-
resource
public GridResourceProcessor resource()
Gets resource processor.- Specified by:
resourcein interfaceGridKernalContext- Returns:
- Resource processor.
-
jobMetric
public GridJobMetricsProcessor jobMetric()
Gets job metric processor.- Specified by:
jobMetricin interfaceGridKernalContext- Returns:
- Metrics processor.
-
metric
public GridMetricManager metric()
Gets metric manager.- Specified by:
metricin interfaceGridKernalContext- Returns:
- Monitoring manager.
-
systemView
public GridSystemViewManager systemView()
Gets system view manager.- Specified by:
systemViewin interfaceGridKernalContext- Returns:
- Monitoring manager.
-
maintenanceRegistry
public MaintenanceRegistry maintenanceRegistry()
Gets maintenance registry.- Specified by:
maintenanceRegistryin interfaceGridKernalContext- Returns:
- Maintenance registry.
-
transformer
public CacheObjectTransformerProcessor transformer()
Gets transformation processor.- Specified by:
transformerin interfaceGridKernalContext- Returns:
- Transformation processor.
-
cache
public GridCacheProcessor cache()
Gets caches processor.- Specified by:
cachein interfaceGridKernalContext- Returns:
- Cache processor.
-
state
public GridClusterStateProcessor state()
Gets cluster state processor.- Specified by:
statein interfaceGridKernalContext- Returns:
- Cluster state processor.
-
distributedMetastorage
public DistributedMetaStorage distributedMetastorage()
Gets global metastorage.- Specified by:
distributedMetastoragein interfaceGridKernalContext- Returns:
- Global metastorage.
-
distributedConfiguration
public DistributedConfigurationProcessor distributedConfiguration()
Gets distributed configuration processor.- Specified by:
distributedConfigurationin interfaceGridKernalContext- Returns:
- Distributed configuration processor.
-
tracing
public Tracing tracing()
Gets tracing processor.- Specified by:
tracingin interfaceGridKernalContext- Returns:
- Tracing processor.
-
session
public GridTaskSessionProcessor session()
Gets task session processor.- Specified by:
sessionin interfaceGridKernalContext- Returns:
- Session processor.
-
closure
public GridClosureProcessor closure()
Gets closure processor.- Specified by:
closurein interfaceGridKernalContext- Returns:
- Closure processor.
-
service
public IgniteServiceProcessor service()
Gets service processor.- Specified by:
servicein interfaceGridKernalContext- Returns:
- Service processor.
-
ports
public GridPortProcessor ports()
Gets port processor.- Specified by:
portsin interfaceGridKernalContext- Returns:
- Port processor.
-
schedule
public IgniteScheduleProcessorAdapter schedule()
Gets schedule processor.- Specified by:
schedulein interfaceGridKernalContext- Returns:
- Schedule processor.
-
deploy
public GridDeploymentManager deploy()
Gets deployment manager.- Specified by:
deployin interfaceGridKernalContext- Returns:
- Deployment manager.
-
io
public GridIoManager io()
Gets communication manager.- Specified by:
ioin interfaceGridKernalContext- Returns:
- Communication manager.
-
discovery
public GridDiscoveryManager discovery()
Gets discovery manager.- Specified by:
discoveryin interfaceGridKernalContext- Returns:
- Discovery manager.
-
checkpoint
public GridCheckpointManager checkpoint()
Gets checkpoint manager.- Specified by:
checkpointin interfaceGridKernalContext- Returns:
- Checkpoint manager.
-
event
public GridEventStorageManager event()
Gets event storage manager.- Specified by:
eventin interfaceGridKernalContext- Returns:
- Event storage manager.
-
failover
public GridFailoverManager failover()
Gets failover manager.- Specified by:
failoverin interfaceGridKernalContext- Returns:
- Failover manager.
-
collision
public GridCollisionManager collision()
Gets collision manager.- Specified by:
collisionin interfaceGridKernalContext- Returns:
- Collision manager.
-
security
public IgniteSecurity security()
Gets instance ofIgniteSecurity.- Specified by:
securityin interfaceGridKernalContext- Returns:
- Ignite security.
-
loadBalancing
public GridLoadBalancerManager loadBalancing()
Gets load balancing manager.- Specified by:
loadBalancingin interfaceGridKernalContext- Returns:
- Load balancing manager.
-
indexing
public GridIndexingManager indexing()
Gets indexing manager.- Specified by:
indexingin interfaceGridKernalContext- Returns:
- Indexing manager.
-
indexProcessor
public IndexProcessor indexProcessor()
Indexes processor.- Specified by:
indexProcessorin interfaceGridKernalContext- Returns:
- Indexes processor.
-
encryption
public GridEncryptionManager encryption()
Gets encryption manager.- Specified by:
encryptionin interfaceGridKernalContext- Returns:
- Encryption manager.
-
defragmentation
public IgniteDefragmentation defragmentation()
Gets defragmentation manager.- Specified by:
defragmentationin interfaceGridKernalContext- Returns:
- Defragmentation manager.
-
workersRegistry
public WorkersRegistry workersRegistry()
Gets workers registry.- Specified by:
workersRegistryin interfaceGridKernalContext- Returns:
- Workers registry.
-
affinity
public GridAffinityProcessor affinity()
Gets cache data affinity processor.- Specified by:
affinityin interfaceGridKernalContext- Returns:
- Cache data affinity processor.
-
rest
public IgniteRestProcessor rest()
Gets REST processor.- Specified by:
restin interfaceGridKernalContext- Returns:
- REST processor.
-
segmentation
public GridSegmentationProcessor segmentation()
Gets segmentation processor.- Specified by:
segmentationin interfaceGridKernalContext- Returns:
- Segmentation processor.
-
dataStream
public <K,V> DataStreamProcessor<K,V> dataStream()
Gets data streamer processor.- Specified by:
dataStreamin interfaceGridKernalContext- Returns:
- Data streamer processor.
-
continuous
public GridContinuousProcessor continuous()
Gets event continuous processor.- Specified by:
continuousin interfaceGridKernalContext- Returns:
- Event continuous processor.
-
pools
public PoolProcessor pools()
Gets pool processor.- Specified by:
poolsin interfaceGridKernalContext- Returns:
- Pool processor.
-
mapping
public GridMarshallerMappingProcessor mapping()
Gets grid marshaller mapping processor.- Specified by:
mappingin interfaceGridKernalContext- Returns:
- Mapping processor.
-
cacheObjects
public IgniteCacheObjectProcessor cacheObjects()
Gets cache object processor.- Specified by:
cacheObjectsin interfaceGridKernalContext- Returns:
- Cache object processor.
-
query
public GridQueryProcessor query()
Gets query processor.- Specified by:
queryin interfaceGridKernalContext- Returns:
- Query processor.
-
clientListener
public ClientListenerProcessor clientListener()
Gets client listener processor.- Specified by:
clientListenerin interfaceGridKernalContext- Returns:
- Client listener processor.
-
dataStructures
public DataStructuresProcessor dataStructures()
Gets data structures processor.- Specified by:
dataStructuresin interfaceGridKernalContext- Returns:
- Data structures processor.
-
log
public IgniteLogger log(String ctgr)
Gets logger for given category.- Specified by:
login interfaceGridKernalContext- Parameters:
ctgr- Category.- Returns:
- Logger.
-
log
public IgniteLogger log(Class<?> cls)
Gets logger for given class.- Specified by:
login interfaceGridKernalContext- Parameters:
cls- Class to get logger for.- Returns:
- Logger.
-
performance
public GridPerformanceSuggestions performance()
- Specified by:
performancein interfaceGridKernalContext- Returns:
- Performance suggestions object.
-
longJvmPauseDetector
public LongJVMPauseDetector longJvmPauseDetector()
Gets long JVM pause detector.- Specified by:
longJvmPauseDetectorin interfaceGridKernalContext- Returns:
- Long JVM pause detector.
-
diagnostic
public DiagnosticProcessor diagnostic()
Gets diagnostic processor.- Specified by:
diagnosticin interfaceGridKernalContext- Returns:
- Diagnostic processor.
-
printMemoryStats
public void printMemoryStats()
Print grid kernal memory stats (sizes of internal structures, etc.). NOTE: This method is for testing and profiling purposes only.- Specified by:
printMemoryStatsin interfaceGridKernalContext
-
userVersion
public String userVersion(ClassLoader ldr)
Gets user version for given class loader by checkingMETA-INF/ignite.xmlfile foruserVersionattribute. Ifignite.xmlfile is not found, or user version is not specified there, then default version (empty string) is returned.- Specified by:
userVersionin interfaceGridKernalContext- Parameters:
ldr- Class loader.- Returns:
- User version for given class loader or empty string if no version was explicitly specified.
-
pluginProvider
public PluginProvider pluginProvider(String name) throws PluginNotFoundException
- Specified by:
pluginProviderin interfaceGridKernalContext- Parameters:
name- Plugin name.- Returns:
- Plugin provider instance.
- Throws:
PluginNotFoundException- If plugin provider for the given name was not found.
-
createComponent
@Nullable public <T> T createComponent(Class<T> cls)
Creates optional component.- Specified by:
createComponentin interfaceGridKernalContext- Parameters:
cls- Component class.- Returns:
- Created component.
-
plugins
public IgnitePluginProcessor plugins()
- Specified by:
pluginsin interfaceGridKernalContext- Returns:
- Plugin manager.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
readResolve
protected Object readResolve() throws ObjectStreamException
Reconstructs object on unmarshalling.- Returns:
- Reconstructed object.
- Throws:
ObjectStreamException- Thrown in case of unmarshalling error.
-
exceptionRegistry
public IgniteExceptionRegistry exceptionRegistry()
Gets exception registry.- Specified by:
exceptionRegistryin interfaceGridKernalContext- Returns:
- Exception registry.
-
nodeAttribute
public Object nodeAttribute(String key)
Get node attribute by name.- Specified by:
nodeAttributein interfaceGridKernalContext- Parameters:
key- Attribute name.- Returns:
- Attribute value.
-
hasNodeAttribute
public boolean hasNodeAttribute(String key)
Check if node has specified attribute.- Specified by:
hasNodeAttributein interfaceGridKernalContext- Parameters:
key- Attribute name.- Returns:
trueIf node has attribute with specified name.
-
addNodeAttribute
public Object addNodeAttribute(String key, Object val)
Add attribute to node attributes.- Specified by:
addNodeAttributein interfaceGridKernalContext- Parameters:
key- Attribute name.val- Attribute value.- Returns:
- Previous attribute value associated with attribute name.
-
nodeAttributes
public Map<String,Object> nodeAttributes()
- Specified by:
nodeAttributesin interfaceGridKernalContext- Returns:
- Node attributes.
-
cluster
public ClusterProcessor cluster()
Gets Cluster processor.- Specified by:
clusterin interfaceGridKernalContext- Returns:
- Cluster processor.
-
marshallerContext
public MarshallerContextImpl marshallerContext()
Gets marshaller context.- Specified by:
marshallerContextin interfaceGridKernalContext- Returns:
- Marshaller context.
-
clientNode
public boolean clientNode()
- Specified by:
clientNodein interfaceGridKernalContext- Returns:
Trueif local node is client node (has flagIgniteConfiguration.isClientMode()set).
-
clientDisconnected
public boolean clientDisconnected()
- Specified by:
clientDisconnectedin interfaceGridKernalContext- Returns:
Trueif local node in disconnected state.
-
platform
public PlatformProcessor platform()
- Specified by:
platformin interfaceGridKernalContext- Returns:
- Platform processor.
-
internalSubscriptionProcessor
public GridInternalSubscriptionProcessor internalSubscriptionProcessor()
- Specified by:
internalSubscriptionProcessorin interfaceGridKernalContext- Returns:
- subscription processor to manage internal-only (strict node-local) subscriptions between components.
-
pdsFolderResolver
public PdsFoldersResolver pdsFolderResolver()
- Specified by:
pdsFolderResolverin interfaceGridKernalContext- Returns:
- PDS mode folder name resolver, also generates consistent ID in case new folder naming is used
-
invalid
public boolean invalid()
Checks whether this node is invalid due to a critical error or not.- Specified by:
invalidin interfaceGridKernalContext- Returns:
Trueif this node is invalid,falseotherwise.
-
segmented
public boolean segmented()
Checks whether this node detected its segmentation from the rest of the grid.- Specified by:
segmentedin interfaceGridKernalContext- Returns:
Trueif this node has segmented,falseotherwise.
-
failure
public FailureProcessor failure()
Gets failure processor.- Specified by:
failurein interfaceGridKernalContext
-
uncaughtExceptionHandler
public Thread.UncaughtExceptionHandler uncaughtExceptionHandler()
- Specified by:
uncaughtExceptionHandlerin interfaceGridKernalContext- Returns:
- Default uncaught exception handler used by thread pools.
-
compress
public CompressionProcessor compress()
- Specified by:
compressin interfaceGridKernalContext- Returns:
- Compression processor.
-
recoveryMode
public boolean recoveryMode()
- Specified by:
recoveryModein interfaceGridKernalContext- Returns:
Trueif node is in recovery mode (before join to topology).
-
recoveryMode
public void recoveryMode(boolean recoveryMode)
- Parameters:
recoveryMode- Recovery mode.
-
durableBackgroundTask
public DurableBackgroundTasksProcessor durableBackgroundTask()
- Specified by:
durableBackgroundTaskin interfaceGridKernalContext- Returns:
- Local continuous tasks processor.
-
performanceStatistics
public PerformanceStatisticsProcessor performanceStatistics()
Gets Performance statistics processor.- Specified by:
performanceStatisticsin interfaceGridKernalContext- Returns:
- Performance statistics processor.
-
getAsyncContinuationExecutor
public Executor getAsyncContinuationExecutor()
Executor that is in charge of processing user async continuations.- Specified by:
getAsyncContinuationExecutorin interfaceGridKernalContext- Returns:
- Executor that is in charge of processing user async continuations.
-
-