protected internal override void OnFailure(AerospikeException e)
 {
     if (executeListener != null)
     {
         executeListener.OnFailure(e);
     }
 }
        protected internal void ChildFailure(AerospikeException ae)
        {
            // There is no need to stop commands if all commands have already completed.
            int status = Interlocked.CompareExchange(ref done, 1, 0);

            if (status == 0)
            {
                // Send stop signal to all commands.
                foreach (AsyncMultiCommand command in commands)
                {
                    command.Stop();
                }
                OnFailure(ae);
            }
        }
 public void OnFailure(AerospikeException e)
 {
     parent.OnWriteFailure(key, bin, e);
 }
 public void OnFailure(AerospikeException e)
 {
     parent.OnReadFailure(key, e);
 }
 protected internal override void OnFailure(AerospikeException e)
 {
     parent.ChildFailure(e);
 }
 protected internal override void OnFailure(AerospikeException ae)
 {
     listener.OnFailure(ae);
 }
 protected internal override void OnFailure(AerospikeException ae)
 {
     listener.OnFailure(ae);
 }
Esempio n. 8
0
 public void OnFailure(AerospikeException e)
 {
     parent.console.Error("Scan failed: " + Util.GetErrorMessage(e));
     parent.NotifyComplete();
 }
 public void OnFailure(AerospikeException e)
 {
     parent.console.Error("Put failed: " + e.Message);
     parent.NotifyCompleted();
 }
        private void RetryAfterInit(AerospikeException ae)
        {
            if (complete != 0)
            {
                AlreadyCompleted(complete);
                return;
            }

            Policy policy = GetPolicy();

            if (++iteration > policy.maxRetries)
            {
                FailOnNetworkError(ae);
                return;
            }

            // Disable sleep between retries.  Sleeping in asynchronous mode makes no sense.
            //if (watch != null && (watch.ElapsedMilliseconds + policy.sleepBetweenRetries) > timeout)
            if (watch != null && watch.ElapsedMilliseconds > timeout)
            {
                // Might as well stop here because the transaction will
                // timeout after sleep completed.
                FailOnNetworkError(ae);
                return;
            }

            // Prepare for retry.
            ResetConnection();

            // Disable sleep between retries.  Sleeping in asynchronous mode makes no sense.
            //if (policy.sleepBetweenRetries > 0)
            //{
            //	Util.Sleep(policy.sleepBetweenRetries);
            //}

            try
            {
                // Retry command recursively.
                ExecuteCommand();
            }
            catch (Exception)
            {
                // Command has already been cleaned up.
                // Notify user of original exception.
                OnFailure(ae);
            }
        }
        private void FailOnNetworkError(AerospikeException ae)
        {
            // Ensure that command succeeds or fails, but not both.
            int status = Interlocked.CompareExchange(ref complete, FAIL_NETWORK_ERROR, 0);

            if (status == 0)
            {
                CloseOnError();
                OnFailure(ae);
            }
            else
            {
                AlreadyCompleted(status);
            }
        }
        private void FailOnApplicationError(AerospikeException ae)
        {
            // Ensure that command succeeds or fails, but not both.
            int status = Interlocked.CompareExchange(ref complete, FAIL_APPLICATION_ERROR, 0);

            if (status == 0)
            {
                if (ae.KeepConnection())
                {
                    // Put connection back in pool.
                    conn.UpdateLastUsed();
                    node.PutAsyncConnection(conn);
                    PutBackArgsOnError();
                }
                else
                {
                    // Close socket to flush out possible garbage.
                    CloseOnError();
                }
                OnFailure(ae);
            }
            else
            {
                AlreadyCompleted(status);
            }
        }
        protected void OnReadFailure(Key key, AerospikeException ae)
        {
            if (ae.Result == ResultCode.TIMEOUT)
            {
                Interlocked.Increment(ref shared.readTimeoutCount);
            }
            else
            {
                Interlocked.Increment(ref shared.readErrorCount);

                if (args.debug)
                {
                    console.Error("Read error: ns={0} set={1} key={2} exception={3}",
                        key.ns, key.setName, key.userKey, ae.Message);
                }
            }
        }
        protected void OnWriteFailure(Key key, Bin bin, AerospikeException ae)
        {
            if (ae.Result == ResultCode.TIMEOUT)
            {
                Interlocked.Increment(ref shared.writeTimeoutCount);
            }
            else
            {
                Interlocked.Increment(ref shared.writeErrorCount);

                if (args.debug)
                {
                    console.Error("Write error: ns={0} set={1} key={2} bin={3} exception={4}",
                        key.ns, key.setName, key.userKey, bin.name, ae.Message);
                }
            }
        }
Esempio n. 15
0
 protected internal abstract void OnFailure(AerospikeException ae);
 protected internal abstract void OnFailure(AerospikeException ae);
Esempio n. 17
0
 public virtual void OnFailure(AerospikeException e)
 {
     parent.console.Error("Batch get sequence failed: " + Util.GetErrorMessage(e));
     parent.TaskComplete();
 }
Esempio n. 18
0
 public virtual void OnFailure(AerospikeException e)
 {
     parent.console.Error("Put failed: " + e.Message);
     parent.AllTasksComplete();
 }
 public void OnFailure(AerospikeException e)
 {
     parent.console.Error("Failed to put: namespace={0} set={1} key={2} exception={3}",
         key.ns, key.setName, key.userKey, e.Message);
     parent.NotifyCompleted();
 }
 public void OnFailure(AerospikeException e)
 {
     monitor.SetError(e);
     monitor.NotifyCompleted();
 }
 public void OnFailure(AerospikeException e)
 {
     parent.SetError(e);
     parent.NotifyCompleted();
 }
Esempio n. 22
0
 public void OnFailure(AerospikeException exception)
 {
     tcs.SetException(exception);
 }