Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31807
Modified Files:
Tag: XQuery_0-16
pathfinder.mx xrpc_server.mx
Log Message:
- start xrpc by default, use new environment variables
- perform all startup activities fully after initializing
(clients connect only after the system is fully ready)
Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.288.2.11
retrieving revision 1.288.2.12
diff -u -d -r1.288.2.11 -r1.288.2.12
--- pathfinder.mx 12 Feb 2007 16:53:17 -0000 1.288.2.11
+++ pathfinder.mx 12 Feb 2007 22:51:42 -0000 1.288.2.12
@@ -1,4 +1,4 @@
-@' pathfinder.mx
[EMAIL PROTECTED] pathfinder.mx
@'
@' XQuery runtime environment
@'
@@ -65,6 +65,13 @@
if (clientid() != 0) {
ERROR("pathfinder module must be loaded in Mserver console first.");
}
+
+const XQUERY_STATUS_INITIALIZING := 0;
+const XQUERY_STATUS_RECOVERING := 1;
+const XQUERY_STATUS_GARBAGECOLL := 2;
+const XQUERY_STATUS_READY := 3;
+var xquery_status := XQUERY_STATUS_INITIALIZING;
+
module(mapi); # remote client access
module(pf_support);
module(logger);
@@ -78,6 +85,7 @@
if (monet_environment.exist("standoff"))
standoff := =(monet_environment.find("standoff"),"enabled");
+
# The XML Meta-Database
#############################################################
#
# Global information on persistent stored XML collections:
@@ -533,10 +541,6 @@
var pf_chkpt_cnt := 0; # counter is used by nonexclusive acces (first gets
barrier, last releases)
var pf_chkpt_barrier := sema_create(1); # the barrier
-# initialize the logger
-var pf_logger := logger_create(0, "xquery",
monet_environment.find("xquery_logdir"),
-
monet_environment.find("gdk_dbname"), LOGGER_VERSION);
-
# all update bats in the ws (tail-type + name)
const ws_update := bat(int,str)
.insert(bat,"map_pid")
@@ -643,12 +647,6 @@
}
}
-# delete tmp files in DBFARM/DBNAME/tmp
-cleantmpdir(msec() / 1000LL);
-
-# synchronize the starting of the log
-fork(pf_logmanager());
-
# the set of document collections (may only be accessed holding pf_short)
var collection_name; # bat[oid,str] collection name
var collection_size; # bat[oid,lng] collection size in bytes
@@ -693,6 +691,11 @@
pf_checkpoint(bat(void,str).append("uri_lifetime"));
}
+# initialize uri_lifetime
+{ var b :=
split(monet_environment.find("xquery_cacherules"),";").seqbase([EMAIL
PROTECTED]);
+ var i := [r_search](b,"=").select(2,int_nil);
+
uri_lifetime.insert(reverse(b.[string](0,[-](i,1))).leftfetchjoin([lng](b.[string]([+](i,1)))));
}
+
# runtime collection acccess control (TRANSIENT)
var colname_runtime := bat(str,bat).rename("colname_runtime");
# bat[str,bat] runtime index/lock bat-of-bat
@@ -739,14 +742,6 @@
# of those, all master rid_* bats, and their (remapped) pre_*
views
ws_mem := ws_mem.slice(NID_RID, INT_MAX).rename("ws_mem");
-# silently clean up the repository
-collection_cleanup(_collection_cleanup());
-
-# start the background processes
-xquery_start_query_cache(lng(monet_environment.find("xquery_procMB")) * 1024LL
* 1024LL);
-mapi_register(xquery_frontend());
-
-
# scans for empty collections, and produces a list of kill-bats (fast - done
inside the short lock)
PROC _collection_cleanup() : BAT[str,str]
{
@@ -3248,6 +3243,7 @@
shredded documents (with 'shred_doc(location,name)'), the name is an 'alias'
and\n\
may differ from the URI. Explicitly shredded documents fall outside the XML
document\n\
cache; documents are only removed at explicit user request (with
'delete_doc(name)').";
[EMAIL PROTECTED]
PROC xmlcache_add_rule(str uri,
any lifetime) : void
@@ -3306,6 +3302,24 @@
ADDHELP("xmldb_print", "boncz", "May 2005",
"DESCRIPTION:\nshows the actual content of the persistent XML document
database (not the XML document cache).\n\nThis consists of all documents
explicitly shredded with shred_doc(URI, alias).", "pathfinder");
[EMAIL PROTECTED] startup sequence
[EMAIL PROTECTED]
+# start the query cache
+xquery_start_query_cache(lng(monet_environment.find("xquery_procMB")) * 1024LL
* 1024LL);
+
+xquery_status := XQUERY_STATUS_RECOVERING;
+var pf_logger := logger_create(0, "xquery",
monet_environment.find("xquery_logdir"),
+
monet_environment.find("gdk_dbname"), LOGGER_VERSION);
+
+xquery_status := XQUERY_STATUS_GARBAGECOLL;
+cleantmpdir(msec() / 1000LL); # delete tmp files in
DBFARM/DBNAME/tmp
+collection_cleanup(_collection_cleanup()); # silently clean up the repository
+
+xquery_status := XQUERY_STATUS_READY;
+mapi_register(xquery_frontend()); # open up mapi client access
+rpcd_start(); # open up xrpc access
+fork(pf_logmanager()); # start checkpointing thread
+
@= ws_c_decl
#define @1 @2
Index: xrpc_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -u -d -r1.7.2.4 -r1.7.2.5
--- xrpc_server.mx 8 Feb 2007 18:15:29 -0000 1.7.2.4
+++ xrpc_server.mx 12 Feb 2007 22:51:42 -0000 1.7.2.5
@@ -46,6 +46,14 @@
.END xrpc_server;
@mil
+# initialize xrpcd_admin: IPs that can execute modules from the special admin/
directory
+var xrpc_admin := bat(str,void);
+xrpc_admin.insert(reverse(split(monet_environment.find("xrpc_admin"),";"))).bbpname("xrpc_admin");
+
+# initialize xrpcd_trusted: URL prefixes for modules that anybody can execute
+var xrpc_trusted := bat(str,void);
+xrpc_trusted.insert(reverse(split(monet_environment.find("xrpc_trusted"),";"))).bbpname("xrpc_trusted");
+
PROC rpcd_start(int port, str options) : void {
fork(httpd_start(port, options));
}
@@ -68,12 +76,24 @@
"xrpc_server");
PROC rpcd_start() : void {
- rpcd_start( int(monet_environment.find("xquery_httpd_port")), "");
+ var mapi_port := int(monet_environment.find("mapi_port"));
+ var xrpc_port := int_nil;
+ if (monet_environment.exist("xrpc_port"))
+ xrpc_port := int(monet_environment.find("xrpc_port"));
+ if (isnil(xrpc_port))
+ xrpc_port := mapi_port+1;
+
+ var xrpc_open := "";
+ if (monet_environment.exist("xrpc_open"))
+ if (monet_environment.find("xrpc_open") = "yes")
+ xrpc_open := "open";
+
+ rpcd_start( xrpc_port, xrpc_open);
}
ADDHELP("rpcd_start", "zhang", "November 2005",
"DESCRIPTION:\n\
Start XPRC receiver on the default port as specified in \
-\"monet_environment\" by \"xquery_httpd_port\"",
+\"monet_environment\" by \"xrpc_port\"",
"xrpc_server");
@h
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins