From 297ba5c5c265a5f869f43a0a211bf9f48f700add Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 18 May 2000 12:01:36 +0000 Subject: [PATCH] System call times(2) used again. More 64-bit fixes. --- index/extract.c | 7 +++++-- index/kinput.c | 11 +++++++---- index/trunc.c | 7 +++++-- index/zebraapi.c | 17 +++++++++++++++-- index/zserver.h | 19 +++++++++++-------- 5 files changed, 43 insertions(+), 18 deletions(-) diff --git a/index/extract.c b/index/extract.c index 386de82..269c21f 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: extract.c,v $ - * Revision 1.102 2000-05-15 15:32:33 adam + * Revision 1.103 2000-05-18 12:01:36 adam + * System call times(2) used again. More 64-bit fixes. + * + * Revision 1.102 2000/05/15 15:32:33 adam * Added 64 bit file input. * * Revision 1.101 2000/05/15 13:02:39 adam @@ -435,7 +438,7 @@ int key_open (struct recordGroup *rGroup, int mem) char *recordCompression; int record_compression = REC_COMPRESS_NONE; if (!mem) - mem = atoi(res_get_def (common_resource, "memMax", "4"))*1024*1024; + mem = atoi(res_get_def (common_resource, "memMax", "16"))*1024*1024; if (mem < 50000) mem = 50000; key_buf = (char **) xmalloc (mem); diff --git a/index/kinput.c b/index/kinput.c index 13f3685..92e64ec 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1994-1999, Index Data + * Copyright (C) 1994-2000, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss, Heikki Levanto * @@ -641,7 +641,7 @@ void zebra_index_merge (ZebraHandle zh) time (&progressInfo.lastTime); for (i = 1; i<=nkeys; i++) { - kf[i] = key_file_init (i, 32768, zh->service->res); + kf[i] = key_file_init (i, 8192, zh->service->res); kf[i]->readHandler = progressFunc; kf[i]->readInfo = &progressInfo; progressInfo.totalBytes += kf[i]->length; @@ -772,7 +772,7 @@ void key_input (BFiles bfs, int nkeys, int cache, Res res) time (&progressInfo.lastTime); for (i = 1; i<=nkeys; i++) { - kf[i] = key_file_init (i, 32768, res); + kf[i] = key_file_init (i, 8192, res); kf[i]->readHandler = progressFunc; kf[i]->readInfo = &progressInfo; progressInfo.totalBytes += kf[i]->length; @@ -831,7 +831,10 @@ void key_input (BFiles bfs, int nkeys, int cache, Res res) /* * $Log: kinput.c,v $ - * Revision 1.43 2000-03-20 19:08:36 adam + * Revision 1.44 2000-05-18 12:01:36 adam + * System call times(2) used again. More 64-bit fixes. + * + * Revision 1.43 2000/03/20 19:08:36 adam * Added remote record import using Z39.50 extended services and Segment * Requests. * diff --git a/index/trunc.c b/index/trunc.c index d446cf4..118344c 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trunc.c,v $ - * Revision 1.17 2000-03-15 15:00:30 adam + * Revision 1.18 2000-05-18 12:01:36 adam + * System call times(2) used again. More 64-bit fixes. + * + * Revision 1.17 2000/03/15 15:00:30 adam * First work on threaded version. * * Revision 1.16 1999/11/30 13:48:03 adam @@ -486,7 +489,7 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, return rset_create (rset_kind_isamc, &parms); } #if NEW_TRUNC - else if (no < 200) + else if (no < 10000) { rset_m_or_parms parms; diff --git a/index/zebraapi.c b/index/zebraapi.c index 80d362e..b8181a5 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -3,7 +3,10 @@ * All rights reserved. * * $Log: zebraapi.c,v $ - * Revision 1.32 2000-04-19 14:35:59 adam + * Revision 1.33 2000-05-18 12:01:36 adam + * System call times(2) used again. More 64-bit fixes. + * + * Revision 1.32 2000/04/19 14:35:59 adam * WIN32 update (this version is known not to work on Windows). * * Revision 1.31 2000/04/05 10:07:02 adam @@ -159,11 +162,21 @@ static int zebra_register_lock (ZebraHandle zh) zh->errCode = 1019; return 1; } +#if HAVE_SYS_TIMES_H + times (&zh->tms1); +#endif return 0; } static void zebra_register_unlock (ZebraHandle zh) { +#if HAVE_SYS_TIMES_H + times (&zh->tms2); + logf (LOG_LOG, "user/system: %ld/%ld", + (long) (zh->tms2.tms_utime - zh->tms1.tms_utime), + (long) (zh->tms2.tms_stime - zh->tms1.tms_stime)); + +#endif } ZebraHandle zebra_open (ZebraService zs) @@ -272,7 +285,7 @@ static int zebra_register_activate (ZebraService zh) logf (LOG_WARN, "rec_open"); return -1; } - if (!(zh->dict = dict_open (zh->bfs, FNAME_DICT, 40, 1, 0))) + if (!(zh->dict = dict_open (zh->bfs, FNAME_DICT, 80, 1, 0))) { logf (LOG_WARN, "dict_open"); return -1; diff --git a/index/zserver.h b/index/zserver.h index 8da07ff..8680d43 100644 --- a/index/zserver.h +++ b/index/zserver.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.h,v $ - * Revision 1.48 2000-04-05 09:49:35 adam + * Revision 1.49 2000-05-18 12:01:36 adam + * System call times(2) used again. More 64-bit fixes. + * + * Revision 1.48 2000/04/05 09:49:35 adam * On Unix, zebra/z'mbol uses automake. * * Revision 1.47 2000/03/20 19:08:36 adam @@ -222,10 +225,6 @@ struct zebra_service { ZebraLockHandle server_lock_cmt; ZebraLockHandle server_lock_org; char *server_path_prefix; -#if HAVE_SYS_TIMES_H - struct tms tms1; - struct tms tms2; -#endif data1_handle dh; ZebraMaps zebra_maps; ZebraRankClass rank_classes; @@ -272,6 +271,10 @@ struct zebra_session { int errCode; int hits; char *errString; +#if HAVE_SYS_TIMES_H + struct tms tms1; + struct tms tms2; +#endif }; struct rank_control { @@ -354,9 +357,9 @@ void zebra_index_merge (ZebraHandle zh); struct zebra_fetch_control { - int offset_end; - int record_offset; - int record_int_pos; + off_t offset_end; + off_t record_offset; + off_t record_int_pos; const char *record_int_buf; int record_int_len; int fd; -- 1.7.10.4