Hi i would like to understand the difference between the case when in java client we see Error code 2 for KEY NOT FOUND and when we get null record
While using the Aerospike Java client, I am observing two different behaviors:
- The get() call completes successfully, but the returned Record object is null.
- The get() call throws an AerospikeException with result code 2 (KEY_NOT_FOUND), indicating that the key digest was not found.
like for sync get call in aerospike java client
`
/**
- Read record header and bins for specified key.
- The policy can be used to specify timeouts.
- @param policy generic configuration parameters, pass in null for defaults
- @param key unique record identifier
- @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)
`
wanted to understand when records can be null and when we would get Aerospike Exception with error code 2?
Aerospike client version: aerospike-client-jdk21:9.0.5
Aerospike Server version: 6.0.3
Hi i would like to understand the difference between the case when in java client we see Error code 2 for KEY NOT FOUND and when we get null record
While using the Aerospike Java client, I am observing two different behaviors:
like for sync get call in aerospike java client
`
/**
*/
public final Record get(Policy policy, Key key, String... binNames)
`
wanted to understand when records can be null and when we would get Aerospike Exception with error code 2?
Aerospike client version: aerospike-client-jdk21:9.0.5
Aerospike Server version: 6.0.3