if (resultCode != 0) {
if (resultCode == ResultCode.KEY_NOT_FOUND_ERROR) {
return false;
}
throw new AerospikeException(resultCode);
}
byte info3 = receiveBuffer[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(receiveBuffer, 18);
int opCount = Buffer.bytesToShort(receiveBuffer, 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(receiveBuffer, 0);
byte particleType = receiveBuffer[5];
byte nameSize = receiveBuffer[7];
readBytes(nameSize);
String name = Buffer.utf8ToString(receiveBuffer, 0, nameSize);
int particleBytesSize = (int) (opSize - (4 + nameSize));
readBytes(particleBytesSize);
LuaValue aggregateValue = instance.getValue(particleType, receiveBuffer, 0, particleBytesSize);
if (! name.equals("SUCCESS")) {
throw new AerospikeException("Query aggregate expected bin name SUCCESS. Received " + name);
}
if (! valid) {
throw new AerospikeException.QueryTerminated();
}