Thin client scan query supports any predicates. However, make sure that predicate is deployed on all server nodes so it can be executed.
Please share the exception details. On Fri, Dec 10, 2021 at 11:53 AM 38797715 <38797...@qq.com> wrote: > An exception will be throw when the following code is executed: > > The ScanQuery in the thin client does not support IgniteBiPredicate? > > > public class ThinClient { > public static void main(String[] args) throws ClientException, Exception { > ClientConfiguration cfg = new ClientConfiguration().setAddresses( > "localhost:10800"); > try (IgniteClient client = Ignition.startClient(cfg)) { > ClientCache<Integer, Person> cache2 = client.getOrCreateCache("cache2"); > for (int i = 1; i <= 10; i++) { > cache2.put(i, new Person((long)i, "a", "b")); > } > ClientCache<BinaryObject, BinaryObject> cache3 = client.getOrCreateCache( > "cache2").withKeepBinary(); > IgniteBiPredicate<BinaryObject, BinaryObject> filter = new > IgniteBiPredicate<BinaryObject, BinaryObject>() { > @Override public boolean apply(BinaryObject key, BinaryObject person) { > return person.<Long>field("id") > 6; > } > }; > try (QueryCursor<Entry<BinaryObject, BinaryObject>> cur3 = cache3.query( > new ScanQuery<>(filter))) { > for (Cache.Entry<BinaryObject, BinaryObject> entry : cur3) { > System.out.println(entry.getValue()); > } > } > } > } > } >