Package com.aerospike.client.policy

Examples of com.aerospike.client.policy.Policy


   */
  public CitrusleafClient() {
    ClLogInit();
    defaultWritePolicy = new WritePolicy();
    defaultWritePolicy.timeout = DEFAULT_TIMEOUT;
    defaultPolicy = new Policy();
    defaultPolicy.timeout = DEFAULT_TIMEOUT;
  }
View Full Code Here


   */
  public CitrusleafClient(String hostname, int port) {
    ClLogInit();
    defaultWritePolicy = new WritePolicy();
    defaultWritePolicy.timeout = DEFAULT_TIMEOUT;
    defaultPolicy = new Policy();
    defaultPolicy.timeout = DEFAULT_TIMEOUT;
   
    try {
      super.addServer(hostname, port);
    }
View Full Code Here

    }
    return policy;
  }
 
  private static Policy getPolicy(ClOptions opts) {
    Policy policy = new Policy();
    setPolicy(opts, policy);
    return policy;
  }
View Full Code Here

  protected byte[] receiveBuffer;
   
  public final void execute(Policy policy) throws AerospikeException {
    if (policy == null) {
      policy = new Policy();
    }
           
    int remainingMillis = policy.timeout;
    long limit = System.currentTimeMillis() + remainingMillis;
        int failedNodes = 0;
View Full Code Here

    this.cluster = cluster;
  }
 
  public void execute(Policy policy, Command command) throws AerospikeException {
    if (policy == null) {
      policy = new Policy();
    }
   
    timeout = policy.timeout;
   
    if (timeout > 0) { 
View Full Code Here

  public AsyncCommand(AsyncCluster cluster) {
    this.cluster = cluster;
  }
 
  public void execute() throws AerospikeException {
    Policy policy = getPolicy();
    timeout = policy.timeout;
   
    if (timeout > 0) { 
      limit = System.currentTimeMillis() + timeout;
    }
View Full Code Here

  private boolean retryOnInit() throws AerospikeException {
    if (complete.get()) {
      return true;
    }

    Policy policy = getPolicy();
   
    if (++iteration > policy.maxRetries) {
      return failOnNetworkInit();
    }
View Full Code Here

  protected final void retryAfterInit(AerospikeException ae) {
    if (complete.get()) {
      return;
    }

    Policy policy = getPolicy();

    if (++iteration > policy.maxRetries) {
      failOnNetworkError(ae);
      return;
    }
View Full Code Here

import com.aerospike.client.util.Util;

public abstract class SyncCommand extends Command {

  public final void execute() throws AerospikeException {
    Policy policy = getPolicy();       
    int remainingMillis = policy.timeout;
    long limit = System.currentTimeMillis() + remainingMillis;
        int failedNodes = 0;
        int failedConns = 0;
        int iterations = 0;
View Full Code Here

  private final RecordListener listener;
  private Record record;
 
  public AsyncReadHeader(AsyncCluster cluster, Policy policy, RecordListener listener, Key key) {
    super(cluster, key);
    this.policy = (policy == null) ? new Policy() : policy;
    this.listener = listener;
  }
View Full Code Here

TOP

Related Classes of com.aerospike.client.policy.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.