next up previous
: Colyseus Extensions to Mercury : Locating Distributed Objects : Locating Distributed Objects

Mercury Overview

The basic service that Mercury provides is the lookup of stored data items using range-queries over multiple attributes. In Mercury, data items are represented as a list of typed attribute-value pairs, very similar to a record in a relational database. Each field is a tuple of the form: . The following types are recognized: $ \mathtt{int, char, float}$ and $ \mathtt{string}$. For example, objects within Quake II describe their locations using attributes $ \mathtt{x:float}$, $ \mathtt{y:float}$ and $ \mathtt{z:float}$ corresponding to the three coordinate axes. Other attributes of an object include $ \mathtt{team:string}$ and $ \mathtt{score:int}$, for team membership and each player's score, respectively.

A query is a conjunction of predicates which are tuples of the form: $ (\mathtt{type, attribute,
operator, value})$. A disjunction is implemented by multiple distinct queries. Mercury supports the following operators: $ <, >, \le, \ge
\mathrm{and} =$.

As an example, using the above query language, a node could retrieve all data items within a cuboid bounding its region of visibility.

Mercury supports range lookups over multiple attributes by partitioning the nodes in the system into groups called attribute hubs, one for each naming attribute in the overall application schema. Nodes within an attribute hub are organized into a circular overlay with each node responsible for a contiguous range $ r_a$ of attribute values, like that shown in Figure 4. This range is assigned to a node when it joins the network and may change during its lifetime due to other joins as well as load-balancing operations. A query $ Q$ is delivered to exactly one of the hubs corresponding to the attributes that are queried. To guarantee that query will discover all relevant data items, a data item $ D$ is sent to hubs for all attributes referenced in $ D$. Mercury uses a combination of long-links (a.k.a. finger pointers) and cached pointers from previous lookups to reduce the hop count for delivering a message.

図 4: Routing in Mercury.
\includegraphics[width=0.6\columnwidth]{figures/routing.eps}


next up previous
: Colyseus Extensions to Mercury : Locating Distributed Objects : Locating Distributed Objects
Ashwin Bharambe 平成17年3月2日