You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/09/22 09:40:39 UTC
[20/51] [abbrv] [partial] ignite git commit: IGNITE-1513: platform ->
platforms.
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs b/modules/platform/dotnet/Apache.Ignite.Core/Common/AsyncSupportedAttribute.cs
deleted file mode 100644
index 094a93c..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs b/modules/platform/dotnet/Apache.Ignite.Core/Common/IAsyncSupport.cs
deleted file mode 100644
index ee98c5a..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Common/IFuture.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Common/IFuture.cs b/modules/platform/dotnet/Apache.Ignite.Core/Common/IFuture.cs
deleted file mode 100644
index 2e94cd4..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteException.cs
deleted file mode 100644
index 98e5389..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs b/modules/platform/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs
deleted file mode 100644
index 53c7151..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeExecutionRejectedException.cs
deleted file mode 100644
index 108d396..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobAdapter.cs
deleted file mode 100644
index 92c6492..0000000
--- a/modules/platform/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/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobFailoverException.cs
deleted file mode 100644
index 970bd43..0000000
--- a/modules/platform/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.
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobResultPolicy.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobResultPolicy.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobResultPolicy.cs
deleted file mode 100644
index 6fa0808..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeJobResultPolicy.cs
+++ /dev/null
@@ -1,45 +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.Collections.Generic;
-
- /// <summary>
- /// This enumeration provides different types of actions following the last received job result. See
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// for more details.
- /// </summary>
- public enum ComputeJobResultPolicy
- {
- /// <summary>
- /// Wait for results if any are still expected. If all results have been received -
- /// it will start reducing results.
- /// </summary>
- Wait = 0,
-
- /// <summary>
- /// Ignore all not yet received results and start reducing results.
- /// </summary>
- Reduce = 1,
-
- /// <summary>
- /// Fail-over job to execute on another node.
- /// </summary>
- Failover = 2
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs
deleted file mode 100644
index 67f7432..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs
+++ /dev/null
@@ -1,93 +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.Collections.Generic;
- using Apache.Ignite.Core.Cluster;
- using Apache.Ignite.Core.Common;
-
- /// <summary>
- /// Convenience adapter for <see cref="IComputeTask{A,T,R}"/> interface
- /// </summary>
- public abstract class ComputeTaskAdapter<TA, T, TR> : IComputeTask<TA, T, TR>
- {
- /// <summary>
- /// Default implementation which will wait for all jobs to complete before
- /// calling <see cref="IComputeTask{A,T,R}.Reduce"/> method.
- /// <p/>
- /// If remote job resulted in exception <see cref="IComputeJobResult{T}.Exception()"/>
- /// is not <c>null</c>),
- /// then <see cref="ComputeJobResultPolicy.Failover"/> policy will be returned if
- /// the exception is instance of <see cref="ClusterTopologyException"/>
- /// or <see cref="ComputeExecutionRejectedException"/>, which means that
- /// remote node either failed or job execution was rejected before it got a chance to start. In all
- /// other cases the exception will be rethrown which will ultimately cause task to fail.
- /// </summary>
- /// <param name="res">Received remote Ignite executable result.</param>
- /// <param name="rcvd">All previously received results.</param>
- /// <returns>Result policy that dictates how to process further upcoming job results.</returns>
- public virtual ComputeJobResultPolicy Result(IComputeJobResult<T> res, IList<IComputeJobResult<T>> rcvd)
- {
- Exception err = res.Exception();
-
- if (err != null)
- {
- if (err is ComputeExecutionRejectedException || err is ClusterTopologyException ||
- err is ComputeJobFailoverException)
- return ComputeJobResultPolicy.Failover;
-
- throw new IgniteException("Remote job threw user exception (override or implement IComputeTask.result(..) " +
- "method if you would like to have automatic failover for this exception).", err);
- }
-
- return ComputeJobResultPolicy.Wait;
- }
-
- /// <summary>
- /// This method is called to map or split Ignite task into multiple Ignite jobs. This is the
- /// first method that gets called when task execution starts.
- /// </summary>
- /// <param name="subgrid">Nodes available for this task execution. Note that order of nodes is
- /// guaranteed to be randomized by container. This ensures that every time you simply iterate
- /// through Ignite nodes, the order of nodes will be random which over time should result into
- /// all nodes being used equally.</param>
- /// <param name="arg">Task execution argument. Can be <c>null</c>. This is the same argument
- /// as the one passed into <c>ICompute.Execute()</c> methods.</param>
- /// <returns>
- /// Map of Ignite jobs assigned to subgrid node. If <c>null</c> or empty map is returned,
- /// exception will be thrown.
- /// </returns>
- public abstract IDictionary<IComputeJob<T>, IClusterNode> Map(IList<IClusterNode> subgrid, TA arg);
-
- /// <summary>
- /// Reduces (or aggregates) results received so far into one compound result to be returned to
- /// caller via future.
- /// <para />
- /// Note, that if some jobs did not succeed and could not be failed over then the list of
- /// results passed into this method will include the failed results. Otherwise, failed
- /// results will not be in the list.
- /// </summary>
- /// <param name="results">Received job results. Note that if task class has
- /// <see cref="ComputeTaskNoResultCacheAttribute" /> attribute, then this list will be empty.</param>
- /// <returns>
- /// Task result constructed from results of remote executions.
- /// </returns>
- public abstract TR Reduce(IList<IComputeJobResult<T>> results);
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskCancelledException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskCancelledException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskCancelledException.cs
deleted file mode 100644
index 460e9b0..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskCancelledException.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>
- /// This exception indicates that Ignite task was cancelled.
- /// </summary>
- [Serializable]
- public class ComputeTaskCancelledException : IgniteException
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskCancelledException"/> class.
- /// </summary>
- public ComputeTaskCancelledException()
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskCancelledException"/> class.
- /// </summary>
- /// <param name="message">The message that describes the error.</param>
- public ComputeTaskCancelledException(string message)
- : base(message)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskCancelledException"/> class.
- /// </summary>
- /// <param name="info">Serialization information.</param>
- /// <param name="ctx">Streaming context.</param>
- protected ComputeTaskCancelledException(SerializationInfo info, StreamingContext ctx)
- : base(info, ctx)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskCancelledException"/> class.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="cause">The cause.</param>
- public ComputeTaskCancelledException(string message, Exception cause) : base(message, cause)
- {
- // No-op.
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskNoResultCacheAttribute.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskNoResultCacheAttribute.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskNoResultCacheAttribute.cs
deleted file mode 100644
index a58aa87..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskNoResultCacheAttribute.cs
+++ /dev/null
@@ -1,35 +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>
- /// This attribute disables caching of task results when attached to <see cref="IComputeTask{A,T,R}"/>
- /// instance. Use it when number of jobs within task grows too big, or jobs themselves are too large
- /// to keep in memory throughout task execution. By default all results are cached and passed into
- /// <see cref="IComputeTask{A,T,R}.Result"/>
- /// and <see cref="IComputeTask{A,T,R}.Reduce"/> methods. When this
- /// attribute is attached to a task class, then this list of job results will always be empty.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
- public sealed class ComputeTaskNoResultCacheAttribute : Attribute
- {
- // No-op.
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs
deleted file mode 100644
index bf4685a..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs
+++ /dev/null
@@ -1,95 +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.Collections.Generic;
- using System.Diagnostics;
- using Apache.Ignite.Core.Cluster;
- using Apache.Ignite.Core.Common;
- using Apache.Ignite.Core.Impl.Compute;
-
- /// <summary>
- /// This class defines simplified adapter for <see cref="IComputeTask{A,T,R}"/>. This adapter can be used
- /// when jobs can be randomly assigned to available Ignite nodes. This adapter is sufficient
- /// in most homogeneous environments where all nodes are equally suitable for executing grid
- /// job, see <see cref="Split"/> method for more details.
- /// </summary>
- public abstract class ComputeTaskSplitAdapter<TA, T, TR> : ComputeTaskAdapter<TA, T, TR>
- {
- /** Random generator */
- [ThreadStatic]
- // ReSharper disable once StaticMemberInGenericType
- private static Random _rnd;
-
- /// <summary>
- /// This is a simplified version of <see cref="IComputeTask{A,T,R}.Map"/> method.
- /// <p/>
- /// This method basically takes given argument and splits it into a collection
- /// of <see cref="IComputeJob"/> using provided grid size as indication of how many node are
- /// available. These jobs will be randomly mapped to available Ignite nodes. Note that
- /// if number of jobs is greater than number of Ignite nodes (i.e, grid size), the grid
- /// nodes will be reused and some jobs will end up on the same Ignite nodes.
- /// </summary>
- /// <param name="gridSize">Number of available Ignite nodes. Note that returned number of jobs can be less,
- /// equal or greater than this grid size.</param>
- /// <param name="arg">Task execution argument. Can be <c>null</c>.</param>
- protected abstract ICollection<IComputeJob<T>> Split(int gridSize, TA arg);
-
- /// <summary>
- /// This method is called to map or split Ignite task into multiple Ignite jobs. This is the
- /// first method that gets called when task execution starts.
- /// </summary>
- /// <param name="subgrid">Nodes available for this task execution. Note that order of nodes is
- /// guaranteed to be randomized by container. This ensures that every time you simply iterate
- /// through Ignite nodes, the order of nodes will be random which over time should result into
- /// all nodes being used equally.</param>
- /// <param name="arg">Task execution argument. Can be <c>null</c>. This is the same argument
- /// as the one passed into <c>ICompute.Execute()</c> methods.</param>
- /// <returns>
- /// Map of Ignite jobs assigned to subgrid node. If <c>null</c> or empty map is returned,
- /// exception will be thrown.
- /// </returns>
- /// <exception cref="IgniteException">Split returned no jobs.</exception>
- override public IDictionary<IComputeJob<T>, IClusterNode> Map(IList<IClusterNode> subgrid, TA arg)
- {
- Debug.Assert(subgrid != null && subgrid.Count > 0);
-
- var jobs = Split(subgrid.Count, arg);
-
- if (jobs == null || jobs.Count == 0)
- throw new IgniteException("Split returned no jobs.");
-
- var map = new Dictionary<IComputeJob<T>, IClusterNode>(jobs.Count);
-
- if (_rnd == null)
- _rnd = new Random();
-
- foreach (var job in jobs)
- {
- int idx = _rnd.Next(subgrid.Count);
-
- IClusterNode node = subgrid[idx];
-
- map[job] = node;
- }
-
- return map;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskTimeoutException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskTimeoutException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskTimeoutException.cs
deleted file mode 100644
index 71fc568..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeTaskTimeoutException.cs
+++ /dev/null
@@ -1,67 +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 that task execution timed out.
- /// </summary>
- [Serializable]
- public class ComputeTaskTimeoutException : IgniteException
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskTimeoutException"/> class.
- /// </summary>
- public ComputeTaskTimeoutException()
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskTimeoutException"/> class.
- /// </summary>
- /// <param name="message">The message that describes the error.</param>
- public ComputeTaskTimeoutException(string message) : base(message)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskTimeoutException"/> class.
- /// </summary>
- /// <param name="info">Serialization information.</param>
- /// <param name="ctx">Streaming context.</param>
- protected ComputeTaskTimeoutException(SerializationInfo info, StreamingContext ctx) : base(info, ctx)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeTaskTimeoutException"/> class.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="cause">The cause.</param>
- public ComputeTaskTimeoutException(string message, Exception cause) : base(message, cause)
- {
- // No-op.
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeUserUndeclaredException.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeUserUndeclaredException.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeUserUndeclaredException.cs
deleted file mode 100644
index e3c090e..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ComputeUserUndeclaredException.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.Compute
-{
- using System;
- using System.Runtime.Serialization;
- using Apache.Ignite.Core.Common;
-
- /// <summary>
- /// This exception is thrown when user's code throws undeclared runtime exception. By user core it is
- /// assumed the code in Ignite task, Ignite job or SPI. In most cases it should be an indication of unrecoverable
- /// error condition such as assertion, out of memory error, etc.
- /// </summary>
- [Serializable]
- public class ComputeUserUndeclaredException : IgniteException
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeUserUndeclaredException"/> class.
- /// </summary>
- public ComputeUserUndeclaredException()
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeUserUndeclaredException"/> class.
- /// </summary>
- /// <param name="message">The message that describes the error.</param>
- public ComputeUserUndeclaredException(string message) : base(message)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeUserUndeclaredException"/> class.
- /// </summary>
- /// <param name="info">Serialization information.</param>
- /// <param name="ctx">Streaming context.</param>
- protected ComputeUserUndeclaredException(SerializationInfo info, StreamingContext ctx)
- : base(info, ctx)
- {
- // No-op.
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ComputeUserUndeclaredException"/> class.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="cause">The cause.</param>
- public ComputeUserUndeclaredException(string message, Exception cause) : base(message, cause)
- {
- // No-op.
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ICompute.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
deleted file mode 100644
index c124f84..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/ICompute.cs
+++ /dev/null
@@ -1,271 +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.Collections.Generic;
- using Apache.Ignite.Core.Cluster;
- using Apache.Ignite.Core.Common;
-
- /// <summary>
- /// Defines Ignite functionality for executing tasks and closures over nodes
- /// in the <see cref="IClusterGroup"/>. Instance of <see cref="ICompute"/>
- /// is obtained from grid projection using <see cref="IClusterGroup.GetCompute"/> method.
- /// <para />
- /// Note that if attempt is made to execute a computation over an empty projection (i.e. projection that does
- /// not have any alive nodes), <c>ClusterGroupEmptyException</c> will be thrown out of result future.
- /// <para />
- /// Ignite must select a node for a computation to be executed. The node will be selected based on the
- /// underlying <c>GridLoadBalancingSpi</c>, which by default sequentially picks next available node from
- /// grid projection. Other load balancing policies, such as <c>random</c> or <c>adaptive</c>, can be
- /// configured as well by selecting different load balancing SPI in Ignite configuration. If your logic requires
- /// some custom load balancing behavior, consider implementing <c>ComputeTask</c> in Java directly.
- /// <para />
- /// Ignite guarantees that as long as there is at least one Ignite node standing, every job will be
- /// executed. Jobs will automatically failover to another node if a remote node crashed or has rejected
- /// execution due to lack of resources. By default, in case of failover, next load balanced node will be
- /// picked for job execution. Also jobs will never be re-routed to the nodes they have failed on. This
- /// behavior can be changed by configuring any of the existing or a custom <c>FailoverSpi</c> in Ignite
- /// configuration.
- /// <para/>
- /// All members are thread-safe and may be used concurrently from multiple threads.
- /// </summary>
- public interface ICompute : IAsyncSupport<ICompute>
- {
- /// <summary>
- /// Grid projection to which this compute instance belongs.
- /// </summary>
- IClusterGroup ClusterGroup { get; }
-
- /// <summary>
- /// Sets no-failover flag for the next executed task on this projection in the current thread.
- /// If flag is set, job will be never failed over even if remote node crashes or rejects execution.
- /// When task starts execution, the no-failover flag is reset, so all other task will use default
- /// failover policy, unless this flag is set again.
- /// </summary>
- /// <returns>This compute instance for chaining calls.</returns>
- ICompute WithNoFailover();
-
- /// <summary>
- /// Sets task timeout for the next executed task on this projection in the current thread.
- /// When task starts execution, the timeout is reset, so one timeout is used only once.
- /// </summary>
- /// <param name="timeout">Computation timeout in milliseconds.</param>
- /// <returns>This compute instance for chaining calls.</returns>
- ICompute WithTimeout(long timeout);
-
- /// <summary>
- /// Sets keep-portable flag for the next executed Java task on this projection in the current
- /// thread so that task argument passed to Java and returned task results will not be
- /// deserialized.
- /// </summary>
- /// <returns>This compute instance for chaining calls.</returns>
- ICompute WithKeepPortable();
-
- /// <summary>
- /// Executes given Java task on the grid projection. If task for given name has not been deployed yet,
- /// then 'taskName' will be used as task class name to auto-deploy the task.
- /// </summary>
- /// <param name="taskName">Java task name</param>
- /// <param name="taskArg">Optional argument of task execution, can be null.</param>
- /// <returns>Task result.</returns>
- /// <typeparam name="T">Type of task result.</typeparam>
- T ExecuteJavaTask<T>(string taskName, object taskArg);
-
- /// <summary>
- /// Executes given task on the grid projection. For step-by-step explanation of task execution process
- /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
- /// </summary>
- /// <param name="task">Task to execute.</param>
- /// <param name="taskArg">Optional task argument.</param>
- /// <returns>Task result.</returns>
- /// <typeparam name="TA">Argument type.</typeparam>
- /// <typeparam name="T">Type of job result.</typeparam>
- /// <typeparam name="TR">Type of reduce result.</typeparam>
- [AsyncSupported]
- TR Execute<TA, T, TR>(IComputeTask<TA, T, TR> task, TA taskArg);
-
- /// <summary>
- /// Executes given task on the grid projection. For step-by-step explanation of task execution process
- /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
- /// </summary>
- /// <param name="task">Task to execute.</param>
- /// <returns>Task result.</returns>
- /// <typeparam name="T">Type of job result.</typeparam>
- /// <typeparam name="TR">Type of reduce result.</typeparam>
- [AsyncSupported]
- TR Execute<T, TR>(IComputeTask<T, TR> task);
-
- /// <summary>
- /// Executes given task on the grid projection. For step-by-step explanation of task execution process
- /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
- /// </summary>
- /// <param name="taskType">Task type.</param>
- /// <param name="taskArg">Optional task argument.</param>
- /// <returns>Task result.</returns>
- /// <typeparam name="TA">Argument type.</typeparam>
- /// <typeparam name="T">Type of job result.</typeparam>
- /// <typeparam name="TR">Type of reduce result.</typeparam>
- [AsyncSupported]
- TR Execute<TA, T, TR>(Type taskType, TA taskArg);
-
- /// <summary>
- /// Executes given task on the grid projection. For step-by-step explanation of task execution process
- /// refer to <see cref="IComputeTask{A,T,R}"/> documentation.
- /// </summary>
- /// <param name="taskType">Task type.</param>
- /// <returns>Task result.</returns>
- /// <typeparam name="T">Type of job result.</typeparam>
- /// <typeparam name="TR">Type of reduce result.</typeparam>
- [AsyncSupported]
- TR Execute<T, TR>(Type taskType);
-
- /// <summary>
- /// Executes provided job on a node in this grid projection. The result of the
- /// job execution is returned from the result closure.
- /// </summary>
- /// <param name="clo">Job to execute.</param>
- /// <returns>Job result for this execution.</returns>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- TR Call<TR>(IComputeFunc<TR> clo);
-
- /// <summary>
- /// Executes given job on the node where data for provided affinity key is located
- /// (a.k.a. affinity co-location).
- /// </summary>
- /// <param name="cacheName">Name of the cache to use for affinity co-location.</param>
- /// <param name="affinityKey">Affinity key.</param>
- /// <param name="clo">Job to execute.</param>
- /// <returns>Job result for this execution.</returns>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- TR AffinityCall<TR>(string cacheName, object affinityKey, IComputeFunc<TR> clo);
-
- /// <summary>
- /// Executes collection of jobs on nodes within this grid projection.
- /// </summary>
- /// <param name="clos">Collection of jobs to execute.</param>
- /// <param name="rdc">Reducer to reduce all job results into one individual return value.</param>
- /// <returns>Reduced job result for this execution.</returns>
- /// <typeparam name="TR1">Type of job result.</typeparam>
- /// <typeparam name="TR2">Type of reduced result.</typeparam>
- [AsyncSupported]
- TR2 Call<TR1, TR2>(IEnumerable<IComputeFunc<TR1>> clos, IComputeReducer<TR1, TR2> rdc);
-
- /// <summary>
- /// Executes collection of jobs on nodes within this grid projection.
- /// </summary>
- /// <param name="clos">Collection of jobs to execute.</param>
- /// <returns>Collection of job results for this execution.</returns>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- ICollection<TR> Call<TR>(IEnumerable<IComputeFunc<TR>> clos);
-
- /// <summary>
- /// Broadcasts given job to all nodes in grid projection. Every participating node will return a job result.
- /// </summary>
- /// <param name="clo">Job to broadcast to all projection nodes.</param>
- /// <returns>Collection of results for this execution.</returns>
- [AsyncSupported]
- ICollection<TR> Broadcast<TR>(IComputeFunc<TR> clo);
-
- /// <summary>
- /// Broadcasts given closure job with passed in argument to all nodes in grid projection.
- /// Every participating node will return a job result.
- /// </summary>
- /// <param name="clo">Job to broadcast to all projection nodes.</param>
- /// <param name="arg">Job closure argument.</param>
- /// <returns>Collection of results for this execution.</returns>
- /// <typeparam name="T">Type of argument.</typeparam>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- ICollection<TR> Broadcast<T, TR>(IComputeFunc<T, TR> clo, T arg);
-
- /// <summary>
- /// Broadcasts given job to all nodes in grid projection.
- /// </summary>
- /// <param name="action">Job to broadcast to all projection nodes.</param>
- [AsyncSupported]
- void Broadcast(IComputeAction action);
-
- /// <summary>
- /// Executes provided job on a node in this grid projection.
- /// </summary>
- /// <param name="action">Job to execute.</param>
- [AsyncSupported]
- void Run(IComputeAction action);
-
- /// <summary>
- /// Executes given job on the node where data for provided affinity key is located
- /// (a.k.a. affinity co-location).
- /// </summary>
- /// <param name="cacheName">Name of the cache to use for affinity co-location.</param>
- /// <param name="affinityKey">Affinity key.</param>
- /// <param name="action">Job to execute.</param>
- [AsyncSupported]
- void AffinityRun(string cacheName, object affinityKey, IComputeAction action);
-
- /// <summary>
- /// Executes collection of jobs on Ignite nodes within this grid projection.
- /// </summary>
- /// <param name="actions">Jobs to execute.</param>
- [AsyncSupported]
- void Run(IEnumerable<IComputeAction> actions);
-
- /// <summary>
- /// Executes provided closure job on a node in this grid projection.
- /// </summary>
- /// <param name="clo">Job to run.</param>
- /// <param name="arg">Job argument.</param>
- /// <returns>Job result for this execution.</returns>
- /// <typeparam name="T">Type of argument.</typeparam>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- TR Apply<T, TR>(IComputeFunc<T, TR> clo, T arg);
-
- /// <summary>
- /// Executes provided closure job on nodes within this grid projection. A new job is executed for
- /// every argument in the passed in collection. The number of actual job executions will be
- /// equal to size of the job arguments collection.
- /// </summary>
- /// <param name="clo">Job to run.</param>
- /// <param name="args">Job arguments.</param>
- /// <returns>Сollection of job results.</returns>
- /// <typeparam name="T">Type of argument.</typeparam>
- /// <typeparam name="TR">Type of job result.</typeparam>
- [AsyncSupported]
- ICollection<TR> Apply<T, TR>(IComputeFunc<T, TR> clo, IEnumerable<T> args);
-
- /// <summary>
- /// Executes provided closure job on nodes within this grid projection. A new job is executed for
- /// every argument in the passed in collection. The number of actual job executions will be
- /// equal to size of the job arguments collection. The returned job results will be reduced
- /// into an individual result by provided reducer.
- /// </summary>
- /// <param name="clo">Job to run.</param>
- /// <param name="args">Job arguments.</param>
- /// <param name="rdc">Reducer to reduce all job results into one individual return value.</param>
- /// <returns>Reduced job result for this execution.</returns>
- /// <typeparam name="T">Type of argument.</typeparam>
- /// <typeparam name="TR1">Type of job result.</typeparam>
- /// <typeparam name="TR2">Type of reduced result.</typeparam>
- [AsyncSupported]
- TR2 Apply<T, TR1, TR2>(IComputeFunc<T, TR1> clo, IEnumerable<T> args, IComputeReducer<TR1, TR2> rdc);
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeFunc.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeFunc.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeFunc.cs
deleted file mode 100644
index 4a43f11..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeFunc.cs
+++ /dev/null
@@ -1,55 +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
-{
- /// <summary>
- /// Defines function having a single argument.
- /// </summary>
- public interface IComputeFunc<in T, out TR>
- {
- /// <summary>
- /// Invoke function.
- /// </summary>
- /// <param name="arg">Argument.</param>
- /// <returns>Result.</returns>
- TR Invoke(T arg);
- }
-
- /// <summary>
- /// Defines function having no arguments.
- /// </summary>
- public interface IComputeFunc<out T>
- {
- /// <summary>
- /// Invoke function.
- /// </summary>
- /// <returns>Result.</returns>
- T Invoke();
- }
-
- /// <summary>
- /// Defines a void function having no arguments.
- /// </summary>
- public interface IComputeAction
- {
- /// <summary>
- /// Invokes action.
- /// </summary>
- void Invoke();
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs
deleted file mode 100644
index 3b8ac60..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJob.cs
+++ /dev/null
@@ -1,58 +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.Collections.Generic;
- using Apache.Ignite.Core.Resource;
-
- /// <summary>
- /// Defines executable unit for <see cref="IComputeTask{A,T,R}"/>. Ignite task gets split into jobs
- /// when <see cref="IComputeTask{A,T,R}.Map(IList{IClusterNode}, A)"/> method is called. This
- /// method returns all jobs for the task mapped to their corresponding Ignite nodes for execution.
- /// Grid will then serialize this jobs and send them to requested nodes for execution.
- /// <para />
- /// Once job execution is complete, the return value will be sent back to parent task and will
- /// be passed into
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// method via <see cref="IComputeJobResult{T}"/> instance.
- /// <para />
- /// Ignite job implementation can be injected with <see cref="IIgnite"/> using
- /// <see cref="InstanceResourceAttribute"/> attribute.
- /// </summary>
- public interface IComputeJob<out T>
- {
- /// <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(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// on caller node.</returns>
- T Execute();
-
- /// <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>
- void Cancel();
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJobResult.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJobResult.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJobResult.cs
deleted file mode 100644
index 5891fd7..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeJobResult.cs
+++ /dev/null
@@ -1,73 +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.Collections.Generic;
-
- /// <summary>
- /// Job execution result which gets passed to
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// method.
- /// </summary>
- public interface IComputeJobResult<out T>
- {
- /// <summary>
- /// Gets data returned by remote job if it didn't fail. This data is the
- /// object returned from <see cref="IComputeJob{T}.Execute()"/> method.
- /// <para />
- /// Note that if task is annotated with <see cref="ComputeTaskNoResultCacheAttribute"/>
- /// attribute, then job results will not be cached and will be available only in
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// method for every individual job, but not in
- /// <see cref="IComputeTask{A,T,R}.Reduce(IList{IComputeJobResult{T}})"/> method.
- ///
- /// </summary>
- /// <returns>Data returned by job.</returns>
- T Data();
-
- /// <summary>
- /// Gets local instance of remote job produced this result.
- /// </summary>
- /// <returns></returns>
- IComputeJob<T> Job();
-
- /// <summary>
- /// Gets exception produced by execution of remote job, or <c>null</c> if no
- /// exception was produced.
- /// </summary>
- /// <returns>Exception or <c>null</c> in case of success.</returns>
- Exception Exception();
-
- /// <summary>
- /// ID of the node where actual job execution occurred.
- /// </summary>
- Guid NodeId
- {
- get;
- }
-
- /// <summary>
- /// Whether the job was cancelled.
- /// </summary>
- bool Cancelled
- {
- get;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeReducer.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeReducer.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeReducer.cs
deleted file mode 100644
index 46dcbd9..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeReducer.cs
+++ /dev/null
@@ -1,39 +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
-{
- /// <summary>
- /// Compute reducer which is capable of result collecting and reducing.
- /// </summary>
- public interface IComputeReducer<in TR1, out TR2>
- {
- /// <summary>
- /// Collect closure execution result.
- /// </summary>
- /// <param name="res">Result.</param>
- /// <returns><c>True</c> to continue collecting results until all closures are finished,
- /// <c>false</c> to start reducing.</returns>
- bool Collect(TR1 res);
-
- /// <summary>
- /// Reduce closure execution results collected earlier.
- /// </summary>
- /// <returns>Reduce result.</returns>
- TR2 Reduce();
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bcefaa24/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs b/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
deleted file mode 100644
index 21b6c48..0000000
--- a/modules/platform/dotnet/Apache.Ignite.Core/Compute/IComputeTask.cs
+++ /dev/null
@@ -1,132 +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.Collections.Generic;
- using System.Diagnostics.CodeAnalysis;
- using Apache.Ignite.Core.Cluster;
-
- /// <summary>
- /// Ignite task interface defines a task that can be executed on the grid. Ignite task
- /// is responsible for splitting business logic into multiple Ignite jobs, receiving
- /// results from individual Ignite jobs executing on remote nodes, and reducing
- /// (aggregating) received jobs' results into final Ignite task result.
- /// <para />
- /// Upon request to execute a task, the system will do the following:
- /// <list type="bullet">
- /// <item>
- /// <description>Inject annotated resources into task instance.</description>
- /// </item>
- /// <item>
- /// <description>Apply <see cref="IComputeTask{A,T,R}.Map(IList{IClusterNode}, TA)"/>.
- /// This method is responsible for splitting business logic into multiple jobs
- /// (units of execution) and mapping them to Ignite nodes.</description>
- /// </item>
- /// <item>
- /// <description>System will send mapped Ignite jobs to their respective nodes.</description>
- /// </item>
- /// <item>
- /// <description>Once job execution results become available method
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// will be called for ech received job result. The policy returned by this method will
- /// determine the way task reacts to every job result.
- /// <para />
- /// If <see cref="ComputeJobResultPolicy.Wait"/> is returned, task will continue to wait
- /// for other job results. If this result is the last job result, then reduce phase will be
- /// started.
- /// <para />
- /// If <see cref="ComputeJobResultPolicy.Reduce"/> is returned, reduce phase will be started
- /// right away without waiting for other jobs completion (all remaining jobs will receive cancel
- /// request).
- /// <para />
- /// If <see cref="ComputeJobResultPolicy.Failover"/> is returned, job will be failed over to
- /// another node for execution. Note that if you use <see cref="ComputeTaskAdapter{A,T,R}"/>, it will
- /// automatically fail jobs to another node for 2 well-known failure cases: 1) job has failed to due
- /// to node crash (in this case <see cref="IComputeJobResult{T}.Exception()"/> will return
- /// <see cref="ClusterTopologyException"/>); 2) job execution was rejected, i.e. remote node
- /// has cancelled job before it got a chance to execute, while it still was on the waiting list.
- /// (in this case <see cref="IComputeJobResult{T}.Exception()"/> will return
- /// <see cref="ComputeExecutionRejectedException"/>).
- /// </description>
- /// </item>
- /// <item>
- /// <description>Once all results are received or
- /// <see cref="IComputeTask{A,T,R}.Result(IComputeJobResult{T}, IList{IComputeJobResult{T}})"/>
- /// method returned <see cref="ComputeJobResultPolicy.Reduce"/> policy, method
- /// <see cref="IComputeTask{A,T,R}.Reduce(IList{IComputeJobResult{T}})"/>
- /// is called to aggregate received results into one final result. Once this method is finished the
- /// execution of the Ignite task is complete. This result will be returned to the user through future.
- /// </description>
- /// </item>
- /// </list>
- /// </summary>
- /// <typeparam name="TA">Argument type.</typeparam>
- /// <typeparam name="T">Type of job result.</typeparam>
- /// <typeparam name="TR">Type of reduce result.</typeparam>
- public interface IComputeTask<in TA, T, out TR>
- {
- /// <summary>
- /// This method is called to map or split Ignite task into multiple Ignite jobs. This is the
- /// first method that gets called when task execution starts.
- /// </summary>
- /// <param name="subgrid">Nodes available for this task execution. Note that order of nodes is
- /// guaranteed to be randomized by container. This ensures that every time you simply iterate
- /// through Ignite nodes, the order of nodes will be random which over time should result into
- /// all nodes being used equally.</param>
- /// <param name="arg">Task execution argument. Can be <c>null</c>. This is the same argument
- /// as the one passed into <c>ICompute.Execute()</c> methods.</param>
- /// <returns>Map of Ignite jobs assigned to subgrid node. If <c>null</c> or empty map is returned,
- /// exception will be thrown.</returns>
- IDictionary<IComputeJob<T>, IClusterNode> Map(IList<IClusterNode> subgrid, TA arg);
-
- /// <summary>
- /// Asynchronous callback invoked every time a result from remote execution is
- /// received. It is ultimately upto this method to return a policy based
- /// on which the system will either wait for more results, reduce results
- /// received so far, or failover this job to another node. See
- /// <see cref="ComputeJobResultPolicy"/> for more information.
- /// </summary>
- /// <param name="res">Received remote Ignite executable result.</param>
- /// <param name="rcvd">All previously received results. Note that if task class has
- /// <see cref="ComputeTaskNoResultCacheAttribute"/> attribute, then this list will be empty.</param>
- /// <returns>Result policy that dictates how to process further upcoming job results.</returns>
- ComputeJobResultPolicy Result(IComputeJobResult<T> res, IList<IComputeJobResult<T>> rcvd);
-
- /// <summary>
- /// Reduces (or aggregates) results received so far into one compound result to be returned to
- /// caller via future.
- /// <para />
- /// Note, that if some jobs did not succeed and could not be failed over then the list of
- /// results passed into this method will include the failed results. Otherwise, failed
- /// results will not be in the list.
- /// </summary>
- /// <param name="results">Received job results. Note that if task class has
- /// <see cref="ComputeTaskNoResultCacheAttribute"/> attribute, then this list will be empty.</param>
- /// <returns>Task result constructed from results of remote executions.</returns>
- TR Reduce(IList<IComputeJobResult<T>> results);
- }
-
- /// <summary>
- /// IComputeTask without an argument.
- /// </summary>
- [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")]
- public interface IComputeTask<T, out TR> : IComputeTask<object, T, TR>
- {
- // No-op.
- }
-}