Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19883/compiler/mil
Modified Files:
Tag: M5XQ
milgen.brg
Log Message:
propagated changes of Friday Oct 16 2009
from the development trunk to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/10/16 - sjoerd: compiler/mil/milgen.brg,1.226
propagated changes of Friday Oct 16 2009
from the Nov2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/10/16 - sjoerd: compiler/mil/milgen.brg,1.222.2.3
propagated changes of Friday Oct 16 2009
from the Aug2009_NFI branch to the Nov2009 branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/10/16 - tsheyar: compiler/mil/milgen.brg,1.221.2.1.2.4
-- Partial undo of Peters checkin: optimizations for NFI XIRAF use case
(Sep, 29)
The session information is not detected by the mclient pre-parser
anymore.
(For more information on the replacement continue reading...)
-- Added detection of session information in the pathfinder compiler.
The new version now looks for the global options 'pf:session-id',
'pf:session-timeout', and 'pf:session-mode'. In addition pathfinder
internally transforms the 'old' solution (session pragmas) into global
options.
Example: The following queries are now equivalent -- they both use
session
'foo' in a read-only scenario and keep it alive for another 42
milliseconds:
declare option pf:session-id "foo";
declare option pf:session-timeout "42";
declare option pf:session-mode "use-cache-repeatable";
1
(# pf:session-use foo:42 #) { 1 }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U milgen.brg
Index: milgen.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milgen.brg,v
retrieving revision 1.215.2.10
retrieving revision 1.215.2.11
diff -u -d -r1.215.2.10 -r1.215.2.11
--- milgen.brg 8 Oct 2009 17:18:11 -0000 1.215.2.10
+++ milgen.brg 16 Oct 2009 08:51:59 -0000 1.215.2.11
@@ -99,6 +99,8 @@
#include "mil.h"
/* XRPC function call context */
#include "core.h"
+/* use global options to lookup session information */
+#include "options.h"
/* abbreviate MIL constructor calls */
#include "mil_mnemonic.h"
@@ -11025,9 +11027,37 @@
/** @brief Compile physical algebra tree into a MIL program. */
PFmil_t *
-PFmilgen (PFpa_op_t *n, char *genType, char* qid, char *mode, long long
timeout)
+PFmilgen (PFpa_op_t *n, char *genType)
{
- PFmil_t *bodymilprog;
+ PFmil_t *bodymilprog;
+ PFarray_t *opt;
+ long long timeout = 0;
+ char *qid = "",
+ *mode = "none";
+
+ /* Retrieve session information from the global option list. */
+ opt = PFenv_lookup (PFoptions, PFqname(PFns_lib, "session-id"));
+ if (opt) {
+ qid = *((char **) PFarray_at (opt, 0));
+ if (PFarray_last(opt) > 1)
+ PFlog ("Multiple session IDs -- Choosing \"%s\".", qid);
+ }
+ opt = PFenv_lookup (PFoptions, PFqname(PFns_lib, "session-timeout"));
+ if (opt) {
+ timeout = strtoll (*((char **) PFarray_at (opt, 0)), NULL, 10);
+ if (timeout <= 0)
+ PFoops (OOPS_FATAL, "Invalid session timeout: \"%s\".",
+ *((char **) PFarray_at (opt, 0)));
+ if (PFarray_last(opt) > 1)
+ PFlog ("Multiple session timeouts -- Choosing \"%s\".",
+ *((char **) PFarray_at (opt, 0)));
+ }
+ opt = PFenv_lookup (PFoptions, PFqname(PFns_lib, "session-mode"));
+ if (opt) {
+ mode = *((char **) PFarray_at (opt, 0));
+ if (PFarray_last(opt) > 1)
+ PFlog ("Multiple session modes -- Choosing \"%s\".", mode);
+ }
assert (n);
@@ -11147,13 +11177,12 @@
declare (var (PF_MIL_VAR_XRPC_METHOD)),
declare (var (PF_MIL_VAR_XRPC_COORD)),
- assgn (var (PF_MIL_VAR_XRPC_QID), lit_str(qid?qid:"")),
+ assgn (var (PF_MIL_VAR_XRPC_QID), lit_str(qid)),
assgn (var (PF_MIL_VAR_XRPC_CALLER), lit_str("")),
assgn (var (PF_MIL_VAR_XRPC_HDL), lit_int(0)),
assgn (var (PF_MIL_VAR_XRPC_SEQNR), lit_lng(0)),
assgn (var (PF_MIL_VAR_XRPC_TIMEOUT), lit_lng(timeout)),
- assgn (var (PF_MIL_VAR_XRPC_MODE),
- lit_str (mode?mode:"none")),
+ assgn (var (PF_MIL_VAR_XRPC_MODE), lit_str (mode)),
assgn (var (PF_MIL_VAR_XRPC_MODULE), lit_str("")),
assgn (var (PF_MIL_VAR_XRPC_METHOD), lit_str("")),
assgn (var (PF_MIL_VAR_XRPC_COORD), lit_str("")),
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins