Class CacheQueryExample
- java.lang.Object
-
- org.apache.ignite.examples.datagrid.CacheQueryExample
-
public class CacheQueryExample extends java.lang.ObjectCache queries example. This example demonstrates TEXT, FULL SCAN and INDEX queries over cache.Example also demonstrates usage of fields queries that return only required fields instead of whole key-value pairs. When fields queries are distributed across several nodes, they may not work as expected. Keep in mind following limitations (not applied if data is queried from one node only):
-
Non-distributed joins will work correctly only if joined objects are stored in
collocated mode. Refer to
AffinityKeyjavadoc for more details.To use distributed joins it is necessary to set query 'distributedJoin' flag using
SqlFieldsQuery.setDistributedJoins(boolean). - Note that if you created query on to replicated cache, all data will be queried only on one node, not depending on what caches participate in the query (some data from partitioned cache can be lost). And visa versa, if you created it on partitioned cache, data from replicated caches will be duplicated.
Remote nodes should be started using
ExampleNodeStartupwhich will start node withexamples/config/example-ignite.xmlconfiguration. -
Non-distributed joins will work correctly only if joined objects are stored in
collocated mode. Refer to
-
-
Constructor Summary
Constructors Constructor Description CacheQueryExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Executes example.
-