XBird/D introduces a distributed query extention to XQuery called XBird Distributed Query, BDQ for short.
Syntax
BDQExpr ::= "execute at" [ VarRef "in" ] Expr "{" Expr "}"
Usage
Configuring a service
The distiributed query processor, XBird/D in short, is configurable through xbird.properties.
```
The port number used by XBird/D.
This effects host:port as appears in the later.
xbird.rmi.registry.local.port=1099
The identifying name of the services: name(,name)*
caution: name should not start with slash.
xbird.rmi.engine.name=xbird/srv-01 ```
Note: You can override the settings by putting xbird.properties on the directory where System.getProperty("user.dir") specifies.
Starting a service
Just run a server as in this document where the remote query executed.
We assume here that the serive xbird/srv-01 is run at port 1099 on the host knuth.naist.jp.
Example Query
declare variable $remote-endpoint := "//knuth.naist.jp:1099/xbird/srv-01";
declare function local:remote-eval($colname)
{
execute at $remote-endpoint {
for $a in fn:collection($colname)/site/closed_auctions/closed_auction
where $a/price/text() >= 40
return $a
}/price
};
local:remote-eval("/repos/xmark1.xml")
Nesting distributed queries as in mapreduce1.xq can also be accepted.