示例#1
0
        protected internal override void OnSuccess()
        {
            try
            {
                if (tracker.IsComplete(policy))
                {
                    listener.OnSuccess();
                    return;
                }

                // Prepare for retry.
                Reset();
                ScanPartitions();
            }
            catch (AerospikeException ae)
            {
                OnFailure(ae);
            }
            catch (Exception e)
            {
                OnFailure(new AerospikeException(e));
            }
        }
 protected internal override void OnSuccess()
 {
     listener.OnSuccess();
 }
 /// <summary>
 /// Asynchronously read multiple record headers and bins for specified keys in one batch call.
 /// Schedule the batch get command with a channel selector and return.
 /// Another thread will process the command and send the results to the listener in multiple unordered calls.
 /// <para>
 /// If a key is not found, the record will be null.
 /// The policy can be used to specify timeouts.
 /// </para>
 /// </summary>
 /// <param name="policy">generic configuration parameters, pass in null for defaults</param>
 /// <param name="listener">where to send results</param>
 /// <param name="keys">array of unique record identifiers</param>
 /// <param name="binNames">array of bins to retrieve</param>
 /// <exception cref="AerospikeException">if queue is full</exception>
 public void Get(BatchPolicy policy, RecordSequenceListener listener, Key[] keys, params string[] binNames)
 {
     if (keys.Length == 0)
     {
         listener.OnSuccess();
         return;
     }
     if (policy == null)
     {
         policy = batchPolicyDefault;
     }
     new AsyncBatchGetSequenceExecutor(cluster, policy, listener, keys, binNames, Command.INFO1_READ);
 }
 /// <summary>
 /// Asynchronously read multiple records for specified keys in one batch call.
 /// Schedule the get command with a channel selector and return.
 /// Another thread will process the command and send the results to the listener in multiple unordered calls.
 /// <para>
 /// If a key is not found, the record will be null.
 /// The policy can be used to specify timeouts.
 /// </para>
 /// </summary>
 /// <param name="policy">generic configuration parameters, pass in null for defaults</param>
 /// <param name="listener">where to send results</param>
 /// <param name="keys">array of unique record identifiers</param>
 /// <exception cref="AerospikeException">if queue is full</exception>
 public void Get(BatchPolicy policy, RecordSequenceListener listener, Key[] keys)
 {
     if (keys.Length == 0)
     {
         listener.OnSuccess();
         return;
     }
     if (policy == null)
     {
         policy = batchPolicyDefault;
     }
     new AsyncBatchGetSequenceExecutor(cluster, policy, listener, keys, null, Command.INFO1_READ | Command.INFO1_GET_ALL);
 }