X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamc%2Fisamd-p.h;h=fa0b7480ee305deda8142df1cb90733f82ffc142;hb=138b954cffe470bf0e62d812cae6e859aa57cdb5;hp=843a183d90419ebd9bccb65f254780c8335eda34;hpb=f6fb80f1dfd9b1a486595496a0f43aaeb16f7b40;p=idzebra-moved-to-github.git diff --git a/isamc/isamd-p.h b/isamc/isamd-p.h index 843a183..fa0b748 100644 --- a/isamc/isamd-p.h +++ b/isamc/isamd-p.h @@ -1,10 +1,26 @@ -/* $Id: isamd-p.h,v 1.7 1999-09-20 15:48:06 heikki Exp $ - * Copyright (c) 1995-1996, Index Data. - * See the file LICENSE for details. - * Heikki Levanto - * - * log at the end - */ +/* $Id: isamd-p.h,v 1.13 2003-06-23 15:36:11 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 + 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 #include @@ -32,20 +48,15 @@ typedef struct ISAMD_file_s { int no_released; int no_remap; - int no_forward; + int no_forward; /* stats from pp_read, for isam-c compatibility */ int no_backward; int sum_forward; int sum_backward; int no_next; int no_prev; - int no_op_nodiff; /* existing blocks opened for reading without diffs */ - int no_op_intdiff; /* - with internal diffs */ - int no_op_extdiff; /* with separate diff blocks */ - int no_fbuilds; /* number of first-time builds */ - int no_appds; /* number of appends */ - int no_merges; /* number of merges done */ - int no_remerges; /* number of times more than one merge needed */ + int no_op_diffonly;/* number of opens without mainblock */ + int no_op_main; /* number of opens with a main block */ char *alloc_buf; /* free-list handling (?) */ int alloc_entries_num; @@ -58,8 +69,28 @@ typedef struct ISAMD_file_s { struct ISAMD_s { int no_files; int max_cat; - ISAMD_M method; + ISAMD_M *method; ISAMD_file files; + int last_pos; /* last read/write position for seek stats */ + int last_cat; /* same for category */ + int no_read; /* blocks read (in all categories) */ + int no_write; /* blocks written (in all categories) */ + int no_op_single;/* singleton "blocks" opened */ + int no_read_keys;/* number of keys read (occurences of words) */ + int no_read_main;/* number of main keys read (not diffs) */ + int no_read_eof; /* number of key sequence ends read (no of words read) */ + int no_seek_nxt; /* seeks to the next record (fast) */ + int no_seek_sam; /* seeks to same record (fast) */ + int no_seek_fwd; /* seeks forward */ + int no_seek_prv; /* seeks to previous */ + int no_seek_bak; /* seeks backwards */ + int no_seek_cat; /* seeks to different category (expensive) */ + int no_op_new; /* "open"s for new blocks */ + int no_fbuilds; /* number of first-time builds */ + int no_appds; /* number of appends */ + int no_merges; /* number of merges done */ + int no_non; /* merges without any work */ + int no_singles; /* new items resulting in singletons */ }; @@ -88,7 +119,7 @@ struct ISAMD_PP_s { sizeof(ISAMD_BLOCK_SIZE) + \ sizeof(ISAMD_BLOCK_SIZE)) /* == 12 (was 16) */ -// sizeof(int) + +/* sizeof(int) + */ int isamd_alloc_block (ISAMD is, int cat); @@ -97,6 +128,11 @@ int isamd_read_block (ISAMD is, int cat, int pos, char *dst); int isamd_write_block (ISAMD is, int cat, int pos, char *src); void isamd_free_diffs(ISAMD_PP pp); +int is_singleton(ISAMD_P ipos); +void singleton_decode (int code, struct it_key *k); +int singleton_encode(struct it_key *k); + + #ifdef __cplusplus } #endif @@ -105,7 +141,25 @@ void isamd_free_diffs(ISAMD_PP pp); /* * $Log: isamd-p.h,v $ - * Revision 1.7 1999-09-20 15:48:06 heikki + * Revision 1.13 2003-06-23 15:36:11 adam + * Implemented isamb_unlink. + * + * Revision 1.12 2002/11/26 22:18:34 adam + * Remove // comments + * + * Revision 1.11 2002/08/02 19:26:56 adam + * Towards GPL + * + * Revision 1.10 2002/04/29 18:10:24 adam + * Newline at end of file + * + * Revision 1.9 1999/10/05 09:57:40 heikki + * Tuning the isam-d (and fixed a small "detail") + * + * Revision 1.8 1999/09/23 18:01:18 heikki + * singleton optimising + * + * Revision 1.7 1999/09/20 15:48:06 heikki * Small changes * * Revision 1.6 1999/08/25 18:09:23 heikki @@ -125,4 +179,5 @@ void isamd_free_diffs(ISAMD_PP pp); * Copied from isamh, starting to change things... * * - */ \ No newline at end of file + */ +