simplified temp file handling for compressed documents and, for querying, implemented caching for last file uncompressed
This commit is contained in:
@@ -225,8 +225,8 @@ bool BeagleQueueIndexer::indexFromCache(const string& udi)
|
||||
return true;
|
||||
} else {
|
||||
Rcl::Doc doc;
|
||||
FileInterner interner(data, m_config, m_tmpdir,
|
||||
FileInterner::FIF_doUseInputMimetype,
|
||||
FileInterner interner(data, m_config,
|
||||
FileInterner::FIF_doUseInputMimetype,
|
||||
dotdoc.mimetype);
|
||||
FileInterner::Status fis;
|
||||
try {
|
||||
@@ -434,7 +434,7 @@ BeagleQueueIndexer::processone(const string &path,
|
||||
// to use beagle-generated fields like beagle:inurl
|
||||
doc.meta = dotdoc.meta;
|
||||
|
||||
FileInterner interner(path, stp, m_config, m_tmpdir,
|
||||
FileInterner interner(path, stp, m_config,
|
||||
FileInterner::FIF_doUseInputMimetype,
|
||||
&dotdoc.mimetype);
|
||||
FileInterner::Status fis;
|
||||
|
||||
@@ -71,7 +71,6 @@ private:
|
||||
Rcl::Db *m_db;
|
||||
BeagleQueueCache *m_cache;
|
||||
string m_queuedir;
|
||||
TempDir m_tmpdir;
|
||||
DbIxStatusUpdater *m_updater;
|
||||
bool m_nocacheindex;
|
||||
|
||||
|
||||
@@ -534,7 +534,6 @@ void *FsIndexerInternfileWorker(void * fsp)
|
||||
FsIndexer *fip = (FsIndexer*)fsp;
|
||||
WorkQueue<InternfileTask*> *tqp = &fip->m_iwqueue;
|
||||
DebugLog::getdbl()->setloglevel(fip->m_loglevel);
|
||||
TempDir tmpdir;
|
||||
RclConfig myconf(*(fip->m_stableconfig));
|
||||
|
||||
InternfileTask *tsk = 0;
|
||||
@@ -544,7 +543,7 @@ void *FsIndexerInternfileWorker(void * fsp)
|
||||
return (void*)1;
|
||||
}
|
||||
LOGDEB0(("FsIndexerInternfileWorker: task fn %s\n", tsk->fn.c_str()));
|
||||
if (fip->processonefile(&myconf, tmpdir, tsk->fn, &tsk->statbuf,
|
||||
if (fip->processonefile(&myconf, tsk->fn, &tsk->statbuf,
|
||||
tsk->localfields, tsk->mdreapers) !=
|
||||
FsTreeWalker::FtwOk) {
|
||||
LOGERR(("FsIndexerInternfileWorker: processone failed\n"));
|
||||
@@ -612,13 +611,12 @@ FsIndexer::processone(const std::string &fn, const struct stat *stp,
|
||||
}
|
||||
#endif
|
||||
|
||||
return processonefile(m_config, m_tmpdir, fn, stp, m_localfields,
|
||||
m_mdreapers);
|
||||
return processonefile(m_config, fn, stp, m_localfields, m_mdreapers);
|
||||
}
|
||||
|
||||
|
||||
FsTreeWalker::Status
|
||||
FsIndexer::processonefile(RclConfig *config, TempDir& tmpdir,
|
||||
FsIndexer::processonefile(RclConfig *config,
|
||||
const std::string &fn, const struct stat *stp,
|
||||
const map<string, string>& localfields,
|
||||
const vector<MDReaper>& mdreapers)
|
||||
@@ -659,7 +657,7 @@ FsIndexer::processonefile(RclConfig *config, TempDir& tmpdir,
|
||||
LOGDEB0(("processone: processing: [%s] %s\n",
|
||||
displayableBytes(stp->st_size).c_str(), fn.c_str()));
|
||||
|
||||
FileInterner interner(fn, stp, config, tmpdir, FileInterner::FIF_none);
|
||||
FileInterner interner(fn, stp, config, FileInterner::FIF_none);
|
||||
if (!interner.ok()) {
|
||||
// no indexing whatsoever in this case. This typically means that
|
||||
// indexallfilenames is not set
|
||||
|
||||
@@ -59,7 +59,7 @@ class FsIndexer : public FsTreeWalkerCB {
|
||||
/**
|
||||
* Top level file system tree index method for updating a given database.
|
||||
*
|
||||
* We create the temporary directory, open the database,
|
||||
* We open the database,
|
||||
* then call a file system walk for each top-level directory.
|
||||
*/
|
||||
bool index();
|
||||
@@ -88,7 +88,6 @@ class FsIndexer : public FsTreeWalkerCB {
|
||||
FsTreeWalker m_walker;
|
||||
RclConfig *m_config;
|
||||
Rcl::Db *m_db;
|
||||
TempDir m_tmpdir;
|
||||
string m_reason;
|
||||
DbIxStatusUpdater *m_updater;
|
||||
std::vector<std::string> m_tdl;
|
||||
@@ -127,7 +126,7 @@ class FsIndexer : public FsTreeWalkerCB {
|
||||
Rcl::Doc& doc);
|
||||
string getDbDir() {return m_config->getDbDir();}
|
||||
FsTreeWalker::Status
|
||||
processonefile(RclConfig *config, TempDir& tmpdir, const string &fn,
|
||||
processonefile(RclConfig *config, const string &fn,
|
||||
const struct stat *, const map<string,string>& localfields,
|
||||
const vector<MDReaper>& mdreapers);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user