|
a/src/rcldb/rcldb.cpp |
|
b/src/rcldb/rcldb.cpp |
|
... |
|
... |
1264 |
if (m_flushMb > 0) {
|
1264 |
if (m_flushMb > 0) {
|
1265 |
m_curtxtsz += moretext;
|
1265 |
m_curtxtsz += moretext;
|
1266 |
if ((m_curtxtsz - m_flushtxtsz) / MB >= m_flushMb) {
|
1266 |
if ((m_curtxtsz - m_flushtxtsz) / MB >= m_flushMb) {
|
1267 |
LOGDEB(("Db::add/delete: txt size >= %d Mb, flushing\n",
|
1267 |
LOGDEB(("Db::add/delete: txt size >= %d Mb, flushing\n",
|
1268 |
m_flushMb));
|
1268 |
m_flushMb));
|
|
|
1269 |
return doFlush();
|
|
|
1270 |
}
|
|
|
1271 |
}
|
|
|
1272 |
return true;
|
|
|
1273 |
}
|
|
|
1274 |
|
|
|
1275 |
bool Db::doFlush()
|
|
|
1276 |
{
|
|
|
1277 |
if (!m_ndb) {
|
|
|
1278 |
LOGERR(("Db::doFLush: no ndb??\n"));
|
|
|
1279 |
return false;
|
|
|
1280 |
}
|
1269 |
string ermsg;
|
1281 |
string ermsg;
|
1270 |
try {
|
1282 |
try {
|
1271 |
m_ndb->xwdb.flush();
|
1283 |
m_ndb->xwdb.flush();
|
1272 |
} XCATCHERROR(ermsg);
|
1284 |
} XCATCHERROR(ermsg);
|
1273 |
if (!ermsg.empty()) {
|
1285 |
if (!ermsg.empty()) {
|
1274 |
LOGERR(("Db::add: flush() failed: %s\n", ermsg.c_str()));
|
1286 |
LOGERR(("Db::doFlush: flush() failed: %s\n", ermsg.c_str()));
|
1275 |
return false;
|
1287 |
return false;
|
1276 |
}
|
1288 |
}
|
1277 |
m_flushtxtsz = m_curtxtsz;
|
1289 |
m_flushtxtsz = m_curtxtsz;
|
1278 |
}
|
|
|
1279 |
}
|
|
|
1280 |
return true;
|
1290 |
return true;
|
1281 |
}
|
1291 |
}
|
1282 |
|
1292 |
|
1283 |
// Test if doc given by udi has changed since last indexed (test sigs)
|
1293 |
// Test if doc given by udi has changed since last indexed (test sigs)
|
1284 |
bool Db::needUpdate(const string &udi, const string& sig)
|
1294 |
bool Db::needUpdate(const string &udi, const string& sig)
|