java - Apache Ignite : Continuous SQLFieldQuery -
i looking expose apache ignite cache , client application can access same. can see continuous query support in apache ignite version 1.9 - https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datagrid/cachecontinuousasyncqueryexample.java
however not able find example how implement continuous sqlfieldquery.
public static void main(string[] args) throws exception { system.out.println("run spring example!!"); ignition.setclientmode(true); igniteconfiguration cfg = new igniteconfiguration(); cfg.setincludeeventtypes( evts_cache); cfg.setpeerclassloadingenabled(true); tcpdiscoverymulticastipfinder discoverymulticastipfinder = new tcpdiscoverymulticastipfinder(); set<string> set = new hashset<>(); set.add("serverhost:47500..47509"); discoverymulticastipfinder.setaddresses(set); tcpdiscoveryspi discoveryspi = new tcpdiscoveryspi(); discoveryspi.setipfinder(discoverymulticastipfinder); cfg.setdiscoveryspi(discoveryspi); cfg.setpeerclassloadingenabled(true); cfg.setincludeeventtypes(evts_cache); ignite ignite = ignition.start(cfg); cacheconfiguration<string, binaryobject> cacheconfiguration = new cacheconfiguration<>(cache_name); ignitecache<string, binaryobject> cache = ignite.getorcreatecache(cacheconfiguration).withkeepbinary(); querycursor<list<?>> query = cache.query(new sqlfieldsquery("select field1 table1 field1='test'")); list<list<?>> = query.getall(); (list<?> l : all) { system.out.println(l); } }
continuous queries predicate based, sql not supported here. can provide remote filter called every update on server side. updates satisfy filter, batched , sent subscriber, local listener invoked.
refer page details: https://apacheignite.readme.io/docs/continuous-queries
Comments
Post a Comment