Changeset: d1e64f869d9d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d1e64f869d9d
Modified Files:
sql/backends/monet5/datacell/actuator.mx
sql/backends/monet5/datacell/emitter.mx
sql/backends/monet5/datacell/receptor.mx
Branch: default
Log Message:
Minor admin fixes
The events stream from sensor to actuator, but not 100% correctly.
diffs (106 lines):
diff --git a/sql/backends/monet5/datacell/actuator.mx
b/sql/backends/monet5/datacell/actuator.mx
--- a/sql/backends/monet5/datacell/actuator.mx
+++ b/sql/backends/monet5/datacell/actuator.mx
@@ -46,7 +46,7 @@
#include "dcsocket.h"
-#define _DEBUG_ACTUATOR_
+/* #define _DEBUG_ACTUATOR_ */
#define ACout GDKout
FILE *fd;
@@ -87,7 +87,7 @@
mnstr_printf(ACout, "--actuator=<actuator name> to identify the event
received \n");
mnstr_printf(ACout, "--server run as a server (default)\n");
mnstr_printf(ACout, "--client run as a client\n");
- mnstr_printf(ACout, "--events=<number> number of events to receive
\n");
+ mnstr_printf(ACout, "--events=<number> number of events to receive
(default -1)\n");
mnstr_printf(ACout, "--statistics=<number> show statistics after a
series of events\n");
exit(-1);
}
@@ -114,7 +114,7 @@
static int characters = 0;
/* control the display and auto terminate the actuator */
-static int events = 1;
+static int events = -1;
static int tuples = 0;
@-
@@ -396,7 +396,7 @@
received++;
tuples++;
if (trace)
- mnstr_printf(ACout, "%s\n", buf);
+ mnstr_printf(ACout, "%s%s", buf,
(buf[m-1]=='\n'?"":"\n"));
/*mnstr_printf(ACout, "Received tuple[%d]:%s\n",received,buf);*/
endptr = 0;
@@ -420,7 +420,6 @@
if( statistics && (received % statistics ) == 0) {
showStatistics();
}
- mnstr_flush(ac->fromServer);
}
if (errno == EPIPE || errno == ECONNRESET) {
mnstr_printf(ACout, "errno:%s\n", strerror(errno));
diff --git a/sql/backends/monet5/datacell/emitter.mx
b/sql/backends/monet5/datacell/emitter.mx
--- a/sql/backends/monet5/datacell/emitter.mx
+++ b/sql/backends/monet5/datacell/emitter.mx
@@ -233,8 +233,7 @@
em->table.format[j].c[0] = BATcopy(b,b->htype, b->ttype,FALSE);;
em->table.format[j].ci[0] = bat_iterator(b);
em->table.format[j].name = GDKstrdup(baskets[idx].cols[i]);
- em->table.format[j].sep =
- j <= len - 1 ? GDKstrdup(",") : GDKstrdup("]\n");
+ em->table.format[j].sep = GDKstrdup(",");
em->table.format[j].seplen =
(int)strlen(em->table.format[j].sep);
em->table.format[j].type = ATOMname(b->ttype);
em->table.format[j].adt = (b)->ttype;
@@ -247,6 +246,9 @@
em->table.format[j].data = GDKmalloc(em->table.format[j].len);
j++;
}
+ GDKfree(em->table.format[j-1].sep);
+ em->table.format[j-1].sep = GDKstrdup("\n");
+ em->table.format[j-1].seplen = (int)strlen(em->table.format[j-1].sep);
em->table.nr_attrs = j;
(void)ret;
diff --git a/sql/backends/monet5/datacell/receptor.mx
b/sql/backends/monet5/datacell/receptor.mx
--- a/sql/backends/monet5/datacell/receptor.mx
+++ b/sql/backends/monet5/datacell/receptor.mx
@@ -192,6 +192,8 @@
} RCrecord, *Receptor;
static Receptor rcAnchor = NULL;
+static str rcError = NULL;
+static int rcErrorEvent = 0;
static int protocol = TCP;
static str RCstartThread(Receptor rc);
@@ -589,7 +591,13 @@
line = buf;
e = strchr(line, '\n');
if (e == 0) {
- mnstr_printf(RCout,
"#gobbled event %d %d :%s \n", m, n, line);
+ /* only keep the last
errorenous event for analysis */
+ if ( rcError )
+
GDKfree(rcError);
+ rcError= (char*)
GDKmalloc(strlen(line)+1 );
+ if ( rcError)
+
strncpy(rcError,line, strlen(line) + 1);
+ rcErrorEvent = cnt;
cnt--;
break;
}
@@ -837,6 +845,8 @@
Receptor rc = rcAnchor;
for ( ; rc; rc= rc->nxt)
dumpReceptor(rc);
+ if ( rcError)
+ mnstr_printf(GDKout,"#last error event %d:%s", rcErrorEvent,
rcError);
return MAL_SUCCEED;
}
@}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list