Class Ignition
This class defines a factory for the main Ignite API.
Use Start() method to start Ignite with default configuration.
All members are thread-safe and may be used concurrently from multiple threads.
Inheritance
Namespace: Apache.Ignite.Core
Assembly: Apache.Ignite.Core.dll
Syntax
public static class Ignition : object
Fields
ClientConfigurationSectionName
Default configuration section name.
Declaration
public const string ClientConfigurationSectionName = null
Field Value
Type | Description |
---|---|
System.String |
ConfigurationSectionName
Default configuration section name.
Declaration
public const string ConfigurationSectionName = null
Field Value
Type | Description |
---|---|
System.String |
Properties
ClientMode
Gets or sets a value indicating whether Ignite should be started in client mode. Client nodes cannot hold data in caches.
Declaration
public static bool ClientMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetAll()
Gets all started Ignite instances.
Declaration
public static ICollection<IIgnite> GetAll()
Returns
Type | Description |
---|---|
ICollection<IIgnite> | All Ignite instances. |
GetIgnite()
Gets the default Ignite instance with null name, or an instance with any name when there is only one.
Note that caller of this method should not assume that it will return the same instance every time.
Declaration
public static IIgnite GetIgnite()
Returns
Type | Description |
---|---|
IIgnite | Default Ignite instance. |
Exceptions
Type | Condition |
---|---|
IgniteException | When there is no matching Ignite instance. |
GetIgnite(String)
Gets a named Ignite instance. If Ignite name is null
or empty string,
then default no-name Ignite will be returned. Note that caller of this method
should not assume that it will return the same instance every time.
Note that single process can run multiple Ignite instances and every Ignite instance (and its node) can belong to a different grid. Ignite name defines what grid a particular Ignite instance (and correspondingly its node) belongs to.
Declaration
public static IIgnite GetIgnite(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Ignite name to which requested Ignite instance belongs. If |
Returns
Type | Description |
---|---|
IIgnite | An instance of named grid. |
Exceptions
Type | Condition |
---|---|
IgniteException | When there is no Ignite instance with specified name. |
LoadAssemblies(IEnumerable<String>)
Loads assemblies.
Declaration
public static void LoadAssemblies(IEnumerable<string> assemblies)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | assemblies | Assemblies. |
Start()
Starts Ignite with default configuration. By default this method will
use Ignite configuration defined in {IGNITE_HOME}/config/default-config.xml
configuration file. If such file is not found, then all system defaults will be used.
Declaration
public static IIgnite Start()
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. |
Start(IgniteConfiguration)
Starts Ignite with given configuration.
Declaration
public static IIgnite Start(IgniteConfiguration cfg)
Parameters
Type | Name | Description |
---|---|---|
IgniteConfiguration | cfg |
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. |
Start(String)
Starts all grids specified within given Spring XML configuration file. If Ignite with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.
Declaration
public static IIgnite Start(string springCfgPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | springCfgPath | Spring XML configuration file path or URL. Note, that the path can be absolute or relative to IGNITE_HOME. |
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. If Spring configuration contains multiple Ignite instances, then the 1st found instance is returned. |
StartClient()
Reads IgniteClientConfiguration from application configuration IgniteClientConfigurationSection with ClientConfigurationSectionName name and connects Ignite lightweight (thin) client to an Ignite node.
Thin client connects to an existing Ignite node with a socket and does not start JVM in process.
Declaration
public static IIgniteClient StartClient()
Returns
Type | Description |
---|---|
IIgniteClient | Ignite client instance. |
StartClient(IgniteClientConfiguration)
Connects Ignite lightweight (thin) client to an Ignite node.
Thin client connects to an existing Ignite node with a socket and does not start JVM in process.
Declaration
public static IIgniteClient StartClient(IgniteClientConfiguration clientConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IgniteClientConfiguration | clientConfiguration | The client configuration. |
Returns
Type | Description |
---|---|
IIgniteClient | Ignite client instance. |
StartClient(String)
Reads IgniteClientConfiguration from application configuration IgniteClientConfigurationSection with specified name and connects Ignite lightweight (thin) client to an Ignite node.
Thin client connects to an existing Ignite node with a socket and does not start JVM in process.
Declaration
public static IIgniteClient StartClient(string sectionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sectionName | Name of the configuration section. |
Returns
Type | Description |
---|---|
IIgniteClient | Ignite client instance. |
StartClient(String, String)
Reads IgniteConfiguration from application configuration IgniteConfigurationSection with specified name and starts Ignite.
Declaration
public static IIgniteClient StartClient(string sectionName, string configPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | sectionName | Name of the section. |
System.String | configPath | Path to the configuration file. |
Returns
Type | Description |
---|---|
IIgniteClient | Started Ignite. |
StartFromApplicationConfiguration()
Reads IgniteConfiguration from application configuration IgniteConfigurationSection with ConfigurationSectionName name and starts Ignite.
Declaration
public static IIgnite StartFromApplicationConfiguration()
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. |
StartFromApplicationConfiguration(String)
Reads IgniteConfiguration from application configuration IgniteConfigurationSection with specified name and starts Ignite.
Declaration
public static IIgnite StartFromApplicationConfiguration(string sectionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sectionName | Name of the section. |
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. |
StartFromApplicationConfiguration(String, String)
Reads IgniteConfiguration from application configuration IgniteConfigurationSection with specified name and starts Ignite.
Declaration
public static IIgnite StartFromApplicationConfiguration(string sectionName, string configPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | sectionName | Name of the section. |
System.String | configPath | Path to the configuration file. |
Returns
Type | Description |
---|---|
IIgnite | Started Ignite. |
Stop(String, Boolean)
Stops named grid. If cancel
flag is set to true
then
all jobs currently executing on local node will be interrupted. If
grid name is null
, then default no-name Ignite will be stopped.
Declaration
public static bool Stop(string name, bool cancel)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Grid name. If |
System.Boolean | cancel | If |
Returns
Type | Description |
---|---|
System.Boolean |
|
StopAll(Boolean)
Stops all started grids. If cancel
flag is set to true
then
all jobs currently executing on local node will be interrupted.
Declaration
public static void StopAll(bool cancel)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | cancel | If |
TryGetIgnite()
Gets the default Ignite instance with null name, or an instance with any name when there is only one. Returns null when there are no Ignite instances started, or when there are more than one, and none of them has null name.
Declaration
public static IIgnite TryGetIgnite()
Returns
Type | Description |
---|---|
IIgnite | An instance of default no-name grid, or null. |
TryGetIgnite(String)
Gets a named Ignite instance, or null
if none found. If Ignite name is null
or empty string,
then default no-name Ignite will be returned. Note that caller of this method
should not assume that it will return the same instance every time.
Note that single process can run multiple Ignite instances and every Ignite instance (and its node) can belong to a different grid. Ignite name defines what grid a particular Ignite instance (and correspondingly its node) belongs to.
Declaration
public static IIgnite TryGetIgnite(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Ignite name to which requested Ignite instance belongs. If |
Returns
Type | Description |
---|---|
IIgnite | An instance of named grid, or null. |