Package com.aerospike.client.command

Examples of com.aerospike.client.command.ReadCommand.execute()


   * @throws AerospikeException  if command fails
   */
  public final boolean exists(Policy policy, Key key) throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, key);
    command.setExists(key);
    command.execute(policy);
    return command.getResultCode() == ResultCode.OK;
  }

  /**
   * Check if multiple record keys exist in one batch call.
View Full Code Here


   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key) throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, key);
    command.setRead(key);
    command.execute(policy);
    return command.getRecord();
  }

  /**
   * Read record header and bins for specified key.
View Full Code Here

   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key, String... binNames) throws AerospikeException
    ReadCommand command = new ReadCommand(cluster, key);
    command.setRead(key, binNames);
    command.execute(policy);
    return command.getRecord();
  }

  /**
   * Read record generation and expiration only for specified key.  Bins are not read.
View Full Code Here

   * @throws AerospikeException  if read fails
   */
  public final Record getHeader(Policy policy, Key key) throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, key);
    command.setReadHeader(key);
    command.execute(policy);
    return command.getRecord();
  }

  //-------------------------------------------------------
  // Batch Read Operations
View Full Code Here

   */
  public final Record operate(WritePolicy policy, Key key, Operation... operations)
    throws AerospikeException {   
    ReadCommand command = new ReadCommand(cluster, key);
    command.setOperate(policy, key, operations);
    command.execute(policy);
    return command.getRecord();
  }

  //-------------------------------------------------------
  // Scan Operations
View Full Code Here

   */
  public final Object execute(Policy policy, Key key, String packageName, String functionName, Value... args)
    throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, key);
    command.setUdf(key, packageName, functionName, args);   
    command.execute(policy);
   
    Record record = command.getRecord();
   
    if (record == null || record.bins == null) {
      return null;
View Full Code Here

   * @return            if found, return record instance.  If not found, return null.
   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key) throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, policy, key, null);
    command.execute();
    return command.getRecord();
  }

  /**
   * Read record header and bins for specified key.
View Full Code Here

   * @return            if found, return record instance.  If not found, return null.
   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key, String... binNames) throws AerospikeException
    ReadCommand command = new ReadCommand(cluster, policy, key, binNames);
    command.execute();
    return command.getRecord();
  }

  /**
   * Read record generation and expiration only for specified key.  Bins are not read.
View Full Code Here

   * @return            if found, return record instance.  If not found, return null.
   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key) throws AerospikeException {
    ReadCommand command = new ReadCommand(cluster, policy, key, null);
    command.execute();
    return command.getRecord();
  }

  /**
   * Read record header and bins for specified key.
View Full Code Here

   * @return            if found, return record instance.  If not found, return null.
   * @throws AerospikeException  if read fails
   */
  public final Record get(Policy policy, Key key, String... binNames) throws AerospikeException
    ReadCommand command = new ReadCommand(cluster, policy, key, binNames);
    command.execute();
    return command.getRecord();
  }

  /**
   * Read record generation and expiration only for specified key.  Bins are not read.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.