-/*
- * Copyright (C) 1994-1999, Index Data
- * All rights reserved.
- * Sebastian Hammer, Adam Dickmeiss, Heikki Levanto
- * log at eof
- *
- */
+/* $Id: invstat.c,v 1.33 2002-08-02 19:26:55 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
+ Index Data Aps
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Zebra; see the file LICENSE.zebra. If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+
#include <stdio.h>
#include <assert.h>
#include <string.h>
stat_info->no_dict_entries++;
stat_info->no_dict_bytes += strlen(name);
- assert (*info == sizeof(ISAMS_P));
- memcpy (&isam_p, info+1, sizeof(ISAMS_P));
-
+ if (!stat_info->zh->reg->isamd)
+ {
+ assert (*info == sizeof(ISAMS_P));
+ memcpy (&isam_p, info+1, sizeof(ISAMS_P));
+ }
if (stat_info->zh->reg->isams)
{
ISAMD_PP pp;
int occurx = 0;
struct it_key key;
-
- pp = isamd_pp_open (stat_info->zh->reg->isamd, isam_p);
+ /* printf("[%d: %d %d %d %d %d %d] ", */
+ /* info[0], info[1], info[2], info[3], info[4], info[5], info[7]);*/
+ pp = isamd_pp_open (stat_info->zh->reg->isamd, info+1, info[0]);
occur = isamd_pp_num (pp);
while (isamd_pp_read(pp, &key))
stat_info->cksum = stat_info->cksum * 65509 +
key.sysno + 11 * key.seqno;
occurx++;
+ /* printf("%d.%d ", key.sysno, key.seqno); */ /*!*/
if (-1==firstsys)
{
firstseq=key.seqno;
key.sysno, key.seqno,
occur,occurx, pp->offset);
}
+ /* printf("\n"); */ /*!*/
+#ifdef SKIPTHIS
if ( pp->is->method->debug >7 )
logf(LOG_LOG,"item %d=%d:%d says %d keys, counted %d",
isam_p, isamd_type(isam_p), isamd_block(isam_p),
occur, occurx);
+#endif
if (occurx != occur)
logf(LOG_LOG,"Count error!!! read %d, counted %d", occur, occurx);
assert (occurx == occur);
- if ( is_singleton(isam_p) )
- stat_info->no_isam_entries[SINGLETON_TYPE] += occur;
- else
- stat_info->no_isam_entries[isamd_type(isam_p)] += occur;
+ i = pp->cat;
+ if (info[1])
+ i=SINGLETON_TYPE;
+ stat_info->no_isam_entries[i] += occur;
isamd_pp_close (pp);
}
if (stat_info->zh->reg->isamb)
stat_info->isamb_levels[cat][level] ++;
stat_info->no_isam_entries[cat] += occur;
}
-
+ i=0;
while (occur > stat_info->isam_bounds[i] && stat_info->isam_bounds[i])
i++;
++(stat_info->isam_occurrences[i]);
/*
*
* $Log: invstat.c,v $
- * Revision 1.31 2002-07-11 16:16:00 heikki
+ * Revision 1.33 2002-08-02 19:26:55 adam
+ * Towards GPL
+ *
+ * Revision 1.32 2002/07/12 18:12:22 heikki
+ * Isam-D now stores small entries directly in the dictionary.
+ * Needs more tuning and cleaning...
+ *
+ * Revision 1.31 2002/07/11 16:16:00 heikki
* Fixed a bug in isamd, failed to store a single key when its bits
* did not fit into a singleton.
*