use of com.aerospike.client.Value.HLLValue in project aerospike-client-java by aerospike.
the class TestHLLExp method similarity.
private void similarity(Key key) {
ArrayList<HLLValue> hlls2 = new ArrayList<HLLValue>();
hlls2.add(hll2);
ArrayList<HLLValue> hlls3 = new ArrayList<HLLValue>();
hlls3.add(hll3);
policy.filterExp = Exp.build(Exp.ge(HLLExp.getSimilarity(Exp.val(hlls2), Exp.hllBin(bin1)), HLLExp.getSimilarity(Exp.val(hlls3), Exp.hllBin(bin1))));
Record r = client.get(policy, key);
assertEquals(null, r);
policy.filterExp = Exp.build(Exp.le(HLLExp.getSimilarity(Exp.val(hlls2), Exp.hllBin(bin1)), HLLExp.getSimilarity(Exp.val(hlls3), Exp.hllBin(bin1))));
r = client.get(policy, key);
assertRecordFound(key, r);
}
use of com.aerospike.client.Value.HLLValue in project aerospike-client-java by aerospike.
the class TestHLLExp method union.
private void union(Key key) {
ArrayList<HLLValue> hlls = new ArrayList<HLLValue>();
hlls.add(hll1);
hlls.add(hll2);
hlls.add(hll3);
policy.filterExp = Exp.build(Exp.ne(HLLExp.getCount(HLLExp.getUnion(Exp.val(hlls), Exp.hllBin(bin1))), HLLExp.getUnionCount(Exp.val(hlls), Exp.hllBin(bin1))));
Record r = client.get(policy, key);
assertEquals(null, r);
policy.filterExp = Exp.build(Exp.eq(HLLExp.getCount(HLLExp.getUnion(Exp.val(hlls), Exp.hllBin(bin1))), HLLExp.getUnionCount(Exp.val(hlls), Exp.hllBin(bin1))));
r = client.get(policy, key);
assertRecordFound(key, r);
}
Aggregations