Improved installation. Updated for inclusion of YAZ header files.
[idzebra-moved-to-github.git] / isamc / isamd.c
index 191a51c..7333d31 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1995-1998, Index Data.
  * See the file LICENSE for details.
- * $Id: isamd.c,v 1.16 1999-10-05 09:57:40 heikki Exp $ 
+ * $Id: isamd.c,v 1.19 1999-11-30 13:48:04 adam Exp $ 
  *
  * Isamd - isam with diffs 
  * Programmed by: Heikki Levanto
@@ -17,7 +17,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <log.h>
+#include <yaz/log.h>
 #include "../index/index.h"  /* isamd uses the internal structure of it_key */
 #include "isamd-p.h"
 
@@ -37,13 +37,14 @@ ISAMD_M isamd_getmethod (ISAMD_M me)
         {    32,   40 },  /* 24 is the smallest unreasonable size! */
        {    64,    0 },
 #else
-        {    32,    1 },
         {    64,    1 },
        {   128,    1 },
-        {   512,    1 },
+       {   256,    1 },
+       {   512,    1 },
+        {  1024,    1 },
         {  2048,    1 },
-        {  8192,    1 },
-        { 32768,    0 },
+        {  4096,    1 },
+        {  8192,    0 },
 
 #endif
 #ifdef SKIPTHIS
@@ -179,6 +180,8 @@ ISAMD isamd_open (BFiles bfs, const char *name, int writeflag, ISAMD_M method)
 
 int isamd_block_used (ISAMD is, int type)
 {
+    if ( type==-1) /* singleton */
+      return 0; 
     if (type < 0 || type >= is->no_files)
        return -1;
     return is->files[type].head.lastblock-1;
@@ -187,6 +190,8 @@ int isamd_block_used (ISAMD is, int type)
 int isamd_block_size (ISAMD is, int type)
 {
     ISAMD_filecat filecat = is->method->filecat;
+    if ( type==-1) /* singleton */
+      return 0; /* no bytes used */ 
     if (type < 0 || type >= is->no_files)
        return -1;
     return filecat[type].bsize;
@@ -246,14 +251,14 @@ int isamd_close (ISAMD is)
                   is->files[i].no_op_main,
                   is->files[i].no_op_diffonly);
         }
-        logf(LOG_LOG,"single   %8d", is->no_op_single);
-        logf(LOG_LOG,"new      %8d", is->no_op_new);
+        logf(LOG_LOG,"open single  %8d", is->no_op_single);
+        logf(LOG_LOG,"open new     %8d", is->no_op_new);
 
         logf(LOG_LOG, "new build   %8d", is->no_fbuilds);
         logf(LOG_LOG, "append      %8d", is->no_appds);
         logf(LOG_LOG, "  merges    %8d", is->no_merges);
         logf(LOG_LOG, "  singles   %8d", is->no_singles);
-        logf(LOG_LOG, "  non       %8d", is->no_non);
+        logf(LOG_LOG, "  no-ops    %8d", is->no_non);
 
         logf(LOG_LOG, "read blocks %8d", is->no_read);
         logf(LOG_LOG, "read keys:  %8d %8.1f k/bl", 
@@ -845,7 +850,17 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos)
 
 /*
  * $Log: isamd.c,v $
- * Revision 1.16  1999-10-05 09:57:40  heikki
+ * Revision 1.19  1999-11-30 13:48:04  adam
+ * Improved installation. Updated for inclusion of YAZ header files.
+ *
+ * Revision 1.18  1999/10/06 15:18:13  heikki
+ *
+ * Improving block sizes again
+ *
+ * Revision 1.17  1999/10/06 11:46:36  heikki
+ * mproved statistics on isam-d
+ *
+ * Revision 1.16  1999/10/05 09:57:40  heikki
  * Tuning the isam-d (and fixed a small "detail")
  *
  * Revision 1.15  1999/09/27 14:36:36  heikki
@@ -886,4 +901,4 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos)
  * Copied from isamh, starting to change things...
  *
  *
- */
\ No newline at end of file
+ */