/** * Estimate filter's byte send when sending command to server. * For internal use only. */ public int estimateSize() throws AerospikeException { // bin name size(1) + particle type size(1) + begin particle size(4) + end particle size(4) = 10 return Buffer.estimateSizeUtf8(name) + begin.estimateSize() + end.estimateSize() + 10; }
/** * Estimate filter's byte send when sending command to server. * For internal use only. */ public int estimateSize() throws AerospikeException { // bin name size(1) + particle type size(1) + begin particle size(4) + end particle size(4) = 10 return Buffer.estimateSizeUtf8(name) + begin.estimateSize() + end.estimateSize() + 10; }
private final void estimateOperationSize(Operation operation) throws AerospikeException { dataOffset += Buffer.estimateSizeUtf8(operation.binName) + OPERATION_HEADER_SIZE; dataOffset += operation.value.estimateSize(); }
private final void estimateOperationSize(Bin bin) throws AerospikeException { dataOffset += Buffer.estimateSizeUtf8(bin.name) + OPERATION_HEADER_SIZE; dataOffset += bin.value.estimateSize(); }
private final void estimateOperationSize(Operation operation) throws AerospikeException { dataOffset += Buffer.estimateSizeUtf8(operation.binName) + OPERATION_HEADER_SIZE; dataOffset += operation.value.estimateSize(); }
private final void estimateOperationSize(Bin bin) throws AerospikeException { dataOffset += Buffer.estimateSizeUtf8(bin.name) + OPERATION_HEADER_SIZE; dataOffset += bin.value.estimateSize(); }
private final int estimateKeySize(Policy policy, Key key) { int fieldCount = 0; if (key.namespace != null) { dataOffset += Buffer.estimateSizeUtf8(key.namespace) + FIELD_HEADER_SIZE; fieldCount++; } if (key.setName != null) { dataOffset += Buffer.estimateSizeUtf8(key.setName) + FIELD_HEADER_SIZE; fieldCount++; } dataOffset += key.digest.length + FIELD_HEADER_SIZE; fieldCount++; if (policy.sendKey) { dataOffset += key.userKey.estimateSize() + FIELD_HEADER_SIZE + 1; fieldCount++; } return fieldCount; }
private final int estimateKeySize(Policy policy, Key key) { int fieldCount = 0; if (key.namespace != null) { dataOffset += Buffer.estimateSizeUtf8(key.namespace) + FIELD_HEADER_SIZE; fieldCount++; } if (key.setName != null) { dataOffset += Buffer.estimateSizeUtf8(key.setName) + FIELD_HEADER_SIZE; fieldCount++; } dataOffset += key.digest.length + FIELD_HEADER_SIZE; fieldCount++; if (policy.sendKey) { dataOffset += key.userKey.estimateSize() + FIELD_HEADER_SIZE + 1; fieldCount++; } return fieldCount; }