Package com.aerospike.client.command

Examples of com.aerospike.client.command.ReadCommand


   * @param key          unique record identifier
   * @return            whether record exists or not
   * @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;
  }
View Full Code Here


   * @param key          unique record identifier
   * @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, key);
    command.setRead(key);
    command.execute(policy);
    return command.getRecord();
  }
View Full Code Here

   * @param binNames        bins to retrieve
   * @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, key);
    command.setRead(key, binNames);
    command.execute(policy);
    return command.getRecord();
  }
View Full Code Here

   * @param key          unique record identifier
   * @return            if found, return record instance.  If not found, return null.
   * @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();
  }
View Full Code Here

   * @return            record if there is a read in the operations list
   * @throws AerospikeException  if command fails
   */
  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();
  }
View Full Code Here

   * @return            return value of user defined function
   * @throws AerospikeException  if transaction fails
   */
  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

   * @param key          unique record identifier
   * @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();
  }
View Full Code Here

   * @param binNames        bins to retrieve
   * @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();
  }
View Full Code Here

   * @param key          unique record identifier
   * @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();
  }
View Full Code Here

   * @param binNames        bins to retrieve
   * @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();
  }
View Full Code Here

TOP

Related Classes of com.aerospike.client.command.ReadCommand

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.