Example #1
0
        public void CompleteWithError(long taskHandle, PlatformMemoryStream stream)
        {
            PortableReaderImpl reader = _compute.Marshaller.StartUnmarshal(stream);

            Exception err;

            try
            {
                if (reader.ReadBoolean())
                {
                    PortableResultWrapper res = reader.ReadObject <PortableUserObject>()
                                                .Deserialize <PortableResultWrapper>();

                    err = (Exception)res.Result;
                }
                else
                {
                    err = ExceptionUtils.GetException(reader.ReadString(), reader.ReadString());
                }
            }
            catch (Exception e)
            {
                err = new IgniteException("Task completed with error, but it cannot be unmarshalled: " + e.Message, e);
            }

            CompleteWithError(taskHandle, err);
        }
Example #2
0
        public void CompleteWithError(long taskHandle, PlatformMemoryStream stream)
        {
            BinaryReader reader = _compute.Marshaller.StartUnmarshal(stream);

            Exception err;

            try
            {
                err = reader.ReadBoolean()
                    ? reader.ReadObject <BinaryObject>().Deserialize <Exception>()
                    : ExceptionUtils.GetException(reader.ReadString(), reader.ReadString());
            }
            catch (Exception e)
            {
                err = new IgniteException("Task completed with error, but it cannot be unmarshalled: " + e.Message, e);
            }

            CompleteWithError(taskHandle, err);
        }
Example #3
0
        public void ExecuteLocal(bool cancel)
        {
            ComputeRunner.InjectResources(_ignite, _job);

            var nodeId = _ignite.GetIgnite().GetCluster().GetLocalNode().Id;

            try
            {
                var res = Execute0(cancel);

                _jobRes = new ComputeJobResultImpl(res, null, _job, nodeId, cancel);
            }
            catch (Exception e)
            {
                var ex = new IgniteException(
                    "Compute job has failed on local node, examine InnerException for details.", e);

                _jobRes = new ComputeJobResultImpl(null, ex, _job, nodeId, cancel);
            }
        }