http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreException.cs deleted file mode 100644 index f5f398b..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreException.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Store -{ - using System; - using System.Runtime.Serialization; - - /// <summary> - /// Indicates an error during CacheStore operation. - /// </summary> - [Serializable] - public class CacheStoreException : CacheException - { - /// <summary> - /// Initializes a new instance of the <see cref="CacheStoreException"/> class. - /// </summary> - public CacheStoreException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="CacheStoreException"/> class. - /// </summary> - /// <param name="message">The message that describes the error.</param> - public CacheStoreException(string message) : base(message) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="CacheStoreException"/> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public CacheStoreException(string message, Exception cause) : base(message, cause) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="CacheStoreException"/> class. - /// </summary> - /// <param name="info">Serialization information.</param> - /// <param name="ctx">Streaming context.</param> - protected CacheStoreException(SerializationInfo info, StreamingContext ctx) : base(info, ctx) - { - // No-op. - } - } -}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStore.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStore.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStore.cs deleted file mode 100644 index 4660dab..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStore.cs +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Store -{ - using System; - using System.Collections; - using Apache.Ignite.Core.Transactions; - - /// <summary> - /// API for cache persistent storage for read-through and write-through behavior. - /// - /// Persistent store is configured in Ignite's Spring XML configuration file via - /// <c>CacheConfiguration.setStore()</c> property. If you have an implementation - /// of cache store in .NET, you should use special Java wrapper which accepts assembly name and - /// class name of .NET store implementation (both properties are mandatory). - /// - /// Optionally, you may specify "properies" property to set any property values on an instance of your store. - /// <example> - /// Here is an example: - /// <code> - /// <bean class="org.apache.ignite.configuration.CacheConfiguration"> - /// ... - /// <property name="cacheStoreFactory"> - /// <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory"> - /// <property name="assemblyName" value="MyAssembly"/> - /// <property name="className" value="MyApp.MyCacheStore"/> - /// <property name="properties"> - /// <map> - /// <entry key="IntProperty"> - /// <value type="java.lang.Integer">42</value> - /// </entry> - /// <entry key="StringProperty" value="String value"/> - /// </map> - /// </property> - /// </bean> - /// </property> - /// ... - /// </bean> - /// </code> - /// </example> - /// Assemply name and class name are passed to <a target="_blank" href="http://msdn.microsoft.com/en-us/library/d133hta4.aspx"><b>System.Activator.CreateInstance(String, String)</b></a> - /// method during node startup to create an instance of cache store. Refer to its documentation for details. - /// <para/> - /// All transactional operations of this API are provided with ongoing <see cref="ITransaction"/>, - /// if any. You can attach any metadata to transaction, e.g. to recognize if several operations - /// belong to the same transaction or not. - /// <example> - /// Here is an example of how attach a ODBC connection as transaction metadata: - /// <code> - /// OdbcConnection conn = tx.Meta("some.name"); - /// - /// if (conn == null) - /// { - /// conn = ...; // Create or get connection. - /// - /// // Store connection in transaction metadata, so it can be accessed - /// // for other operations on the same transaction. - /// tx.AddMeta("some.name", conn); - /// } - /// </code> - /// </example> - /// </summary> - public interface ICacheStore - { - /// <summary> - /// Loads all values from underlying persistent storage. Note that keys are - /// not passed, so it is up to implementation to figure out what to load. - /// This method is called whenever <see cref="ICache{K,V}.LocalLoadCache"/> - /// method is invoked which is usually to preload the cache from persistent storage. - /// <para/> - /// This method is optional, and cache implementation - /// does not depend on this method to do anything. - /// <para/> - /// For every loaded value method provided action should be called. - /// The action will then make sure that the loaded value is stored in cache. - /// </summary> - /// <param name="act">Action for loaded values.</param> - /// <param name="args">Optional arguemnts passed to <see cref="ICache{K,V}.LocalLoadCache"/> method.</param> - /// <exception cref="CacheStoreException" /> - void LoadCache(Action<object, object> act, params object[] args); - - /// <summary> - /// Loads an object. Application developers should implement this method to customize the loading - /// of a value for a cache entry. - /// This method is called by a cache when a requested entry is not in the cache. - /// If the object can't be loaded <code>null</code> should be returned. - /// </summary> - /// <param name="key">The key identifying the object being loaded.</param> - /// <returns>The value for the entry that is to be stored in the cache - /// or <code>null</code> if the object can't be loaded</returns> - /// <exception cref="CacheStoreException" /> - object Load(object key); - - /// <summary> - /// Loads multiple objects. Application developers should implement this method to customize - /// the loading of cache entries. This method is called when the requested object is not in the cache. - /// If an object can't be loaded, it is not returned in the resulting map. - /// </summary> - /// <param name="keys">Keys identifying the values to be loaded.</param> - /// <returns>A map of key, values to be stored in the cache.</returns> - /// <exception cref="CacheStoreException" /> - IDictionary LoadAll(ICollection keys); - - /// <summary> - /// Write the specified value under the specified key to the external resource. - /// <para /> - /// This method is intended to support both key/value creation and value update. - /// </summary> - /// <param name="key">Key to write.</param> - /// <param name="val">Value to write.</param> - /// <exception cref="CacheStoreException" /> - void Write(object key, object val); - - /// <summary> - /// Write the specified entries to the external resource. - /// This method is intended to support both insert and update. - /// <para /> - /// The order that individual writes occur is undefined. - /// <para /> - /// If this operation fails (by throwing an exception) after a partial success, - /// the writer must remove any successfully written entries from the entries collection - /// so that the caching implementation knows what succeeded and can mutate the cache. - /// </summary> - /// <param name="entries">a mutable collection to write. Upon invocation, it contains the entries - /// to write for write-through. Upon return the collection must only contain entries - /// that were not successfully written. (see partial success above).</param> - /// <exception cref="CacheStoreException" /> - void WriteAll(IDictionary entries); - - /// <summary> - /// Delete the cache entry from the external resource. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method is invoked even if no mapping for the key exists. - /// </summary> - /// <param name="key">The key that is used for the delete operation.</param> - /// <exception cref="CacheStoreException" /> - void Delete(object key); - - /// <summary> - /// Remove data and keys from the external resource for the given collection of keys, if present. - /// <para /> - /// The order that individual deletes occur is undefined. - /// <para /> - /// If this operation fails (by throwing an exception) after a partial success, - /// the writer must remove any successfully written entries from the entries collection - /// so that the caching implementation knows what succeeded and can mutate the cache. - /// <para /> - /// Expiry of a cache entry is not a delete hence will not cause this method to be invoked. - /// <para /> - /// This method may include keys even if there is no mapping for that key, - /// in which case the data represented by that key should be removed from the underlying resource. - /// </summary> - /// <param name="keys">a mutable collection of keys for entries to delete. Upon invocation, - /// it contains the keys to delete for write-through. Upon return the collection must only contain - /// the keys that were not successfully deleted.</param> - /// <exception cref="CacheStoreException" /> - void DeleteAll(ICollection keys); - - /// <summary> - /// Tells store to commit or rollback a transaction depending on the value of the - /// <c>commit</c> parameter. - /// </summary> - /// <param name="commit"><c>True</c> if transaction should commit, <c>false</c> for rollback.</param> - /// <exception cref="CacheStoreException" /> - void SessionEnd(bool commit); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStoreSession.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStoreSession.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStoreSession.cs deleted file mode 100644 index e20a660..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cache/Store/ICacheStoreSession.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cache.Store -{ - using System.Collections.Generic; - - /// <summary> - /// Session for the cache store operations. The main purpose of cache store session - /// is to hold context between multiple store invocations whenever in transaction. For example, - /// you can save current database connection in the session <see cref="Properties"/> map. You can then - /// commit this connection in the <see cref="ICacheStore.SessionEnd(bool)"/> method. - /// </summary> - public interface ICacheStoreSession - { - /// <summary> - /// Cache name for the current store operation. Note that if the same store - /// is reused between different caches, then the cache name will change between - /// different store operations. - /// </summary> - string CacheName { get; } - - /// <summary> - /// Current session properties. You can add properties directly to the returned map. - /// </summary> - IDictionary<object, object> Properties { get; } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterGroupEmptyException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterGroupEmptyException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterGroupEmptyException.cs deleted file mode 100644 index 81e4a56..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterGroupEmptyException.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - using System.Runtime.Serialization; - using Apache.Ignite.Core.Common; - - /// <summary> - /// Indicates an illegal call on empty projection. Thrown by projection when operation - /// that requires at least one node is called on empty projection. - /// </summary> - [Serializable] - public class ClusterGroupEmptyException : IgniteException - { - /// <summary> - /// Initializes a new instance of the <see cref="ClusterGroupEmptyException"/> class. - /// </summary> - public ClusterGroupEmptyException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterGroupEmptyException"/> class. - /// </summary> - /// <param name="msg">Exception message.</param> - public ClusterGroupEmptyException(string msg) : base(msg) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterGroupEmptyException"/> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public ClusterGroupEmptyException(string message, Exception cause) - : base(message, cause) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterGroupEmptyException"/> class. - /// </summary> - /// <param name="info">Serialization info.</param> - /// <param name="ctx">Streaming context.</param> - protected ClusterGroupEmptyException(SerializationInfo info, StreamingContext ctx) - : base(info, ctx) - { - // No-op. - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterTopologyException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterTopologyException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterTopologyException.cs deleted file mode 100644 index ba30f51..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ClusterTopologyException.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - using System.Runtime.Serialization; - using Apache.Ignite.Core.Common; - - /// <summary> - /// Indicates an error with grid topology (e.g., crashed node, etc.) - /// </summary> - [Serializable] - public class ClusterTopologyException : IgniteException - { - /// <summary> - /// Initializes a new instance of the <see cref="ClusterTopologyException"/> class. - /// </summary> - public ClusterTopologyException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterTopologyException"/> class. - /// </summary> - /// <param name="msg">Exception message.</param> - public ClusterTopologyException(string msg) : base(msg) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterTopologyException"/> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public ClusterTopologyException(string message, Exception cause) - : base(message, cause) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ClusterTopologyException"/> class. - /// </summary> - /// <param name="info">Serialization info.</param> - /// <param name="ctx">Streaming context.</param> - protected ClusterTopologyException(SerializationInfo info, StreamingContext ctx) - : base(info, ctx) - { - // No-op. - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs deleted file mode 100644 index 02d9a78..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/ICluster.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - using System.Collections.Generic; - using Apache.Ignite.Core.Common; - - /// <summary> - /// Represents whole cluster (group of all nodes in a cluster). - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface ICluster : IClusterGroup - { - /// <summary> - /// Gets monadic projection consisting from the local node. - /// </summary> - /// <returns>Monadic projection consisting from the local node.</returns> - IClusterGroup ForLocal(); - - /// <summary> - /// Gets local Ignite node. - /// </summary> - /// <returns>Local Ignite node.</returns> - IClusterNode GetLocalNode(); - - /// <summary> - /// Pings a remote node. - /// </summary> - /// <param name="nodeId">ID of a node to ping.</param> - /// <returns>True if node for a given ID is alive, false otherwise.</returns> - bool PingNode(Guid nodeId); - - /// <summary> - /// Gets current topology version. In case of TCP discovery topology versions are sequential - /// - they start from 1 and get incremented every time whenever a node joins or leaves. - /// For other discovery SPIs topology versions may not be (and likely are not) sequential. - /// </summary> - /// <value> - /// Current topology version. - /// </value> - long TopologyVersion { get; } - - /// <summary> - /// Gets a topology by version. Returns null if topology history storage doesn't contain - /// specified topology version (history currently keeps the last 1000 snapshots). - /// </summary> - /// <param name="ver">Topology version.</param> - /// <returns>Collection of Ignite nodes which represented by specified topology version, - /// if it is present in history storage, null otherwise.</returns> - /// <exception cref="IgniteException">If underlying SPI implementation does not support - /// topology history. Currently only <code>org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi</code> - /// supports topology history.</exception> - ICollection<IClusterNode> GetTopology(long ver); - - /// <summary> - /// Resets local I/O, job, and task execution metrics. - /// </summary> - void ResetMetrics(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs deleted file mode 100644 index 433ba40..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - using System.Collections.Generic; - using Apache.Ignite.Core.Compute; - using Apache.Ignite.Core.Events; - using Apache.Ignite.Core.Messaging; - using Apache.Ignite.Core.Services; - - /// <summary> - /// Defines grid projection which represents a common functionality over a group of nodes. - /// Grid projection allows to group Ignite nodes into various subgroups to perform distributed - /// operations on them. All ForXXX(...)' methods will create a child grid projection - /// from existing projection. If you create a new projection from current one, then the resulting - /// projection will include a subset of nodes from current projection. The following code snippet - /// shows how to create grid projections: - /// <code> - /// var g = Ignition.GetIgnite(); - /// - /// // Projection over remote nodes. - /// var remoteNodes = g.ForRemotes(); - /// - /// // Projection over random remote node. - /// var randomNode = g.ForRandom(); - /// - /// // Projection over all nodes with cache named "myCache" enabled. - /// var cacheNodes = g.ForCacheNodes("myCache"); - /// - /// // Projection over all nodes that have user attribute "group" set to value "worker". - /// var workerNodes = g.ForAttribute("group", "worker"); - /// </code> - /// Grid projection provides functionality for executing tasks and closures over - /// nodes in this projection using <see cref="GetCompute"/>. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface IClusterGroup - { - /// <summary> - /// Instance of Ignite. - /// </summary> - IIgnite Ignite { get; } - - /// <summary> - /// Gets compute functionality over this grid projection. All operations - /// on the returned ICompute instance will only include nodes from - /// this projection. - /// </summary> - /// <returns>Compute instance over this grid projection.</returns> - ICompute GetCompute(); - - /// <summary> - /// Creates a grid projection over a given set of nodes. - /// </summary> - /// <param name="nodes">Collection of nodes to create a projection from.</param> - /// <returns>Projection over provided Ignite nodes.</returns> - IClusterGroup ForNodes(IEnumerable<IClusterNode> nodes); - - /// <summary> - /// Creates a grid projection over a given set of nodes. - /// </summary> - /// <param name="nodes">Collection of nodes to create a projection from.</param> - /// <returns>Projection over provided Ignite nodes.</returns> - IClusterGroup ForNodes(params IClusterNode[] nodes); - - /// <summary> - /// Creates a grid projection over a given set of node IDs. - /// </summary> - /// <param name="ids">Collection of node IDs to create a projection from.</param> - /// <returns>Projection over provided Ignite node IDs.</returns> - IClusterGroup ForNodeIds(IEnumerable<Guid> ids); - - /// <summary> - /// Creates a grid projection over a given set of node IDs. - /// </summary> - /// <param name="ids">Collection of node IDs to create a projection from.</param> - /// <returns>Projection over provided Ignite node IDs.</returns> - IClusterGroup ForNodeIds(params Guid[] ids); - - /// <summary> - /// Creates a grid projection which includes all nodes that pass the given predicate filter. - /// </summary> - /// <param name="p">Predicate filter for nodes to include into this projection.</param> - /// <returns>Grid projection for nodes that passed the predicate filter.</returns> - IClusterGroup ForPredicate(Func<IClusterNode, bool> p); - - /// <summary> - /// Creates projection for nodes containing given name and value - /// specified in user attributes. - /// </summary> - /// <param name="name">Name of the attribute.</param> - /// <param name="val">Optional attribute value to match.</param> - /// <returns>Grid projection for nodes containing specified attribute.</returns> - IClusterGroup ForAttribute(string name, string val); - - /// <summary> - /// Creates projection for all nodes that have cache with specified name running. - /// </summary> - /// <param name="name">Cache name to include into projection.</param> - /// <returns>Projection over nodes that have specified cache running.</returns> - IClusterGroup ForCacheNodes(string name); - - /// <summary> - /// Creates projection for all nodes that have cache with specified name running - /// and cache distribution mode is PARTITIONED_ONLY or NEAR_PARTITIONED. - /// </summary> - /// <param name="name">Cache name to include into projection.</param> - /// <returns>Projection over nodes that have specified cache running.</returns> - IClusterGroup ForDataNodes(string name); - - /// <summary> - /// Creates projection for all nodes that have cache with specified name running - /// and cache distribution mode is CLIENT_ONLY or NEAR_ONLY. - /// </summary> - /// <param name="name">Cache name to include into projection.</param> - /// <returns>Projection over nodes that have specified cache running.</returns> - IClusterGroup ForClientNodes(string name); - - /// <summary> - /// Gets grid projection consisting from the nodes in this projection excluding the local node. - /// </summary> - /// <returns>Grid projection consisting from the nodes in this projection excluding the local node.</returns> - IClusterGroup ForRemotes(); - - /// <summary> - /// Gets grid projection consisting from the nodes in this projection residing on the - /// same host as given node. - /// </summary> - /// <param name="node">Node residing on the host for which projection is created.</param> - /// <returns>Projection for nodes residing on the same host as passed in node.</returns> - IClusterGroup ForHost(IClusterNode node); - - /// <summary> - /// Creates grid projection with one random node from current projection. - /// </summary> - /// <returns>Grid projection with one random node from current projection.</returns> - IClusterGroup ForRandom(); - - /// <summary> - /// Creates grid projection with one oldest node in the current projection. - /// The resulting projection is dynamic and will always pick the next oldest - /// node if the previous one leaves topology even after the projection has - /// been created. - /// </summary> - /// <returns>Grid projection with one oldest node from the current projection.</returns> - IClusterGroup ForOldest(); - - /// <summary> - /// Creates grid projection with one youngest node in the current projection. - /// The resulting projection is dynamic and will always pick the newest - /// node in the topology, even if more nodes entered after the projection - /// has been created. - /// </summary> - /// <returns>Grid projection with one youngest node from the current projection.</returns> - IClusterGroup ForYoungest(); - - /// <summary> - /// Creates grid projection for nodes supporting .Net, i.e. for nodes started with Apache.Ignite.exe. - /// </summary> - /// <returns>Grid projection for nodes supporting .Net.</returns> - IClusterGroup ForDotNet(); - - /// <summary> - /// Gets read-only collections of nodes in this projection. - /// </summary> - /// <returns>All nodes in this projection.</returns> - ICollection<IClusterNode> GetNodes(); - - /// <summary> - /// Gets a node for given ID from this grid projection. - /// </summary> - /// <param name="id">Node ID.</param> - /// <returns>Node with given ID from this projection or null if such node does not - /// exist in this projection.</returns> - IClusterNode GetNode(Guid id); - - /// <summary> - /// Gets first node from the list of nodes in this projection. - /// </summary> - /// <returns>Node.</returns> - IClusterNode GetNode(); - - /// <summary> - /// Gets a metrics snapshot for this projection - /// </summary> - /// <returns>Grid projection metrics snapshot.</returns> - IClusterMetrics GetMetrics(); - - /// <summary> - /// Gets messaging facade over nodes within this cluster group. All operations on the returned - /// <see cref="IMessaging"/>> instance will only include nodes from current cluster group. - /// </summary> - /// <returns>Messaging instance over this cluster group.</returns> - IMessaging GetMessaging(); - - /// <summary> - /// Gets events facade over nodes within this cluster group. All operations on the returned - /// <see cref="IEvents"/>> instance will only include nodes from current cluster group. - /// </summary> - /// <returns>Events instance over this cluster group.</returns> - IEvents GetEvents(); - - /// <summary> - /// Gets services facade over nodes within this cluster group. All operations on the returned - /// <see cref="IServices"/>> instance will only include nodes from current cluster group. - /// </summary> - /// <returns>Services instance over this cluster group.</returns> - IServices GetServices(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs deleted file mode 100644 index 4ea690c..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterMetrics.cs +++ /dev/null @@ -1,515 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - - /// <summary> - /// Represents runtime information of a cluster. Apart from obvious - /// statistical value, this information is used for implementation of - /// load balancing, failover, and collision SPIs. For example, collision SPI - /// in combination with fail-over SPI could check if other nodes don't have - /// any active or waiting jobs and fail-over some jobs to those nodes. - /// <para /> - /// Node metrics for any node can be accessed via <see cref="IClusterNode.GetMetrics"/> - /// method. Keep in mind that there will be a certain network delay (usually - /// equal to heartbeat delay) for the accuracy of node metrics. However, when accessing - /// metrics on local node the metrics are always accurate and up to date. - /// </summary> - public interface IClusterMetrics - { - /// <summary> - /// Last update time of this node metrics. - /// </summary> - DateTime LastUpdateTime - { - get; - } - - /// <summary> - /// Maximum number of jobs that ever ran concurrently on this node. - /// </summary> - int MaximumActiveJobs - { - get; - } - - /// <summary> - /// Number of currently active jobs concurrently executing on the node. - /// </summary> - int CurrentActiveJobs - { - get; - } - - /// <summary> - /// Average number of active jobs. - /// </summary> - float AverageActiveJobs - { - get; - } - - /// <summary> - /// Maximum number of waiting jobs. - /// </summary> - int MaximumWaitingJobs - { - get; - } - - /// <summary> - /// Number of queued jobs currently waiting to be executed. - /// </summary> - int CurrentWaitingJobs - { - get; - } - - /// <summary> - /// Average number of waiting jobs. - /// </summary> - float AverageWaitingJobs - { - get; - } - - /// <summary> - /// Maximum number of jobs rejected at once. - /// </summary> - int MaximumRejectedJobs - { - get; - } - - /// <summary> - /// Number of jobs rejected after more recent collision resolution operation. - /// </summary> - int CurrentRejectedJobs - { - get; - } - - /// <summary> - /// Average number of jobs this node rejects during collision resolution operations. - /// </summary> - float AverageRejectedJobs - { - get; - } - - /// <summary> - /// Total number of jobs this node rejects during collision resolution operations since node startup. - /// </summary> - int TotalRejectedJobs - { - get; - } - - /// <summary> - /// Maximum number of cancelled jobs ever had running concurrently. - /// </summary> - int MaximumCancelledJobs - { - get; - } - - /// <summary> - /// Number of cancelled jobs that are still running. - /// </summary> - int CurrentCancelledJobs - { - get; - } - - /// <summary> - /// Average number of cancelled jobs. - /// </summary> - float AverageCancelledJobs - { - get; - } - - /// <summary> - /// Total number of cancelled jobs since node startup. - /// </summary> - int TotalCancelledJobs - { - get; - } - - /// <summary> - /// Total number of jobs handled by the node since node startup. - /// </summary> - int TotalExecutedJobs - { - get; - } - - /// <summary> - /// Maximum time a job ever spent waiting in a queue to be executed. - /// </summary> - long MaximumJobWaitTime - { - get; - } - - /// <summary> - /// Current time an oldest jobs has spent waiting to be executed. - /// </summary> - long CurrentJobWaitTime - { - get; - } - - /// <summary> - /// Average time jobs spend waiting in the queue to be executed. - /// </summary> - double AverageJobWaitTime - { - get; - } - - /// <summary> - /// Time it took to execute the longest job on the node. - /// </summary> - long MaximumJobExecuteTime - { - get; - } - - /// <summary> - /// Longest time a current job has been executing for. - /// </summary> - long CurrentJobExecuteTime - { - get; - } - - /// <summary> - /// Average job execution time. - /// </summary> - double AverageJobExecuteTime - { - get; - } - - /// <summary> - /// Total number of jobs handled by the node. - /// </summary> - int TotalExecutedTasks - { - get; - } - - /// <summary> - /// Total time this node spent executing jobs. - /// </summary> - long TotalBusyTime - { - get; - } - - /// <summary> - /// Total time this node spent idling. - /// </summary> - long TotalIdleTime - { - get; - } - - /// <summary> - /// Time this node spend idling since executing last job. - /// </summary> - long CurrentIdleTime - { - get; - } - - /// <summary> - /// Percentage of time this node is busy. - /// </summary> - float BusyTimePercentage - { - get; - } - - /// <summary> - /// Percentage of time this node is idle - /// </summary> - float IdleTimePercentage - { - get; - } - - /// <summary> - /// Returns the number of CPUs available to the Java Virtual Machine. - /// </summary> - int TotalCpus - { - get; - } - - /// <summary> - /// Returns the CPU usage usage in [0, 1] range. - /// </summary> - double CurrentCpuLoad - { - get; - } - - /// <summary> - /// Average of CPU load values in [0, 1] range over all metrics kept in the history. - /// </summary> - double AverageCpuLoad - { - get; - } - - /// <summary> - /// Average time spent in CG since the last update. - /// </summary> - double CurrentGcCpuLoad - { - get; - } - - /// <summary> - /// Amount of heap memory in bytes that the JVM - /// initially requests from the operating system for memory management. - /// This method returns <code>-1</code> if the initial memory size is undefined. - /// <para /> - /// This value represents a setting of the heap memory for Java VM and is - /// not a sum of all initial heap values for all memory pools. - /// </summary> - long HeapMemoryInitialized - { - get; - } - - /// <summary> - /// Current heap size that is used for object allocation. - /// The heap consists of one or more memory pools. This value is - /// the sum of used heap memory values of all heap memory pools. - /// <para /> - /// The amount of used memory in the returned is the amount of memory - /// occupied by both live objects and garbage objects that have not - /// been collected, if any. - /// </summary> - long HeapMemoryUsed - { - get; - } - - /// <summary> - /// Amount of heap memory in bytes that is committed for the JVM to use. This amount of memory is - /// guaranteed for the JVM to use. The heap consists of one or more memory pools. This value is - /// the sum of committed heap memory values of all heap memory pools. - /// </summary> - long HeapMemoryCommitted - { - get; - } - - /// <summary> - /// Mmaximum amount of heap memory in bytes that can be used for memory management. - /// This method returns <code>-1</code> if the maximum memory size is undefined. - /// <para /> - /// This amount of memory is not guaranteed to be available for memory management if - /// it is greater than the amount of committed memory. The JVM may fail to allocate - /// memory even if the amount of used memory does not exceed this maximum size. - /// <para /> - /// This value represents a setting of the heap memory for Java VM and is - /// not a sum of all initial heap values for all memory pools. - /// </summary> - long HeapMemoryMaximum - { - get; - } - - /// <summary> - /// Total amount of heap memory in bytes. This method returns <code>-1</code> - /// if the total memory size is undefined. - /// <para /> - /// This amount of memory is not guaranteed to be available for memory management if it is - /// greater than the amount of committed memory. The JVM may fail to allocate memory even - /// if the amount of used memory does not exceed this maximum size. - /// <para /> - /// This value represents a setting of the heap memory for Java VM and is - /// not a sum of all initial heap values for all memory pools. - /// </summary> - long HeapMemoryTotal - { - get; - } - - /// <summary> - /// Amount of non-heap memory in bytes that the JVM initially requests from the operating - /// system for memory management. - /// </summary> - long NonHeapMemoryInitialized - { - get; - } - - /// <summary> - /// Current non-heap memory size that is used by Java VM. - /// </summary> - long NonHeapMemoryUsed - { - get; - } - - /// <summary> - /// Amount of non-heap memory in bytes that is committed for the JVM to use. - /// </summary> - long NonHeapMemoryCommitted - { - get; - } - - /// <summary> - /// Maximum amount of non-heap memory in bytes that can be used for memory management. - /// </summary> - long NonHeapMemoryMaximum - { - get; - } - - /// <summary> - /// Total amount of non-heap memory in bytes that can be used for memory management. - /// </summary> - long NonHeapMemoryTotal - { - get; - } - - /// <summary> - /// Uptime of the JVM in milliseconds. - /// </summary> - long UpTime - { - get; - } - - /// <summary> - /// Start time of the JVM in milliseconds. - /// </summary> - DateTime StartTime - { - get; - } - - /// <summary> - /// Start time of the Ignite node in milliseconds. - /// </summary> - DateTime NodeStartTime - { - get; - } - - /// <summary> - /// Current number of live threads. - /// </summary> - int CurrentThreadCount - { - get; - } - - /// <summary> - /// The peak live thread count. - /// </summary> - int MaximumThreadCount - { - get; - } - - /// <summary> - /// The total number of threads started. - /// </summary> - long TotalStartedThreadCount - { - get; - } - - /// <summary> - /// Current number of live daemon threads. - /// </summary> - int CurrentDaemonThreadCount - { - get; - } - - /// <summary> - /// Ignite assigns incremental versions to all cache operations. This property provides - /// the latest data version on the node. - /// </summary> - long LastDataVersion - { - get; - } - - /// <summary> - /// Sent messages count - /// </summary> - int SentMessagesCount - { - get; - } - - /// <summary> - /// Sent bytes count. - /// </summary> - long SentBytesCount - { - get; - } - - /// <summary> - /// Received messages count. - /// </summary> - int ReceivedMessagesCount - { - get; - } - - /// <summary> - /// Received bytes count. - /// </summary> - long ReceivedBytesCount - { - get; - } - - /// <summary> - /// Outbound messages queue size. - /// </summary> - int OutboundMessagesQueueSize - { - get; - } - - /// <summary> - /// Gets total number of nodes. - /// </summary> - int TotalNodes - { - get; - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs deleted file mode 100644 index 11b4c4a..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - using System; - using System.Collections.Generic; - - /// <summary> - /// Interface representing a single cluster node. Use <see cref="GetAttribute{T}"/> or - /// <see cref="GetMetrics"/> to get static and dynamic information about remote nodes. - /// You can get a list of all nodes in grid by calling <see cref="IClusterGroup.GetNodes"/> - /// on <see cref="IIgnite"/> instance. - /// <para /> - /// You can use Ignite node attributes to provide static information about a node. - /// This information is initialized once within grid, during node startup, and - /// remains the same throughout the lifetime of a node. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface IClusterNode - { - /// <summary> - /// Globally unique node ID. A new ID is generated every time a node restarts. - /// </summary> - Guid Id { get; } - - /// <summary> - /// Gets node's attribute. Attributes are assigned to nodes at startup. - /// <para /> - /// Note that attributes cannot be changed at runtime. - /// </summary> - /// <param name="name">Attribute name.</param> - /// <returns>Attribute value.</returns> - T GetAttribute<T>(string name); - - /// <summary> - /// Try getting node's attribute. Attributes are assigned to nodes at startup. - /// <para /> - /// Note that attributes cannot be changed at runtime. - /// </summary> - /// <param name="name">Attribute name.</param> - /// <param name="attr">Attribute value.</param> - /// <returns><code>true</code> in case such attribute exists.</returns> - bool TryGetAttribute<T>(string name, out T attr); - - /// <summary> - /// Gets all node attributes. Attributes are assigned to nodes at startup. - /// <para /> - /// Note that attributes cannot be changed at runtime. - /// </summary> - /// <returns>All node attributes.</returns> - IDictionary<string, object> GetAttributes(); - - /// <summary> - /// Collection of addresses this node is known by. - /// </summary> - /// <returns>Collection of addresses.</returns> - ICollection<string> Addresses { get; } - - /// <summary> - /// Collection of host names this node is known by. - /// </summary> - /// <returns>Collection of host names.</returns> - ICollection<string> HostNames { get; } - - /// <summary> - /// Node order within grid topology. Discovery SPIs that support node ordering will - /// assign a proper order to each node and will guarantee that discovery event notifications - /// for new nodes will come in proper order. All other SPIs not supporting ordering - /// may choose to return node startup time here. - /// </summary> - long Order { get; } - - /// <summary> - /// Tests whether or not this node is a local node. - /// </summary> - bool IsLocal { get; } - - /// <summary> - /// Tests whether or not this node is a daemon. - /// <p/> - /// Daemon nodes are the usual Ignite nodes that participate in topology but not - /// visible on the main APIs, i.e. they are not part of any projections. - /// <p/> - /// Daemon nodes are used primarily for management and monitoring functionality that - /// is build on Ignite and needs to participate in the topology but should be - /// excluded from "normal" topology so that it won't participate in task execution - /// or in-memory database. - /// <p/> - /// Application code should never use daemon nodes. - /// </summary> - bool IsDaemon { get; } - - /// <summary> - /// Gets metrics snapshot for this node. Note that node metrics are constantly updated - /// and provide up to date information about nodes. For example, you can get - /// an idea about CPU load on remote node via <see cref="IClusterMetrics.CurrentCpuLoad"/>. - /// <para/> - /// Node metrics are updated with some delay which is directly related to heartbeat - /// frequency. For example, when used with default <code>GridTcpDiscoverySpi</code> the - /// update will happen every <code>2</code> seconds. - /// </summary> - /// <returns>Runtime metrics snapshot for this node.</returns> - IClusterMetrics GetMetrics(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNodeFilter.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNodeFilter.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNodeFilter.cs deleted file mode 100644 index 77eefbb..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Cluster/IClusterNodeFilter.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Cluster -{ - /// <summary> - /// Represents cluster node filter. - /// </summary> - public interface IClusterNodeFilter - { - /// <summary> - /// Returns a value indicating whether provided node satisfies this predicate. - /// </summary> - /// <param name="node">Cluster node.</param> - /// <returns>Value indicating whether provided node satisfies this predicate.</returns> - bool Invoke(IClusterNode node); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs deleted file mode 100644 index 094a93c..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Common -{ - using System; - - /// <summary> - /// Attribute to indicate that method can be executed asynchronously if async mode is enabled. - /// To enable async mode, invoke <see cref="IAsyncSupport{TWithAsync}.WithAsync"/> method on the API. - /// The future for the async method can be retrieved via - /// <see cref="IFuture{T}"/> right after the execution of an asynchronous method. - /// </summary> - [AttributeUsage(AttributeTargets.Method)] - public sealed class AsyncSupportedAttribute : Attribute - { - // No-op. - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs deleted file mode 100644 index ee98c5a..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Common -{ - /// <summary> - /// Allows to enable asynchronous mode on Ignite APIs. - /// </summary> - /// <typeparam name="TWithAsync">Type of WithAsync method result.</typeparam> - public interface IAsyncSupport<out TWithAsync> where TWithAsync : IAsyncSupport<TWithAsync> - { - /// <summary> - /// Gets component with asynchronous mode enabled. - /// </summary> - /// <returns>Component with asynchronous mode enabled.</returns> - TWithAsync WithAsync(); - - /// <summary> - /// Gets a value indicating whether this instance is in asynchronous mode. - /// </summary> - /// <value> - /// <c>true</c> if asynchronous mode is enabled. - /// </value> - bool IsAsync { get; } - - /// <summary> - /// Gets and resets future for previous asynchronous operation. - /// </summary> - /// <returns>Future for previous asynchronous operation.</returns> - IFuture GetFuture(); - - /// <summary> - /// Gets and resets future for previous asynchronous operation. - /// </summary> - /// <returns>Future for previous asynchronous operation.</returns> - IFuture<TResult> GetFuture<TResult>(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IFuture.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IFuture.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IFuture.cs deleted file mode 100644 index 2e94cd4..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IFuture.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Common -{ - using System; - using System.Threading.Tasks; - - /// <summary> - /// Non-generic Future. Represents an asynchronous operation that can return a value. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - public interface IFuture - { - /// <summary> - /// Gets a value indicating whether this instance is done. - /// </summary> - bool IsDone - { - get; - } - - /// <summary> - /// Gets the future result. - /// </summary> - /// <returns>Future result.</returns> - object Get(); - - /// <summary> - /// Gets the future result with a timeout. - /// </summary> - /// <param name="timeout">The timeout.</param> - /// <returns> - /// Future result, if it is obtained within specified timeout; otherwise, throws <see cref="TimeoutException"/> - /// </returns> - /// <exception cref="TimeoutException">Thrown if Get operation exceeded specified timeout.</exception> - object Get(TimeSpan timeout); - - /// <summary> - /// Listens this instance and invokes callback upon future completion. - /// </summary> - /// <param name="callback">The callback to execute upon future completion.</param> - void Listen(Action callback); - - /// <summary> - /// Listens this instance and invokes callback upon future completion. - /// </summary> - /// <param name="callback">The callback to execute upon future completion.</param> - void Listen(Action<IFuture> callback); - - /// <summary> - /// Gets an IAsyncResult indicating the state of this Future. - /// </summary> - /// <returns>Future state representation in form of IAsyncResult.</returns> - IAsyncResult ToAsyncResult(); - - /// <summary> - /// Gets a Task that returns the result of this Future. - /// </summary> - /// <returns>Task that completes when this future gets done and returns the result.</returns> - Task<object> ToTask(); - } - - /// <summary> - /// Generic Future. Represents an asynchronous operation that can return a value. - /// <para/> - /// All members are thread-safe and may be used concurrently from multiple threads. - /// </summary> - /// <typeparam name="T">Future result type.</typeparam> - public interface IFuture<T> : IFuture - { - /// <summary> - /// Gets the future result. - /// </summary> - /// <returns>Future result.</returns> - new T Get(); - - /// <summary> - /// Gets the future result with a timeout. - /// </summary> - /// <param name="timeout">The timeout.</param> - /// <returns> - /// Future result, if it is obtained within specified timeout; otherwise, throws <see cref="TimeoutException"/> - /// </returns> - /// <exception cref="TimeoutException">Thrown if Get operation exceeded specified timeout.</exception> - new T Get(TimeSpan timeout); - - /// <summary> - /// Gets a Task that returns the result of this Future. - /// </summary> - /// <returns>Task that completes when this future gets done and returns the result.</returns> - new Task<T> ToTask(); - - /// <summary> - /// Listens this instance and invokes callback upon future completion. - /// </summary> - /// <param name="callback">The callback to execute upon future completion.</param> - void Listen(Action<IFuture<T>> callback); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteException.cs deleted file mode 100644 index 98e5389..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteException.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Common -{ - using System; - using System.Runtime.Serialization; - - /// <summary> - /// General Ignite exception. Indicates any error condition within Ignite. - /// </summary> - [Serializable] - public class IgniteException : Exception - { - /// <summary> - /// Initializes a new instance of the <see cref="IgniteException"/> class. - /// </summary> - public IgniteException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="IgniteException" /> class. - /// </summary> - /// <param name="message">The message that describes the error.</param> - public IgniteException(string message) : base(message) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="IgniteException" /> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public IgniteException(string message, Exception cause) : base(message, cause) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="IgniteException"/> class. - /// </summary> - /// <param name="info">Serialization information.</param> - /// <param name="ctx">Streaming context.</param> - protected IgniteException(SerializationInfo info, StreamingContext ctx) : base(info, ctx) - { - // No-op. - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs deleted file mode 100644 index 53c7151..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Common -{ - using System; - using Apache.Ignite.Core.Portable; - - /// <summary> - /// Ignite guid with additional local ID. - /// </summary> - public struct IgniteGuid : IEquatable<IgniteGuid> - { - /** Global id. */ - private readonly Guid _globalId; - - /** Local id. */ - private readonly long _localId; - - /// <summary> - /// Initializes a new instance of the <see cref="IgniteGuid"/> struct. - /// </summary> - /// <param name="globalId">The global id.</param> - /// <param name="localId">The local id.</param> - public IgniteGuid(Guid globalId, long localId) - { - _globalId = globalId; - _localId = localId; - } - - /// <summary> - /// Gets the global id. - /// </summary> - public Guid GlobalId - { - get { return _globalId; } - } - - /// <summary> - /// Gets the local id. - /// </summary> - public long LocalId - { - get { return _localId; } - } - - /** <inheritDoc /> */ - public bool Equals(IgniteGuid other) - { - return _globalId.Equals(other._globalId) && _localId == other._localId; - } - - /** <inheritDoc /> */ - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - return obj is IgniteGuid && Equals((IgniteGuid) obj); - } - - /** <inheritDoc /> */ - public override int GetHashCode() - { - unchecked - { - return (_globalId.GetHashCode() * 397) ^ _localId.GetHashCode(); - } - } - - /** <inheritDoc /> */ - public override string ToString() - { - return string.Format("IgniteGuid [GlobalId={0}, LocalId={1}]", GlobalId, LocalId); - } - - /// <summary> - /// Writes this object to the given writer. - /// </summary> - /// <param name="w">Writer.</param> - public void WritePortable(IPortableRawWriter w) - { - w.WriteGuid(GlobalId); - w.WriteLong(LocalId); - } - - /// <summary> - /// Reads this object from the given reader. - /// </summary> - /// <param name="r">Reader.</param> - public static IgniteGuid ReadPortable(IPortableRawReader r) - { - var guid = r.ReadGuid(); - - return guid == null - ? new IgniteGuid(Guid.Empty, 0) - : new IgniteGuid(guid.Value, r.ReadLong()); - } - - /// <summary> - /// Implements the operator ==. - /// </summary> - /// <param name="a">First item.</param> - /// <param name="b">Second item.</param> - /// <returns> - /// The result of the operator. - /// </returns> - public static bool operator ==(IgniteGuid a, IgniteGuid b) - { - return a.Equals(b); - } - - /// <summary> - /// Implements the operator !=. - /// </summary> - /// <param name="a">First item.</param> - /// <param name="b">Second item.</param> - /// <returns> - /// The result of the operator. - /// </returns> - public static bool operator !=(IgniteGuid a, IgniteGuid b) - { - return !(a == b); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs deleted file mode 100644 index 108d396..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Compute -{ - using System; - using System.Runtime.Serialization; - using Apache.Ignite.Core.Common; - - /// <summary> - /// Indicates a situation when execution service provided by the user in configuration rejects execution. - /// </summary> - [Serializable] - public class ComputeExecutionRejectedException : IgniteException - { - /// <summary> - /// Initializes a new instance of the <see cref="ComputeExecutionRejectedException"/> class. - /// </summary> - public ComputeExecutionRejectedException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeExecutionRejectedException" /> class. - /// </summary> - /// <param name="message">The message that describes the error.</param> - public ComputeExecutionRejectedException(string message) - : base(message) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeExecutionRejectedException"/> class. - /// </summary> - /// <param name="info">Serialization information.</param> - /// <param name="ctx">Streaming context.</param> - protected ComputeExecutionRejectedException(SerializationInfo info, StreamingContext ctx) - : base(info, ctx) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeExecutionRejectedException"/> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public ComputeExecutionRejectedException(string message, Exception cause) : base(message, cause) - { - // No-op. - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs deleted file mode 100644 index 92c6492..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Compute -{ - using System; - - /// <summary> - /// Convenience adapter for <see cref="IComputeJob{T}"/> implementations. It provides the following functionality: - /// <ul> - /// <li> - /// Default implementation of <see cref="IComputeJob{T}.Cancel()"/> method and ability - /// to check whether cancellation occurred with <see cref="ComputeJobAdapter{T}.IsCancelled()"/> method. - /// </li> - /// <li> - /// Ability to set and get job arguments via <see cref="ComputeJobAdapter{T}.SetArguments(object[])"/> - /// and <see cref="ComputeJobAdapter{T}.Argument{T}(int)"/> methods. - /// </li> - /// </ul> - /// </summary> - [Serializable] - public abstract class ComputeJobAdapter<T> : IComputeJob<T> - { - /** Cancelled flag */ - [NonSerialized] - private volatile bool _cancelled; - - /** Arguments. */ - protected object[] Args; - - /// <summary> - /// No-arg constructor. - /// </summary> - protected ComputeJobAdapter() - { - // No-op. - } - - /// <summary> - /// Creates job with specified arguments. - /// </summary> - /// <param name="args">Optional job arguments.</param> - protected ComputeJobAdapter(params object[] args) - { - Args = args; - } - - /// <summary> - /// This method is called when system detects that completion of this - /// job can no longer alter the overall outcome (for example, when parent task - /// has already reduced the results). - /// <para /> - /// Note that job cancellation is only a hint, and it is really up to the actual job - /// instance to gracefully finish execution and exit. - /// </summary> - public void Cancel() - { - _cancelled = true; - } - - /// <summary> - /// Sets given arguments. - /// </summary> - /// <param name="args">Optional job arguments to set.</param> - public void SetArguments(params object[] args) - { - Args = args; - } - - /// <summary> - /// Sets given arguments. - /// </summary> - /// <param name="idx">Index of the argument.</param> - public TArg Argument<TArg>(int idx) - { - if (idx < 0 || idx >= Args.Length) - throw new ArgumentException("Invalid argument index: " + idx); - - return (TArg)Args[idx]; - } - - /// <summary> - /// This method tests whether or not this job was cancelled. This method - /// is thread-safe and can be called without extra synchronization. - /// <p/> - /// This method can be periodically called in <see cref="IComputeJob{T}.Execute()"/> method - /// implementation to check whether or not this job cancelled. Note that system - /// calls <see cref="IComputeJob{T}.Cancel()"/> method only as a hint and this is a responsibility of - /// the implementation of the job to properly cancel its execution. - /// </summary> - /// <returns><c>True</c> if this job was cancelled, <c>false</c> otherwise.</returns> - protected bool IsCancelled() - { - return _cancelled; - } - - /// <summary> - /// Executes this job. - /// </summary> - /// <returns> - /// Job execution result (possibly <c>null</c>). This result will be returned - /// in <see cref="IComputeJobResult{T}" /> object passed into - /// <see cref="IComputeTask{A,T,R}.Result" /> - /// on caller node. - /// </returns> - public abstract T Execute(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/f0bac562/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs b/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs deleted file mode 100644 index 970bd43..0000000 --- a/modules/platform/src/main/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.Ignite.Core.Compute -{ - using System; - using System.Runtime.Serialization; - using Apache.Ignite.Core.Common; - - /// <summary> - /// This runtime exception can be thrown from <see cref="IComputeJob{T}.Execute()"/> - /// method to force job failover to another node within task topology. - /// <see cref="IComputeFunc{T,R}"/> or <see cref="IComputeFunc{T}"/> - /// passed into any of the <see cref="ICompute"/> methods can also throw this exception - /// to force failover. - /// </summary> - [Serializable] - public class ComputeJobFailoverException : IgniteException - { - /// <summary> - /// Initializes a new instance of the <see cref="ComputeJobFailoverException"/> class. - /// </summary> - public ComputeJobFailoverException() - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeJobFailoverException" /> class. - /// </summary> - /// <param name="message">The message that describes the error.</param> - public ComputeJobFailoverException(string message) : base(message) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeJobFailoverException"/> class. - /// </summary> - /// <param name="info">Serialization information.</param> - /// <param name="ctx">Streaming context.</param> - protected ComputeJobFailoverException(SerializationInfo info, StreamingContext ctx) - : base(info, ctx) - { - // No-op. - } - - /// <summary> - /// Initializes a new instance of the <see cref="ComputeJobFailoverException"/> class. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="cause">The cause.</param> - public ComputeJobFailoverException(string message, Exception cause) : base(message, cause) - { - // No-op. - } - } -}
