Package com.aerospike.client

Examples of com.aerospike.client.Key


   * @return          {@link ClResult} containing bin name/value pairs
   */
  public ClResult getAllDigest(String namespace, byte[] digest,
      ClOptions opts) {
    try {
      Record record = super.get(getPolicy(opts), new Key(namespace, digest));
      return getResult(record);
    }
    catch (AerospikeException ae) {
      return getResult(ae);
    }
View Full Code Here


   * @param key        record identifier, unique within set
   * @return          {@link ClResultCode result status}
   */
  public ClResultCode exists(Object key) {
    try {
      boolean exists = super.exists(defaultPolicy, new Key(mDefaultNamespace, "", Value.get(key)));
      return exists? ClResultCode.OK : ClResultCode.KEY_NOT_FOUND_ERROR;
    }
    catch (AerospikeException ae) {
      return getResultCode(ae);
    }
View Full Code Here

   * @return          {@link ClResultCode result status}
   */
  public ClResultCode exists(String namespace, String set, Object key,
      ClOptions opts) {
    try {
      boolean exists = super.exists(getPolicy(opts), new Key(namespace, set, Value.get(key)));
      return exists? ClResultCode.OK : ClResultCode.KEY_NOT_FOUND_ERROR;
    }
    catch (AerospikeException ae) {
      return getResultCode(ae);
    }
View Full Code Here

    for (String binName : readBinNames) {
      operations[count++] = Operation.get(binName);
    }
   
    try {
      Record record = super.operate(getWritePolicy(opts, wOpts), new Key(namespace, set, Value.get(key)), operations);
      return getResult(record);
    }
    catch (AerospikeException ae) {
      return getResult(ae);
    }
View Full Code Here

  private static Key[] getKeys(String namespace, String set, Collection<Object> keys) throws AerospikeException {
    Key[] keyArray = new Key[keys.size()];
    int count = 0;
   
    for (Object key : keys) {
      keyArray[count++] = new Key(namespace, set, Value.get(key));
    }
    return keyArray;   
 
View Full Code Here

     
      int generation = Buffer.bytesToInt(receiveBuffer, 6);
      int expiration = Buffer.bytesToInt(receiveBuffer, 10);
      int fieldCount = Buffer.bytesToShort(receiveBuffer, 18);
      int opCount = Buffer.bytesToShort(receiveBuffer, 20);
      Key key = parseKey(fieldCount);
      BatchItem item = keyMap.get(key);
     
      if (item != null) {       
        if (resultCode == 0) {
          int index = item.getIndex();
View Full Code Here

      int generation = Buffer.bytesToInt(receiveBuffer, 6);
      int expiration = Buffer.bytesToInt(receiveBuffer, 10);
      int fieldCount = Buffer.bytesToShort(receiveBuffer, 18);
      int opCount = Buffer.bytesToShort(receiveBuffer, 20);
     
      Key key = parseKey(fieldCount);

      // Parse bins.
      Map<String,Object> bins = null;
     
      for (int i = 0 ; i < opCount; i++) {
View Full Code Here

      }       
      else if (fieldtype == FieldType.TABLE) {
        setName = new String(receiveBuffer, 1, size);
      }       
    }
    return new Key(namespace, digest, setName);   
  }
View Full Code Here

     
      if (opCount > 0) {
        throw new AerospikeException.Parse("Received bins that were not requested!");
      }
           
      Key key = parseKey(fieldCount);
      BatchItem item = keyMap.get(key);
     
      if (item != null) {
        int index = item.getIndex();
        existsArray[index] = resultCode == 0;
View Full Code Here

      int generation = Buffer.bytesToInt(receiveBuffer, 6);
      int expiration = Buffer.bytesToInt(receiveBuffer, 10);
      int fieldCount = Buffer.bytesToShort(receiveBuffer, 18);
      int opCount = Buffer.bytesToShort(receiveBuffer, 20);
     
      Key key = parseKey(fieldCount);

      // Parse bins.
      Map<String,Object> bins = null;
     
      for (int i = 0 ; i < opCount; i++) {
View Full Code Here

TOP

Related Classes of com.aerospike.client.Key

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.