Package com.aerospike.client.policy

Examples of com.aerospike.client.policy.Policy


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 Policy policy;
  private Record record;

  public ReadHeaderCommand(Cluster cluster, Policy policy, Key key) {
    super(cluster, key);
    this.policy = (policy == null) ? new Policy() : policy;
  }
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 Policy policy;
  private Record record;

  public ReadHeaderCommand(Cluster cluster, Policy policy, Key key) {
    super(cluster, key);
    this.policy = (policy == null) ? new Policy() : policy;
  }
View Full Code Here

  private final String[] binNames;
  private Record record;

  public ReadCommand(Cluster cluster, Policy policy, Key key, String[] binNames) {
    super(cluster, key);
    this.policy = (policy == null) ? new Policy() : policy;
    this.binNames = binNames;
  }
View Full Code Here

  private final Policy policy;
  private boolean exists;

  public ExistsCommand(Cluster cluster, Policy policy, Key key) {
    super(cluster, key);
    this.policy = (policy == null) ? new Policy() : policy;
  }
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

      this.writePolicyDefault = policy.writePolicyDefault;
      this.scanPolicyDefault = policy.scanPolicyDefault;
      this.queryPolicyDefault = policy.queryPolicyDefault;
    }
    else {
      this.readPolicyDefault = new Policy();
      this.writePolicyDefault = new WritePolicy();
      this.scanPolicyDefault = new ScanPolicy();
      this.queryPolicyDefault = new QueryPolicy();
    }
  }
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.