(2) Query Processor
Query Processor implements query processing of TinyDB and it consists
of three major components: TupleRouter, SelOperator and AggOperator.
TupleRouter component, which is at the heart of the TinyDB system,
provides the main query processing functionality on a mote. It is called a tuple
???router??™ because it routes tuples among a variety of local query processing
components. Note that other components take charge of network routing, not
this component! The TupleRouter component runs on a single sensor node
and contains three main functions: handling of new query messages, result
computation and propagation, subtree result message handling.
??? Handling of New Query Messages. When a new query comes, TupleRouter
records the query message such as globally unique ID, attributes to
retrieve, a single selection predicate or aggregation function to apply, etc.
Then the TupleRouter allocates space to hold a single, ???in-flight??™ tuple for
that query, which is called tuple space. At last, TupleRouter starts the
mote??™s clock to fire at the appropriate data-delivery rate for all of the
current queries in the system.
??? Result computation and propagation. Whenever a clock event occurs in
TupleRouter, the router must perform four actions: deliver tuples that
were completed on the previous clock event, decrement the counters for
all queries, fetch data for each query firing this epoch and fill the data in
the tuple space, route filled-in tuples to query operators and process them
in the pipeline.
Pages:
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522