* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dcompact.c,v $
- * Revision 1.1 1999-03-09 13:07:06 adam
+ * Revision 1.2 1999-03-09 16:27:49 adam
+ * More work on SDRKit integration.
+ *
+ * Revision 1.1 1999/03/09 13:07:06 adam
* Work on dict_compact routine.
*
*/
if (!from)
return -1;
map = xmalloc ((from->head.last+1) * sizeof(*map));
- for (i = 0; i <= from->head.last; i++)
+ for (i = 0; i <= (int) (from->head.last); i++)
map[i] = -1;
to = dict_open (bfs, to_name, 0, 1);
if (!to)
map[0] = 0;
map[1] = DICT_pagesize(from);
- for (i = 1; i < from->head.last; i++)
+ for (i = 1; i < (int) (from->head.last); i++)
{
void *buf;
logf (LOG_LOG, "map[%d] = %d", i, map[i]);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.91 1999-02-12 13:29:22 adam
+ * Revision 1.92 1999-03-09 16:27:49 adam
+ * More work on SDRKit integration.
+ *
+ * Revision 1.91 1999/02/12 13:29:22 adam
* Implemented position-flag for registers.
*
* Revision 1.90 1999/02/02 14:50:52 adam
rGroup->flagStoreKeys = 0;
#if ZEBRASDR
- if (1)
+ if (rGroup->useSDR)
{
ZebraSdrHandle h;
char xname[128], *xp;
strncpy (xname, fname, 127);
- if ((xp = strchr (xname, '.')))
- *xp = '\0';
+ if (!(xp = strchr (xname, '.')))
+ return 0;
+ *xp = '\0';
+ if (strcmp (xp+1, "sdr.bits"))
+ return 0;
h = zebraSdr_open (xname);
if (!h)
segmentno = zebraSdr_segment (h, 0);
sprintf (sdr_name, "%%%s.%d", xname, segmentno);
- logf (LOG_LOG, "SDR: %s", sdr_name);
-#if 1
+#if 0
if (segmentno > 20)
break;
#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
- * Revision 1.60 1998-10-16 08:14:31 adam
+ * Revision 1.61 1999-03-09 16:27:49 adam
+ * More work on SDRKit integration.
+ *
+ * Revision 1.60 1998/10/16 08:14:31 adam
* Updated record control system.
*
* Revision 1.59 1998/06/08 14:43:11 adam
int fileVerboseLimit;
int databaseNamePath;
int explainDatabase;
+#if ZEBRASDR
+ int useSDR;
+#endif
data1_handle dh;
BFiles bfs;
ZebraMaps zebra_maps;
int key_qsort_compare (const void *p1, const void *p2);
void key_logdump (int mask, const void *p);
void inv_prstat (BFiles bfs);
+void inv_compact (BFiles bfs);
void key_input (BFiles bfs, int nkeys, int cache);
ISAMC_M key_isamc_m (Res res);
int merge_sort (char **buf, int from, int to);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: main.c,v $
- * Revision 1.62 1999-02-18 15:01:24 adam
+ * Revision 1.63 1999-03-09 16:27:49 adam
+ * More work on SDRKit integration.
+ *
+ * Revision 1.62 1999/02/18 15:01:24 adam
* Minor changes.
*
* Revision 1.61 1999/02/02 14:51:00 adam
#if ZEBRASDR
zebraSdr_std ();
+ rGroupDef.useSDR = 0;
#endif
rGroupDef.groupName = NULL;
rGroupDef.databaseName = NULL;
" -v <level> Set logging to <level>.\n"
" -l <file> Write log to <file>.\n"
" -f <n> Display information for the first <n> records.\n"
+#if ZEBRASDR
+ " -S Use SDRKit\n"
+#endif
" -V Show version.\n"
);
exit (1);
}
- while ((ret = options ("sVt:c:g:d:m:v:nf:l:", argv, argc, &arg)) != -2)
+ while ((ret = options ("sVt:c:g:d:m:v:nf:l:"
+#if ZEBRASDR
+ "S"
+#endif
+ , argv, argc, &arg)) != -2)
{
if (ret == 0)
{
rec_close (&records);
inv_prstat (rGroupDef.bfs);
}
+ else if (!strcmp (arg, "compact"))
+ {
+ printf ("--------- compact ------\n");
+ rval = res_get (common_resource, "shadow");
+ zebraIndexLock (rGroupDef.bfs, 0, rval);
+ if (rval && *rval)
+ {
+ bf_cache (rGroupDef.bfs, rval);
+ zebraIndexLockMsg ("r");
+ }
+ inv_compact(rGroupDef.bfs);
+ }
else
{
logf (LOG_FATAL, "unknown command: %s", arg);
}
else if (ret == 'V')
{
- fprintf (stderr, "Zebra %s %s\n", ZEBRAVER, ZEBRADATE);
+ fprintf (stderr, "Zebra %s %s\n",
+#if ZEBRASDR
+ "SDR",
+#else
+ ZEBRAVER,
+#endif
+ ZEBRADATE);
}
else if (ret == 'v')
log_init_level (log_mask_str(arg));
rGroupDef.recordType = arg;
else if (ret == 'n')
disableCommit = 1;
+#if ZEBRASDR
+ else if (ret == 'S')
+ rGroupDef.useSDR = 1;
+#endif
else
logf (LOG_WARN, "unknown option '-%s'", arg);
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: retrieve.c,v $
- * Revision 1.7 1999-03-02 16:15:43 quinn
+ * Revision 1.8 1999-03-09 16:27:49 adam
+ * More work on SDRKit integration.
+ *
+ * Revision 1.7 1999/03/02 16:15:43 quinn
* Added "tagsysno" and "tagrank" directives to zebra.cfg.
*
* Revision 1.6 1999/02/18 15:01:25 adam
recordAttr->recordOffset);
if (fc.record_int_len > 180)
{
- logf (LOG_LOG, "%0.70s", fc.record_int_buf);
- logf (LOG_LOG, "%0.70s", fc.record_int_buf +
+ logf (LOG_LOG, "%.70s", fc.record_int_buf);
+ logf (LOG_LOG, "%.70s", fc.record_int_buf +
(fc.record_int_len - 70));
}
else
- logf (LOG_LOG, "%0.*s",
+ logf (LOG_LOG, "%.*s",
fc.record_int_len, fc.record_int_buf);
/* the following two lines makes rec_rm delete buf */
# End Source File
# Begin Source File
+SOURCE=.\index\compact.c
+# End Source File
+# Begin Source File
+
SOURCE=.\dict\dclose.c
# End Source File
# Begin Source File
+SOURCE=.\dict\dcompact.c
+# End Source File
+# Begin Source File
+
SOURCE=.\dict\delete.c
# End Source File
# Begin Source File