public final class SimpleWithQuery
extends java.lang.Object
implements java.lang.Runnable
This example shows how the compute level can communicate between nodes using queries.
Query is a very general mechanism that simply makes it possible to schedule a callable to run every second and return any serializable data to be saved in a global cache.
Query is always performed on a current node but its results are available for all nodes (accessible using QueryProcessor.query()
method).
Modifier and Type | Class and Description |
---|---|
private static class |
SimpleWithQuery.SampleCached |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger |
private QueryProcessor<SimpleWithQuery.SampleCached> |
queryProcessor |
Constructor and Description |
---|
SimpleWithQuery(QueryProcessor<SimpleWithQuery.SampleCached> queryProcessor) |
Modifier and Type | Method and Description |
---|---|
void |
run() |
java.lang.String |
toString() |
private static final org.slf4j.Logger logger
private final QueryProcessor<SimpleWithQuery.SampleCached> queryProcessor
@Inject public SimpleWithQuery(QueryProcessor<SimpleWithQuery.SampleCached> queryProcessor)