Package com.aerospike.client

Examples of com.aerospike.client.AerospikeException


  ) throws AerospikeException {
    this.listener = listener;

    Node[] nodes = cluster.getNodes();
    if (nodes.length == 0) {
      throw new AerospikeException(ResultCode.SERVER_NOT_AVAILABLE, "Scan failed because cluster is empty.");
    }

    completedSize = nodes.length;

    for (Node node : nodes) {     
View Full Code Here


    }

    if (! name.equals(infoName)) {
      // Set node to inactive immediately.
      active = false;
      throw new AerospikeException("Node name has changed. Old=" + name + " New=" + infoName);
    }
  }
View Full Code Here

     
      if (resultCode != 0) {
        if (resultCode == ResultCode.KEY_NOT_FOUND_ERROR) {
          return false;
        }
        throw new AerospikeException(resultCode);
      }

      byte info3 = dataBuffer[3];
     
      // If this is the end marker of the response, do not proceed further
      if ((info3 & Command.INFO3_LAST) == Command.INFO3_LAST) {
        return false;
      }
     
      int fieldCount = Buffer.bytesToShort(dataBuffer, 18);
      int opCount = Buffer.bytesToShort(dataBuffer, 20);
     
      parseKey(fieldCount);
     
      if (opCount != 1) {
        throw new AerospikeException("Query aggregate expected exactly one bin.  Received " + opCount);
      }

      // Parse aggregateValue.
        readBytes(8)
      int opSize = Buffer.bytesToInt(dataBuffer, 0);
      byte particleType = dataBuffer[5];
      byte nameSize = dataBuffer[7];
       
      readBytes(nameSize);
      String name = Buffer.utf8ToString(dataBuffer, 0, nameSize);
 
      int particleBytesSize = (int) (opSize - (4 + nameSize));
      readBytes(particleBytesSize);
     
      if (! name.equals("SUCCESS")) {
        if (name.equals("FAILURE")) {
          Object value = Buffer.bytesToParticle(particleType, dataBuffer, 0, particleBytesSize);
          throw new AerospikeException(ResultCode.QUERY_GENERIC, value.toString());
        }
        else {
          throw new AerospikeException(ResultCode.QUERY_GENERIC, "Query aggregate expected bin name SUCCESS.  Received " + name);
        }
      }
     
      LuaValue aggregateValue = instance.getLuaValue(particleType, dataBuffer, 0, particleBytesSize);
                 
View Full Code Here

        throw ce;
      }
    }
    catch (Exception e) {
      if (!failOnApplicationInit()) {
        throw new AerospikeException(e);
      }
    }
  }
View Full Code Here

        catch (AerospikeException ae) {
      // Fail without retry on non-network errors.
      failOnApplicationError(ae);
        }
        catch (IOException ioe) {
          retryAfterInit(new AerospikeException(ioe));
        }
        catch (Exception e) {
      // Fail without retry on unknown errors.
      failOnApplicationError(new AerospikeException(e));
        }
  }
View Full Code Here

  protected void parseResult(ByteBuffer byteBuffer) throws AerospikeException {
    int resultCode = byteBuffer.get(5) & 0xFF;
   
    if (resultCode != 0) {
      throw new AerospikeException(resultCode);
    }
  }
View Full Code Here

        else {
          if (resultCode == ResultCode.KEY_NOT_FOUND_ERROR) {
              exists = false;
          }
          else {
            throw new AerospikeException(resultCode);
          }
        }
  } 
View Full Code Here

          if (stopOnNotFound) {
            return true;
          }
        }
        else {
          throw new AerospikeException(resultCode);
        }
      }

      // If this is the end marker of the response, do not proceed further
      if ((receiveBuffer[receiveOffset + 3] & Command.INFO3_LAST) != 0) {
View Full Code Here

  protected void parseResult(ByteBuffer byteBuffer) throws AerospikeException {
    int resultCode = byteBuffer.get(5) & 0xFF;
   
    if (resultCode != 0) {
      throw new AerospikeException(resultCode);
    }
  }
View Full Code Here

        else {
          if (resultCode == ResultCode.KEY_NOT_FOUND_ERROR) {
            record = null;
          }
          else {
            throw new AerospikeException(resultCode);
          }
        }           
  }
View Full Code Here

TOP

Related Classes of com.aerospike.client.AerospikeException

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.