Aerospike client has scanAll method for reading all rows from it's store. I use it in the folowing code:
ScanPolicy policy = new ScanPolicy();
policy.concurrentNodes = true;
policy.priority = Priority.DEFAULT;
policy.includeBinData = true;
policy.scanPercent = 100;
client.scanAll(policy, "namespaceName", "setName", new ScanCallback() {
@Override
public void scanCallback(Key key, Record record) throws AerospikeException {
STORE.put(key.userKey.toLong(), record.getValue("binName").toString());
}
});
But it is finished with NullPointerException
, because userKey is null. All other fields are valid as expected. User key is the Long value, that was used for saving data:
client.put(writePolicy, new Key("namespaceName", "setName", userKey), new Bin("binName", value));
All is fine, if I do single request like this:
client.get(readPolicy, new Key("namespaceName", "setName", userKey));
What may be wrong? Why userKey is null?