Hi,
Sorry but I could not get it to work.

The standard way of defining a remote filter as shown in sample repo is
something like:

qry.setRemoteFilterFactory(new Factory<CacheEntryEventFilter&lt;Integer,
String>>() {
                    @Override public CacheEntryEventFilter<Integer, String>
create() {
                        return new CacheEntryEventFilter<Integer, String>()
{
                            @Override public boolean
evaluate(CacheEntryEvent<? extends Integer, ? extends String> e) {
                                return e.getKey() > 10;
                            }
                        };
                    }
                });

In the above, instead of having *10* constant, I need to have a HashSet from
which I can check if the updated key exists in it or not (see the snippet
below) And I need the changes in the HashSet to be reflected in the filter.
However it's not making sense to me because the HashSet which is modified is
on one node while the filter is on another node so I expect the remote node
would already have it serialized when the filter was first created and it
would not change even if the set changes in the local node.

HashSet<Integer> = new HashSet<>();
set.add(20);
qry.setRemoteFilterFactory(new Factory<CacheEntryEventFilter&lt;Integer,
String>>() {
                    @Override public CacheEntryEventFilter<Integer, String>
create() {
                        return new CacheEntryEventFilter<Integer, String>()
{
                            @Override public boolean
evaluate(CacheEntryEvent<? extends Integer, ? extends String> e) {
                                return set.contains(e.getKey());
                            }
                        };
                    }
                });
set.add(10)  // would this actually change the filter on remote node?

Perhaps I'm missing something very obvious here. Please help me identify it.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to