Changeset: 55583d028162 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55583d028162
Modified Files:
sql/backends/monet5/miniseed/miniseed.c
sql/backends/monet5/miniseed/miniseed.mal
Branch: DVframework
Log Message:
mseed.mount uses thread-safe calls of the libmseed. So mount calls are also in
the dataflow block.
diffs (42 lines):
diff --git a/sql/backends/monet5/miniseed/miniseed.c
b/sql/backends/monet5/miniseed/miniseed.c
--- a/sql/backends/monet5/miniseed/miniseed.c
+++ b/sql/backends/monet5/miniseed/miniseed.c
@@ -15,6 +15,7 @@ str MiniseedMount(Client cntxt, MalBlkPt
wrd num_rows = 0;
MSRecord *msr = NULL;
+ MSFileParam *msfp = NULL;
int retcode;
int verbose = 1;
int r;
@@ -71,9 +72,8 @@ str MiniseedMount(Client cntxt, MalBlkPt
}
/* loop through all records in the target mseed file. */
- while ((retcode = ms_readmsr (&msr, *targetfile, 0, NULL, NULL, 1, 1,
verbose)) == MS_NOERROR)
+ while ((retcode = ms_readmsr_r (&msfp, &msr, *targetfile, 0, NULL,
NULL, 1, 1, verbose)) == MS_NOERROR)
{
-
int seq_no = seq_no_fake;
double sample_interval = HPTMODULUS / msr->samprate; /*
calculate sampling interval from frequency */
long sampling_time = msr->starttime;
@@ -105,7 +105,7 @@ str MiniseedMount(Client cntxt, MalBlkPt
ms_log (2, "Cannot read %s: %s\n", *targetfile,
ms_errorstr(retcode));
/* cleanup memory and close file */
- ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, 0);
+ ms_readmsr_r (&msfp, &msr, NULL, 0, NULL, NULL, 0, 0, 0);
printf("num_rows: %ld\n", num_rows);
high.value.val.oval= (BUN) num_rows;
diff --git a/sql/backends/monet5/miniseed/miniseed.mal
b/sql/backends/monet5/miniseed/miniseed.mal
--- a/sql/backends/monet5/miniseed/miniseed.mal
+++ b/sql/backends/monet5/miniseed/miniseed.mal
@@ -1,5 +1,5 @@
module miniseed;
-pattern mount{unsafe}(entry:str):bat[:oid,:any]...
+pattern mount(entry:str):bat[:oid,:any]...
address MiniseedMount
comment "Mount the content of a mseed file into BATs in table form";
\ No newline at end of file
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list