Tag: aerospike

Aerospike:我如何获得记录密钥?

Aerospike客户端具有scanAll方法,用于从其商店中读取所有行。 我在下面的代码中使用它: 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()); } }); 但它完成了NullPointerException ,因为userKey为null。 所有其他字段均按预期有效。 用户密钥是Long值,用于保存数据: client.put(writePolicy, new Key(“namespaceName”, “setName”, userKey), new Bin(“binName”, value)); 一切都很好,如果我做这样的单一请求: client.get(readPolicy, new Key(“namespaceName”, […]