An exception will be throw when the following code is executed:
The ScanQuery in the thin client does not support IgniteBiPredicate?
publicclassThinClient{
publicstaticvoidmain(String[] args) throwsClientException, Exception{
ClientConfigurationcfg=
newClientConfiguration().setAddresses("localhost:10800");
try(IgniteClientclient= Ignition.startClient(cfg)) {
ClientCache<Integer, Person> cache2= client.getOrCreateCache("cache2");
for(inti= 1; i<= 10; i++) {
cache2.put(i, newPerson((long)i, "a", "b"));
}
ClientCache<BinaryObject, BinaryObject> cache3=
client.getOrCreateCache("cache2").withKeepBinary();
IgniteBiPredicate<BinaryObject, BinaryObject> filter=
newIgniteBiPredicate<BinaryObject, BinaryObject>() {
@Overridepublicbooleanapply(BinaryObjectkey, BinaryObjectperson) {
returnperson.<Long>field("id") > 6;
}
};
try(QueryCursor<Entry<BinaryObject, BinaryObject>> cur3=
cache3.query(newScanQuery<>(filter))) {
for(Cache.Entry<BinaryObject, BinaryObject> entry:cur3) {
System.out.println(entry.getValue());
}
}
}
}
}