예제 #1
0
        /// <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));
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
        /// <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)));
        }
예제 #4
0
        /** <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));
        }
예제 #5
0
        /// <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)));
        }
예제 #6
0
 /// <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>();
 }
예제 #7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="action">Action.</param>
 public ComputeActionJob(IComputeAction action)
 {
     _action = action;
 }
예제 #8
0
 /** <inheritDoc /> */
 public void Run(IComputeAction action)
 {
     _curFut.Value = Compute.Run(action);
 }
예제 #9
0
        /** <inheritDoc /> */
        public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action)
        {
            IgniteArgumentCheck.NotNull(cacheName, "cacheName");

            return(_compute.AffinityRun(cacheName, affinityKey, action).Task);
        }
예제 #10
0
 /** <inheritDoc /> */
 public Task RunAsync(IComputeAction action, CancellationToken cancellationToken)
 {
     return(GetTaskIfAlreadyCancelled <object>(cancellationToken) ??
            _compute.Run(action).GetTask(cancellationToken));
 }
예제 #11
0
 /** <inheritDoc /> */
 public void Run(IComputeAction action)
 {
     _compute.Run(action).Get();
 }
예제 #12
0
 /// <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;
 }
예제 #14
0
 /** <inheritDoc /> */
 public void AffinityRun(string cacheName, object affinityKey, IComputeAction action)
 {
     _compute.AffinityRun(cacheName, affinityKey, action).Get();
 }
예제 #15
0
        /// <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>();
        }
예제 #16
0
파일: Compute.cs 프로젝트: zyling10/ignite
 /** <inheritDoc /> */
 public Task AffinityRunAsync(IEnumerable <string> cacheNames, int partition, IComputeAction action,
                              CancellationToken cancellationToken)
 {
     return(_compute.AffinityRun(cacheNames, partition, action).GetTask(cancellationToken));
 }
예제 #17
0
파일: Compute.cs 프로젝트: zyling10/ignite
 /** <inheritDoc /> */
 public Task AffinityRunAsync(IEnumerable <string> cacheNames, int partition, IComputeAction action)
 {
     return(_compute.AffinityRun(cacheNames, partition, action).Task);
 }
예제 #18
0
파일: Compute.cs 프로젝트: zyling10/ignite
 /** <inheritDoc /> */
 public void AffinityRun(IEnumerable <string> cacheNames, int partition, IComputeAction action)
 {
     _compute.AffinityRun(cacheNames, partition, action).Get();
 }
예제 #19
0
 /** <inheritDoc /> */
 public void Broadcast(IComputeAction action)
 {
     _compute.Broadcast(action).Get();
 }
예제 #20
0
 /** <inheritDoc /> */
 public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action)
 {
     return(_compute.AffinityRun(cacheName, affinityKey, action).Task);
 }
예제 #21
0
        /// <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);
        }
예제 #23
0
 /** <inheritDoc /> */
 public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action,
                              CancellationToken cancellationToken)
 {
     return(GetTaskIfAlreadyCancelled <object>(cancellationToken) ??
            _compute.AffinityRun(cacheName, affinityKey, action).GetTask(cancellationToken));
 }
예제 #24
0
 /** <inheritDoc /> */
 public Task BroadcastAsync(IComputeAction action)
 {
     return(_compute.Broadcast(action).Task);
 }
예제 #25
0
 /// <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>();
 }
예제 #26
0
 /** <inheritDoc /> */
 public Task RunAsync(IComputeAction action)
 {
     return(_compute.Run(action).Task);
 }
예제 #27
0
        /// <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>();
        }
예제 #28
0
        /** <inheritDoc /> */
        public void AffinityRun(string cacheName, object affinityKey, IComputeAction action)
        {
            IgniteArgumentCheck.NotNull(cacheName, "cacheName");

            _compute.AffinityRun(cacheName, affinityKey, action).Get();
        }
예제 #29
0
파일: Compute.cs 프로젝트: pks-os/gridgain
 /** <inheritDoc /> */
 public Task BroadcastAsync(IComputeAction action, CancellationToken cancellationToken)
 {
     return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
         _compute.Broadcast(action).GetTask(cancellationToken);
 }
예제 #30
0
 /// <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));
 }
예제 #31
0
 /** <inheritDoc /> */
 public void Broadcast(IComputeAction action)
 {
     _curFut.Value = Compute.Broadcast(action);
 }