* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: extract.c,v 1.118 2002-05-03 13:49:04 adam Exp $
+ * $Id: extract.c,v 1.119 2002-05-07 11:05:19 adam Exp $
*/
#include <stdio.h>
#include <assert.h>
if (recordAttr->runNumber ==
zebraExplain_runNumberIncrement (zh->reg->zei, 0))
{
- logf (LOG_LOG, "skipped %s %s " PRINTF_OFF_T, rGroup->recordType,
- fname, recordOffset);
+ yaz_log (LOG_LOG, "run number = %d", recordAttr->runNumber);
+ yaz_log (LOG_LOG, "skipped %s %s " PRINTF_OFF_T,
+ rGroup->recordType, fname, recordOffset);
extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys);
rec_rm (&rec);
logRecord (zh);
* Copyright (C) 1995-2002, Index Data
* All rights reserved.
*
- * $Id: zebraapi.c,v 1.59 2002-04-26 08:44:47 adam Exp $
+ * $Id: zebraapi.c,v 1.60 2002-05-07 11:05:19 adam Exp $
*/
#include <assert.h>
static void zebra_flush_reg (ZebraHandle zh)
{
- zebraExplain_flush (zh->reg->zei, 1, zh);
+ zebraExplain_flush (zh->reg->zei, zh);
extract_flushWriteKeys (zh);
zebra_index_merge (zh);
zebra_chdir (zs);
if (reg->records)
{
- zebraExplain_close (reg->zei, 0);
+ zebraExplain_close (reg->zei);
dict_close (reg->dict);
if (reg->matchDict)
dict_close (reg->matchDict);
yaz_log (LOG_LOG, "zebra_end_trans");
rval = res_get (zh->res, "shadow");
+ zebraExplain_runNumberIncrement (zh->reg->zei, 1);
+
zebra_flush_reg (zh);
zebra_register_close (zh->service, zh->reg);
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: zinfo.c,v 1.28 2002-05-03 13:49:04 adam Exp $
+ * $Id: zinfo.c,v 1.29 2002-05-07 11:05:19 adam Exp $
*/
#include <stdlib.h>
int ordinalSU;
int runNumber;
int dirty;
+ int write_flag;
Records records;
data1_handle dh;
Res res;
return rec;
}
-void zebraExplain_flush (ZebraExplainInfo zei, int writeFlag, void *handle)
+void zebraExplain_flush (ZebraExplainInfo zei, void *handle)
{
if (!zei)
return;
zei->updateHandle = handle;
- if (writeFlag)
+ if (zei->write_flag)
{
struct zebDatabaseInfoB *zdi;
zebAccessObject o;
}
}
-void zebraExplain_close (ZebraExplainInfo zei, int writeFlag)
+void zebraExplain_close (ZebraExplainInfo zei)
{
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_close wr=%d", writeFlag);
+ yaz_log (LOG_LOG, "zebraExplain_close");
#endif
if (!zei)
return;
- zebraExplain_flush (zei, writeFlag, zei->updateHandle);
+ zebraExplain_flush (zei, zei->updateHandle);
nmem_destroy (zei->nmem);
}
logf (LOG_LOG, "zebraExplain_open wr=%d", writeFlag);
#endif
zei = (ZebraExplainInfo) nmem_malloc (nmem, sizeof(*zei));
+ zei->write_flag = writeFlag;
zei->updateHandle = updateHandle;
zei->updateFunc = updateFunc;
zei->dirty = 0;
np = np->child;
assert (np && np->which == DATA1N_data);
zei->runNumber = atoi_n (np->u.data.data, np->u.data.len);
+ yaz_log (LOG_LOG, "READ runnumber = %d", zei->runNumber);
*zdip = NULL;
}
rec_rm (&trec);
nmem_destroy (zei->nmem);
return 0;
}
- data1_pr_tree (zei->dh, zei->data1_target, stdout);
-
node_tgtinfo = data1_search_tag (zei->dh, zei->data1_target->child,
"targetInfo");
assert (node_tgtinfo);
- data1_pr_tree (zei->dh, zei->data1_target, stdout);
-
zebraExplain_initCommonInfo (zei, node_tgtinfo);
zebraExplain_initAccessInfo (zei, node_tgtinfo);
{
data1_node *c = data1_search_tag (zei->dh, n->child, "commonInfo");
assert (c);
- data1_mk_tag_data_text (zei->dh, c, "dateChanged", zei->date, zei->nmem);
+ data1_mk_tag_data_text_uni (zei->dh, c, "dateChanged", zei->date,
+ zei->nmem);
}
static void zebraExplain_initAccessInfo (ZebraExplainInfo zei, data1_node *n)
int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num)
{
if (adjust_num)
+ {
zei->dirty = 1;
+ yaz_log (LOG_LOG, "zinfo run number=%d", zei->runNumber+adjust_num);
+ }
return zei->runNumber += adjust_num;
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.h,v $
- * Revision 1.12 2002-02-20 17:30:01 adam
+ * Revision 1.13 2002-05-07 11:05:19 adam
+ * data1 updates. Run number fix
+ *
+ * Revision 1.12 2002/02/20 17:30:01 adam
* Work on new API. Locking system re-implemented
*
* Revision 1.11 2001/10/15 19:53:43 adam
int (*updateFunc)(void *handle,
Record drec,
data1_node *n));
-void zebraExplain_close (ZebraExplainInfo zei, int writeFlag /*,
- int (*updateH)(Record drec, data1_node *n)*/);
+void zebraExplain_close (ZebraExplainInfo zei);
int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
int explain_database);
void zebraExplain_recordBytesIncrement (ZebraExplainInfo zei, int adjust_num);
int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num);
void zebraExplain_loadAttsets (data1_handle dh, Res res);
-void zebraExplain_flush (ZebraExplainInfo zei, int writeFlag,
- void *updateHandle);
+void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle);
int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
const char **db, int *set, int *use);
* Copyright (C) 1995-2002, Index Data
* All rights reserved.
*
- * $Id: zserver.c,v 1.87 2002-04-05 08:46:26 adam Exp $
+ * $Id: zserver.c,v 1.88 2002-05-07 11:05:19 adam Exp $
*/
#include <stdio.h>
static void bend_stop(struct statserv_options_block *sob)
{
+#ifdef WIN32
+
+#else
+ if (!sob->inetd)
+ unlink ("zebrasrv.pid");
+#endif
if (sob->handle)
{
ZebraService service = sob->handle;
* All rights reserved.
*
* $Log: recgrs.c,v $
- * Revision 1.47 2002-05-03 13:50:25 adam
+ * Revision 1.48 2002-05-07 11:05:20 adam
+ * data1 updates. Run number fix
+ *
+ * Revision 1.47 2002/05/03 13:50:25 adam
* data1 cleanup
*
* Revision 1.46 2002/04/13 18:16:43 adam
data1_pr_tree (p->dh, node, stdout);
#endif
logf (LOG_DEBUG, "grs_retrieve: size");
- if ((dnew = data1_mk_tag_data_wd(p->dh, node, node,"size", mem)))
+ if ((dnew = data1_mk_tag_data_wd(p->dh, node, "size", mem)))
{
dnew->u.data.what = DATA1I_text;
dnew->u.data.data = dnew->lbuf;
tagname = res_get_def(p->res, "tagrank", "rank");
if (strcmp(tagname, "0") && p->score >= 0 &&
- (dnew = data1_mk_tag_data_wd(p->dh, node, node, tagname, mem)))
+ (dnew = data1_mk_tag_data_wd(p->dh, node, tagname, mem)))
{
logf (LOG_DEBUG, "grs_retrieve: %s", tagname);
dnew->u.data.what = DATA1I_num;
tagname = res_get_def(p->res, "tagsysno", "localControlNumber");
if (strcmp(tagname, "0") && p->localno > 0 &&
- (dnew = data1_mk_tag_data_wd(p->dh, node, node, tagname, mem)))
+ (dnew = data1_mk_tag_data_wd(p->dh, node, tagname, mem)))
{
logf (LOG_DEBUG, "grs_retrieve: %s", tagname);
dnew->u.data.what = DATA1I_text;
sprintf(dnew->u.data.data, "%d", p->localno);
dnew->u.data.len = strlen(dnew->u.data.data);
}
-
+#if 0
data1_pr_tree (p->dh, node, stdout);
-
+#endif
if (p->comp && p->comp->which == Z_RecordComp_complex &&
p->comp->u.complex->generic &&
p->comp->u.complex->generic->schema)
}
*(p++) = '\0';
- if ((dnew = data1_mk_tag_data_wd(dh, node, node,
+ if ((dnew = data1_mk_tag_data_wd(dh, node,
"schemaIdentifier", mem)))
{
dnew->u.data.what = DATA1I_oid;
* Copyright (C) 1994-2002, Index Data
* All rights reserved.
*
- * $Id: regxread.c,v 1.41 2002-05-03 17:59:17 adam Exp $
+ * $Id: regxread.c,v 1.42 2002-05-07 11:05:20 adam Exp $
*/
#include <stdio.h>
#include <assert.h>
{
org_len = 0;
- res = data1_mk_node (spec->dh, spec->m, DATA1N_data, parent);
+ res = data1_mk_node2 (spec->dh, spec->m, DATA1N_data, parent);
res->u.data.what = DATA1I_text;
res->u.data.len = 0;
res->u.data.formatted_text = formatted_text;
if (parent->which != DATA1N_variant)
{
- res = data1_mk_node (spec->dh, spec->m, DATA1N_variant, parent);
+ res = data1_mk_node2 (spec->dh, spec->m, DATA1N_variant, parent);
if (spec->d1_stack[spec->d1_level])
tagDataRelease (spec);
spec->d1_stack[spec->d1_level] = res;
logf (LOG_LOG, "variant node (%d)", spec->d1_level);
#endif
parent = spec->d1_stack[spec->d1_level-1];
- res = data1_mk_node (spec->dh, spec->m, DATA1N_variant, parent);
+ res = data1_mk_node2 (spec->dh, spec->m, DATA1N_variant, parent);
res->u.variant.type = tp;
if (value_len >= DATA1_LOCALDATA)
parent = spec->d1_stack[spec->d1_level -1];
partag = get_parent_tag(spec->dh, parent);
- res = data1_mk_node (spec->dh, spec->m, DATA1N_tag, parent);
+ res = data1_mk_node2 (spec->dh, spec->m, DATA1N_tag, parent);
if (len >= DATA1_LOCALDATA)
res->u.tag.tag = (char *) nmem_malloc (spec->m, len+1);