Changeset: ff8caae13261 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff8caae13261
Modified Files:
        sql/backends/monet5/vaults/bam/bam_db_interface.h
        sql/backends/monet5/vaults/bam/bam_loader.c
        sql/backends/monet5/vaults/bam/bam_wrapper.c
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/lidar/lidar.c
Branch: tracer
Log Message:

Replaced components in files: lidar, fits, bam_*. Now they belong to separate 
category and not in one of the main layers


diffs (truncated from 493 to 300 lines):

diff --git a/sql/backends/monet5/vaults/bam/bam_db_interface.h 
b/sql/backends/monet5/vaults/bam/bam_db_interface.h
--- a/sql/backends/monet5/vaults/bam/bam_db_interface.h
+++ b/sql/backends/monet5/vaults/bam/bam_db_interface.h
@@ -38,7 +38,7 @@
 }
 #endif */
 #define RUN_SQL(cntxt, sql, descr, msg) {                           \
-       DEBUG(SQL_BAM, "%s\n", sql);                                    \
+       DEBUG(BAM, "%s\n", sql);                                    \
        msg = SQLstatementIntern(cntxt, sql, descr, TRUE, FALSE, NULL); \
 }
 
diff --git a/sql/backends/monet5/vaults/bam/bam_loader.c 
b/sql/backends/monet5/vaults/bam/bam_loader.c
--- a/sql/backends/monet5/vaults/bam/bam_loader.c
+++ b/sql/backends/monet5/vaults/bam/bam_loader.c
@@ -119,14 +119,14 @@ run_process_bam_alignments(void *d)
        bam_wrapper *bw;
 
        for (;;) {
-               DEBUG(SQL_BAM, "<Thread %d> Starting on next file\n", 
data->thread_id);
+               DEBUG(BAM, "<Thread %d> Starting on next file\n", 
data->thread_id);
                /* First, find out on which bam wrapper we have to work */
                MT_lock_set(data->reader_lock);
                if (*data->cur_file == data->nr_files - 1) {
                        /* The last file is already (being) processed, this
                         * thread is done */
                        MT_lock_unset(data->reader_lock);
-                       DEBUG(SQL_BAM, 
+                       DEBUG(BAM, 
                                "<Thread %d> No files left to work on; thread 
done\n",
                                data->thread_id);
                        return;
@@ -134,7 +134,7 @@ run_process_bam_alignments(void *d)
                (*data->cur_file) += 1;
                bw = &data->bws[*data->cur_file];
                MT_lock_unset(data->reader_lock);
-               DEBUG(SQL_BAM, 
+               DEBUG(BAM, 
                        "<Thread %d> Processing alignments of file '%s' (file 
id " LLFMT ")\n", 
                        data->thread_id, bw->file_location, bw->file_id);
 
@@ -153,7 +153,7 @@ run_process_bam_alignments(void *d)
                        return;
                }
 
-               DEBUG(SQL_BAM, 
+               DEBUG(BAM, 
                        "<Thread %d> All alignments in file '%s' (file id " 
LLFMT ") processed!\n", 
                        data->thread_id, bw->file_location, bw->file_id);
        }
@@ -187,7 +187,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
        int i, errnr;
        str msg = MAL_SUCCEED;
 
-       DEBUG(SQL_BAM, "Loader started for %d BAM file%s\n", nr_files, 
(nr_files != 1 ? "s" : ""));
+       DEBUG(BAM, "Loader started for %d BAM file%s\n", nr_files, (nr_files != 
1 ? "s" : ""));
 
        /* Check sanity of input */
        if (dbschema != 0 && dbschema != 1) {
@@ -222,7 +222,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
                goto cleanup;
 
        /* Get next file id from files table */
-       DEBUG(SQL_BAM, "Retrieving next file id\n");
+       DEBUG(BAM, "Retrieving next file id\n");
        if ((msg = next_file_id(m, files_table, &cur_file_id)) != MAL_SUCCEED) {
                goto cleanup;
        }
@@ -240,7 +240,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
 
        for (i = 0; i < nr_files; ++i) {
                int fln = strlen(filenames[i]);
-               DEBUG(SQL_BAM, "Initializing BAM wrapper for file '%s'\n", 
filenames[i]);
+               DEBUG(BAM, "Initializing BAM wrapper for file '%s'\n", 
filenames[i]);
                if ((msg =
                         init_bam_wrapper(bws + i, (IS_BAM(filenames[i], fln) ? 
BAM : SAM),
                                          filenames[i], cur_file_id++, 
dbschema)) != MAL_SUCCEED) {
@@ -250,7 +250,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
 
        /* Parse all headers */
        for (i = 0; i < nr_files; ++i) {
-               DEBUG(SQL_BAM, "Parsing header for file '%s'\n",
+               DEBUG(BAM, "Parsing header for file '%s'\n",
                           filenames[i]);
                if ((msg = process_header(bws + i)) != MAL_SUCCEED) {
                        goto cleanup;
@@ -262,7 +262,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
         * QNAME */
        if (dbschema == 1) {
                for (i = 0; i < nr_files; ++i) {
-                       DEBUG(SQL_BAM, "Checking sortedness for BAM file 
'%s'\n", filenames[i]);
+                       DEBUG(BAM, "Checking sortedness for BAM file '%s'\n", 
filenames[i]);
                        if (bws[i].ord != ORDERING_QUERYNAME) {
                                msg = createException(MAL, "bam_loader",
                                                          SQLSTATE(BA000) "Only 
BAM files that are sorted on queryname can be inserted into the pairwise 
storage schema; "
@@ -277,7 +277,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
 
        /* Create alignment storage */
        for (i = 0; i < nr_files; ++i) {
-               DEBUG(SQL_BAM, "Creating alignment tables for file '%s'\n", 
filenames[i]);
+               DEBUG(BAM, "Creating alignment tables for file '%s'\n", 
filenames[i]);
                if ((dbschema == 0
                         && (msg = create_alignment_storage_0(cntxt,
                                                                  
"bam.create_storage_0",
@@ -292,7 +292,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
 
 
        /* Now create threads to read alignment data of different files */
-       DEBUG(SQL_BAM, "Creating reader threads\n");
+       DEBUG(BAM, "Creating reader threads\n");
        if ((reader_threads =
                 (MT_Id *) GDKmalloc(nr_threads * sizeof(MT_Id))) == NULL) {
                msg = createException(MAL, "bam_loader", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
@@ -319,7 +319,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
                }
        }
 
-       DEBUG(SQL_BAM, "Waiting for reader threads to finish\n");
+       DEBUG(BAM, "Waiting for reader threads to finish\n");
        /* Wait until all threads finish and collect their
         * messages. Though it is not very likely, it could be the
         * case that more than 1 thread generates an error message (not
@@ -365,7 +365,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
                goto cleanup;
        }
 
-       DEBUG(SQL_BAM, "Copying data into DB\n");
+       DEBUG(BAM, "Copying data into DB\n");
        /* All threads finished succesfully, copy all data into DB */
        for (i = 0; i < nr_files; ++i) {
                if ((msg = copy_into_db(cntxt, bws + i)) != MAL_SUCCEED) {
@@ -390,7 +390,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s
                ERROR(M_ALL, "Error on processing BAM files: %s\n", msg);
        }
 
-       DEBUG(SQL_BAM, "Loader finished processing %d BAM file%s\n", nr_files, 
(nr_files != 1 ? "s" : ""));
+       DEBUG(BAM, "Loader finished processing %d BAM file%s\n", nr_files, 
(nr_files != 1 ? "s" : ""));
        return msg;
 }
 
diff --git a/sql/backends/monet5/vaults/bam/bam_wrapper.c 
b/sql/backends/monet5/vaults/bam/bam_wrapper.c
--- a/sql/backends/monet5/vaults/bam/bam_wrapper.c
+++ b/sql/backends/monet5/vaults/bam/bam_wrapper.c
@@ -1328,11 +1328,11 @@ check_alignment_buffers(bam_wrapper *bw,
        }
 
        if (resized[0])
-               DEBUG(SQL_BAM, "Increased size of qname buffer to: %d 
characters\n", alig->qname_size);
+               DEBUG(BAM, "Increased size of qname buffer to: %d 
characters\n", alig->qname_size);
        if (resized[1])
-               DEBUG(SQL_BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->cigar_size);
+               DEBUG(BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->cigar_size);
        if (resized[2])
-               DEBUG(SQL_BAM, "Increased size of seq and qual buffers to: %d 
characters\n", alig->seq_size);
+               DEBUG(BAM, "Increased size of seq and qual buffers to: %d 
characters\n", alig->seq_size);
 
        return (alig->cigar != NULL && alig->seq != NULL
                && alig->qual != NULL);
@@ -1357,7 +1357,7 @@ check_qname_buffer(alignment * alig, int
                if (tmp == NULL)
                        return 0;
                alig->qname = tmp;
-               DEBUG(SQL_BAM, "Increased size of qname buffer to: %d 
characters\n", alig->qname_size);
+               DEBUG(BAM, "Increased size of qname buffer to: %d 
characters\n", alig->qname_size);
        }
        return alig->qname != NULL;
 }
@@ -1379,7 +1379,7 @@ check_rname_rnext_buffers(alignment * al
                if (tmp == NULL)
                        return 0;
                alig->rnext = tmp;
-               DEBUG(SQL_BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->rname_size);
+               DEBUG(BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->rname_size);
        }
        return alig->rname != NULL && alig->rnext != NULL;
 }
@@ -1397,7 +1397,7 @@ check_cigar_buffer(alignment * alig, int
                if (tmp == NULL)
                        return 0;
                alig->cigar = tmp;
-               DEBUG(SQL_BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->cigar_size);
+               DEBUG(BAM, "Increased size of cigar buffer to: %d 
characters\n", alig->cigar_size);
        }
        return alig->cigar != NULL;
 }
@@ -1418,7 +1418,7 @@ check_seq_qual_buffers(alignment * alig,
                if (tmp == NULL)
                        return 0;
                alig->qual = tmp;
-               DEBUG(SQL_BAM, "Increased size of seq and qual buffers to: %d 
characters\n", alig->seq_size);
+               DEBUG(BAM, "Increased size of seq and qual buffers to: %d 
characters\n", alig->seq_size);
        }
        return alig->seq != NULL && alig->qual != NULL;
 }
@@ -1435,7 +1435,7 @@ check_aux_buffer(alignment * alig, int c
                if (tmp == NULL)
                        return 0;
                alig->aux = tmp;
-               DEBUG(SQL_BAM, "Increased size of aux buffer to: %d 
characters\n", alig->aux_size);
+               DEBUG(BAM, "Increased size of aux buffer to: %d characters\n", 
alig->aux_size);
        }
        return alig->aux != NULL;
 }
@@ -2318,7 +2318,7 @@ process_alignments(bam_wrapper * bw, bit
                                                }
                                        }
                                        nr_aligs = new_nr_aligs;
-                                       DEBUG(SQL_BAM, "<bam_loader> Increased 
size of alignment buffer to: %d alignments\n", nr_aligs);
+                                       DEBUG(BAM, "<bam_loader> Increased size 
of alignment buffer to: %d alignments\n", nr_aligs);
                                }
                        }
                }
diff --git a/sql/backends/monet5/vaults/fits/fits.c 
b/sql/backends/monet5/vaults/fits/fits.c
--- a/sql/backends/monet5/vaults/fits/fits.c
+++ b/sql/backends/monet5/vaults/fits/fits.c
@@ -227,7 +227,7 @@ str FITSexportTable(Client cntxt, MalBlk
                throw(MAL, "fits.exporttable", SQLSTATE(HY001) MAL_MALLOC_FAIL);
        }
 
-       DEBUG(SQL_FITS, "Number of columns: %d\n", columns);
+       DEBUG(FITS, "Number of columns: %d\n", columns);
 
        tables = mvc_bind_table(m, sch, "_tables");
        col = mvc_bind_column(m, tables, "name");
@@ -545,14 +545,14 @@ str FITSexportTable(Client cntxt, MalBlk
 
         
        // print all the times that were needed to export each one of the 
columns
-       if (texportboolean > 0)         DEBUG(SQL_FITS, "%d Boolean\tcolumn(s) 
exported in %d ms\n", boolcols, texportboolean);
-       if (texportchar > 0)            DEBUG(SQL_FITS, "%d Char\t\tcolumn(s) 
exported in %d ms\n", charcols, texportchar);
-       if (texportstring > 0)          DEBUG(SQL_FITS, "%d String\tcolumn(s) 
exported in %d ms\n", strcols, texportstring);
-       if (texportshort > 0)           DEBUG(SQL_FITS, "%d Short\t\tcolumn(s) 
exported in %d ms\n", shortcols, texportshort);
-       if (texportint > 0)                     DEBUG(SQL_FITS, "%d 
Integer\tcolumn(s) exported in %d ms\n", intcols, texportint);
-       if (texportlng > 0)                     DEBUG(SQL_FITS, "%d 
Long\t\tcolumn(s) exported in %d ms\n", lngcols, texportlng);
-       if (texportfloat > 0)           DEBUG(SQL_FITS, "%d Float\t\tcolumn(s) 
exported in %d ms\n", floatcols, texportfloat);
-       if (texportdouble > 0)          DEBUG(SQL_FITS, "%d Double\tcolumn(s) 
exported in %d ms\n", doublecols, texportdouble);
+       if (texportboolean > 0)         DEBUG(FITS, "%d Boolean\tcolumn(s) 
exported in %d ms\n", boolcols, texportboolean);
+       if (texportchar > 0)            DEBUG(FITS, "%d Char\t\tcolumn(s) 
exported in %d ms\n", charcols, texportchar);
+       if (texportstring > 0)          DEBUG(FITS, "%d String\tcolumn(s) 
exported in %d ms\n", strcols, texportstring);
+       if (texportshort > 0)           DEBUG(FITS, "%d Short\t\tcolumn(s) 
exported in %d ms\n", shortcols, texportshort);
+       if (texportint > 0)                     DEBUG(FITS, "%d 
Integer\tcolumn(s) exported in %d ms\n", intcols, texportint);
+       if (texportlng > 0)                     DEBUG(FITS, "%d 
Long\t\tcolumn(s) exported in %d ms\n", lngcols, texportlng);
+       if (texportfloat > 0)           DEBUG(FITS, "%d Float\t\tcolumn(s) 
exported in %d ms\n", floatcols, texportfloat);
+       if (texportdouble > 0)          DEBUG(FITS, "%d Double\tcolumn(s) 
exported in %d ms\n", doublecols, texportdouble);
 
 
        fits_close_file(fptr, &status);
@@ -590,7 +590,7 @@ str FITSdir(Client cntxt, MalBlkPtr mb, 
                        fits_open_file(&fptr, fname, READONLY, &status);
                        if (status == 0) {
                                snprintf(stmt, BUFSIZ, ATTACHDIR, fname);
-                               DEBUG(SQL_FITS, "Executing: %s\n", s);
+                               DEBUG(FITS, "Executing: %s\n", s);
                                msg = SQLstatementIntern(cntxt, &s, 
"fits.listofdir", TRUE, FALSE, NULL);
                                fits_close_file(fptr, &status);
                        }
@@ -623,7 +623,7 @@ str FITSdirpat(Client cntxt, MalBlkPtr m
        snprintf(fulldirectory, BUFSIZ, "%s%s", dir, pat);
        glob(fulldirectory, GLOB_DOOFFS, NULL, &globbuf);
 
-       DEBUG(SQL_FITS, "Fulldir: %s - Size: %lu\n", fulldirectory, 
globbuf.gl_pathc);
+       DEBUG(FITS, "Fulldir: %s - Size: %lu\n", fulldirectory, 
globbuf.gl_pathc);
 
        if (globbuf.gl_pathc == 0)
                throw(MAL, "fits.listdirpat", SQLSTATE(FI000) "Couldn't open 
the directory or there are no files that match the pattern");
@@ -643,7 +643,7 @@ str FITSdirpat(Client cntxt, MalBlkPtr m
                if (status == 0) {
                        snprintf(stmt, BUFSIZ, ATTACHDIR, filename);
                        GDKfree(filename);
-                       DEBUG(SQL_FITS, "Executing: %s\n", s);
+                       DEBUG(FITS, "Executing: %s\n", s);
                        msg = SQLstatementIntern(cntxt, &s, 
"fits.listofdirpat", TRUE, FALSE, NULL);
                        fits_close_file(fptr, &status);
 
@@ -961,7 +961,7 @@ str FITSloadTable(Client cntxt, MalBlkPt
                fits_get_coltype(fptr, j, &tpcode[j - 1], &rep[j - 1], &wid[j - 
1], &status);
                fits2subtype(&tpe, tpcode[j - 1], rep[j - 1], wid[j - 1]);
 
-               DEBUG(SQL_FITS, "%d %ld %ld - M: %s\n", tpcode[j-1], rep[j-1], 
wid[j-1], tpe.type->sqlname);
+               DEBUG(FITS, "%d %ld %ld - M: %s\n", tpcode[j-1], rep[j-1], 
wid[j-1], tpe.type->sqlname);
 
                mvc_create_column(m, tbl, cname[j - 1], &tpe);
        }
diff --git a/sql/backends/monet5/vaults/lidar/lidar.c 
b/sql/backends/monet5/vaults/lidar/lidar.c
--- a/sql/backends/monet5/vaults/lidar/lidar.c
+++ b/sql/backends/monet5/vaults/lidar/lidar.c
@@ -71,93 +71,93 @@ void print_lidar_header(LASHeaderH heade
     major = LASHeader_GetVersionMajor(header);
     minor = LASHeader_GetVersionMinor(header);
 
-    DEBUG(SQL_LIDAR, 
"---------------------------------------------------------\n");
-    DEBUG(SQL_LIDAR, "  Header Summary\n");
-    DEBUG(SQL_LIDAR, 
"---------------------------------------------------------\n");
+    DEBUG(LIDAR, 
"---------------------------------------------------------\n");
+    DEBUG(LIDAR, "  Header Summary\n");
+    DEBUG(LIDAR, 
"---------------------------------------------------------\n");
 
-    DEBUG(SQL_LIDAR, "  File Name: %s\n", file_name);
+    DEBUG(LIDAR, "  File Name: %s\n", file_name);
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to