/// <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> public Future <object> AffinityRun(string cacheName, object affinityKey, IComputeAction action) { IgniteArgumentCheck.NotNull(cacheName, "cacheName"); IgniteArgumentCheck.NotNull(action, "action"); return(DoAffinityOp <object>(cacheName, null, affinityKey, action, OpAffinityRun)); }
/// <summary> /// Broadcasts given job to all nodes in grid projection. /// </summary> /// <param name="action">Job to broadcast to all projection nodes.</param> public IFuture <object> Broadcast(IComputeAction action) { IgniteArgumentCheck.NotNull(action, "action"); return(ExecuteClosures0(new ComputeSingleClosureTask <object, object, object>(), new ComputeActionJob(action), opId: OpBroadcast)); }
/// <summary> /// Executes provided job on a node in this grid projection. /// </summary> /// <param name="action">Job to execute.</param> public Future <object> Run(IComputeAction action) { IgniteArgumentCheck.NotNull(action, "action"); return(ExecuteClosures0(new ComputeSingleClosureTask <object, object, object>(), new ComputeActionJob(action))); }
/** <inheritDoc /> */ public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action, CancellationToken cancellationToken) { IgniteArgumentCheck.NotNull(cacheName, "cacheName"); return(GetTaskIfAlreadyCancelled <object>(cancellationToken) ?? _compute.AffinityRun(cacheName, affinityKey, action).GetTask(cancellationToken)); }
/// <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> public Future <object> AffinityRun(string cacheName, object affinityKey, IComputeAction action) { IgniteArgumentCheck.NotNull(action, "action"); return(ExecuteClosures0(new ComputeSingleClosureTask <object, object, object>(), new ComputeActionJob(action), opId: OpAffinity, writeAction: w => WriteAffinity(w, cacheName, affinityKey))); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IBinaryRawReader reader) { _action = reader.ReadObject <IComputeAction>(); }
/// <summary> /// Constructor. /// </summary> /// <param name="action">Action.</param> public ComputeActionJob(IComputeAction action) { _action = action; }
/** <inheritDoc /> */ public void Run(IComputeAction action) { _curFut.Value = Compute.Run(action); }
/** <inheritDoc /> */ public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action) { IgniteArgumentCheck.NotNull(cacheName, "cacheName"); return(_compute.AffinityRun(cacheName, affinityKey, action).Task); }
/** <inheritDoc /> */ public Task RunAsync(IComputeAction action, CancellationToken cancellationToken) { return(GetTaskIfAlreadyCancelled <object>(cancellationToken) ?? _compute.Run(action).GetTask(cancellationToken)); }
/** <inheritDoc /> */ public void Run(IComputeAction action) { _compute.Run(action).Get(); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IBinaryRawReader reader) { _action = reader.ReadObject<IComputeAction>(); }
/** <inheritDoc /> */ public void AffinityRun(string cacheName, object affinityKey, IComputeAction action) { _compute.AffinityRun(cacheName, affinityKey, action).Get(); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IBinaryReader reader) { var reader0 = (BinaryReader)reader.GetRawReader(); _action = reader0.ReadObject<IComputeAction>(); }
/** <inheritDoc /> */ public Task AffinityRunAsync(IEnumerable <string> cacheNames, int partition, IComputeAction action, CancellationToken cancellationToken) { return(_compute.AffinityRun(cacheNames, partition, action).GetTask(cancellationToken)); }
/** <inheritDoc /> */ public Task AffinityRunAsync(IEnumerable <string> cacheNames, int partition, IComputeAction action) { return(_compute.AffinityRun(cacheNames, partition, action).Task); }
/** <inheritDoc /> */ public void AffinityRun(IEnumerable <string> cacheNames, int partition, IComputeAction action) { _compute.AffinityRun(cacheNames, partition, action).Get(); }
/** <inheritDoc /> */ public void Broadcast(IComputeAction action) { _compute.Broadcast(action).Get(); }
/** <inheritDoc /> */ public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action) { return(_compute.AffinityRun(cacheName, affinityKey, action).Task); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IPortableReader reader) { var reader0 = (PortableReaderImpl)reader.RawReader(); _action = PortableUtils.ReadPortableOrSerializable <IComputeAction>(reader0); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IPortableReader reader) { var reader0 = (PortableReaderImpl)reader.RawReader(); _action = PortableUtils.ReadPortableOrSerializable<IComputeAction>(reader0); }
/** <inheritDoc /> */ public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action, CancellationToken cancellationToken) { return(GetTaskIfAlreadyCancelled <object>(cancellationToken) ?? _compute.AffinityRun(cacheName, affinityKey, action).GetTask(cancellationToken)); }
/** <inheritDoc /> */ public Task BroadcastAsync(IComputeAction action) { return(_compute.Broadcast(action).Task); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IBinaryRawReader reader) { _action = (IComputeAction)reader.ReadObject <object>(); }
/** <inheritDoc /> */ public Task RunAsync(IComputeAction action) { return(_compute.Run(action).Task); }
/// <summary> /// Initializes a new instance of the <see cref="ComputeActionJob"/> class. /// </summary> /// <param name="reader">The reader.</param> public ComputeActionJob(IBinaryReader reader) { var reader0 = (BinaryReader)reader.GetRawReader(); _action = reader0.ReadObject <IComputeAction>(); }
/** <inheritDoc /> */ public void AffinityRun(string cacheName, object affinityKey, IComputeAction action) { IgniteArgumentCheck.NotNull(cacheName, "cacheName"); _compute.AffinityRun(cacheName, affinityKey, action).Get(); }
/** <inheritDoc /> */ public Task BroadcastAsync(IComputeAction action, CancellationToken cancellationToken) { return GetTaskIfAlreadyCancelled<object>(cancellationToken) ?? _compute.Broadcast(action).GetTask(cancellationToken); }
/// <summary> /// Executes given func on a node where specified partition is located. /// </summary> /// <param name="cacheNames">Cache names. First cache is used for co-location.</param> /// <param name="partition">Partition.</param> /// <param name="func">Func to execute.</param> /// <returns>Result.</returns> public Future <object> AffinityRun(IEnumerable <string> cacheNames, int partition, IComputeAction func) { return(DoAffinityOp <object>(cacheNames, partition, null, func, OpAffinityRunPartition)); }
/** <inheritDoc /> */ public void Broadcast(IComputeAction action) { _curFut.Value = Compute.Broadcast(action); }