ddc
|
CConcIndexatorInvoker is a class for invoking an index process. More...
#include <ConcIndexatorInvoker.h>
Public Member Functions | |
ConcIndexatorInvoker () | |
void | SetCurrMessage (string Message) const |
outputs a message to stdout or to GUI More... | |
bool | BuildIndex (string ProjectFile) |
builds index files for project ProjectFile More... | |
Public Attributes | |
bool | m_bStoppedByUser |
if true, CConcIndexatorInvoker tries to stop indexing More... | |
bool | m_bOnlyReindexMorphology |
if true, then BuildIndex should only rebuild MorphPattern index More... | |
bool | m_bSkipInitialFileChecking |
if true, then there is no initial checking whether the source files exist More... | |
string | m_CurrMessage |
the last message from indexing process More... | |
bool | m_bStdout |
should DDC send all messages to stdout More... | |
int | m_CurrentSourceFileNo |
the index of the currently processing source file More... | |
int | m_SourceFilesNumber |
the number of files to index More... | |
string | m_CurrentSourceFileName |
the name of file More... | |
CMyTimeSpanHolder | m_Profiler |
a slot to gather profiling information for loading stage More... | |
Private Member Functions | |
string | GetTimeStatisticsFileName (string Path) const |
string | GetErrorLogFileName (string Path) const |
void | WriteTimeStatistics (const CConcIndexator &Indexator, DWORD MaxTokenCountInOnePeriod) const |
void | FinalizeIndex (CConcIndexator &Indexator, DWORD MaxTokenCountInOnePeriod) const |
void | BuildOnlyMorphIndex (string ProjectFile) const |
void | BuildIndexStart (string ProjectFile, CConcIndexator &indexator) |
void | PrintProgress (DWORD saveCorpusEndTokenNo) |
void | IndexFiles (CConcIndexator &Indexator) |
void | SaveLoadIndexToDisk (CConcIndexator &Indexator) |
DWORD | IndexFile (CConcIndexator &Indexator, CIndexDocument *document) |
void | AddInputLoadIndexToMemoryLoadIndexWrapper (CConcIndexator &Indexator) |
void | ProcessTarOrSingleFile (CConcIndexator &Indexator, size_t &InputLoadIndexSize, size_t &MemoryLoadIndexSize) |
Private Attributes | |
time_t | m_StartTime |
DWORD | m_CorpusEndTokenNo |
vector< string > | m_ErrorCorpusFiles |
CConcIndexatorInvoker is a class for invoking an index process.
This class was established to start, to stop and to monitor an indexing process. To start it a user should call function CConcIndexatorInvoker::BuildIndex. To stop the process a user should set CConcIndexatorInvoker::m_bStoppedByUser to true.
ConcIndexatorInvoker::ConcIndexatorInvoker | ( | ) |
|
private |
References MakeFName().
Referenced by WriteTimeStatistics().
|
private |
References MakeFName().
Referenced by FinalizeIndex().
|
private |
References CMyTimeSpanHolder::EndTimer(), CStringIndexator::GetSearchPeriodsCount(), CMyTimeSpanHolder::GetStrRepresentation(), GetTimeStatisticsFileName(), m_CorpusEndTokenNo, CStringIndexator::m_Path, m_Profiler, and SetCurrMessage().
Referenced by BuildIndex().
|
private |
References CStringIndexator::AddInputLoadIndexToMemoryLoadIndex(), CStringIndexator::AddMemoryLoadIndexToMainLoadIndex(), CHitBorders::BordersEndIndexing(), CConcIndexator::CalculateSearchPeriods(), CConcIndexator::CreateMorphIndexWrapper(), CMyTimeSpanHolder::EndTimer(), CStringIndexator::FinalSaveAllIndices(), Format(), CHitBorders::GetCorpusEndTokenNo(), GetErrorLogFileName(), CConcordance::GetFileNameForCorpusFileNames(), CIndexItem::GetMaximalNumberOfRunningTokens(), CHitBorders::LoadHitBorders(), CConcordance::m_bIndexMorphPatterns, CConcordance::m_bResumeOnIndexErrors, m_CorpusEndTokenNo, m_ErrorCorpusFiles, CStringIndexator::m_Path, m_Profiler, CConcIndexator::NormalEndIndexing(), CConcIndexator::SaveCorpusFileList(), CStringIndexator::SaveMemoryLoadIndex(), SetCurrMessage(), and CMyTimeSpanHolder::StartTimer().
Referenced by IndexFiles().
|
private |
References CConcIndexator::CreateMorphIndexWrapper(), CConcordance::LoadProject(), and SetCurrMessage().
Referenced by BuildIndex().
|
private |
References CMyTimeSpanHolder::ClearTimers(), CConcIndexator::DestroyIndex(), Format(), CSourceFileHolder::FoundNotExistedFile(), CConcIndexator::GetMaxInputLoadIndexSize(), CConcIndexator::GetMaxTokenCountInOnePeriod(), CSourceFileHolder::GetSourceFile(), CSourceFileHolder::GetSourceFilesCount(), CConcordance::LoadSourceFilesAndOptions(), m_bSkipInitialFileChecking, m_CorpusEndTokenNo, m_Profiler, m_SourceFilesNumber, m_StartTime, TiXmlBase::SetCondenseWhiteSpace(), SetCurrMessage(), CConcIndexator::StartIndexing(), and CMyTimeSpanHolder::StartTimer().
Referenced by BuildIndex().
|
private |
References Format(), m_CurrentSourceFileName, m_CurrentSourceFileNo, m_SourceFilesNumber, m_StartTime, and SetCurrMessage().
Referenced by AddInputLoadIndexToMemoryLoadIndexWrapper().
|
private |
References FinalizeIndex(), Format(), CConcIndexator::GetMaxInputLoadIndexSize(), CConcIndexator::GetMaxTokenCountInOnePeriod(), CSourceFileHolder::GetSourceFile(), m_bStoppedByUser, m_CorpusEndTokenNo, m_CurrentSourceFileName, m_CurrentSourceFileNo, m_ErrorCorpusFiles, m_SourceFilesNumber, and ProcessTarOrSingleFile().
Referenced by BuildIndex().
|
private |
References CStringIndexator::AddInputLoadIndexToMemoryLoadIndex(), CStringIndexator::AddMemoryLoadIndexToMainLoadIndex(), CMyTimeSpanHolder::EndTimer(), Format(), m_Profiler, CStringIndexator::SaveMemoryLoadIndex(), SetCurrMessage(), and CMyTimeSpanHolder::StartTimer().
Referenced by ProcessTarOrSingleFile().
|
private |
References CHitBorders::AddBreakByName(), CTokenIndexator::CorpusEndTokenNo, CIndexDocument::CorpusFileName, ddcLogError, ddcLogWarn, CMyTimeSpanHolder::EndTimer(), Format(), CIndexItem::GetMaximalNumberOfRunningTokens(), CConcIndexator::IndexOneFile(), CIndexDocument::IsEmpty(), CConcordance::m_bResumeOnIndexErrors, m_CorpusEndTokenNo, CConcordance::m_CorpusFiles, m_ErrorCorpusFiles, m_Profiler, CExpc::m_strCause, PredefinedFileBreakName, ddcCorpusList< OffT_ >::push_back(), CConcIndexator::RollbackIndexOneFile(), SetCurrMessage(), CMyTimeSpanHolder::StartTimer(), and CExpc::what().
Referenced by ProcessTarOrSingleFile().
|
private |
References CStringIndexator::AddInputLoadIndexToMemoryLoadIndex(), CMyTimeSpanHolder::EndTimer(), Format(), m_CorpusEndTokenNo, m_CurrentSourceFileName, m_Profiler, PrintProgress(), and CMyTimeSpanHolder::StartTimer().
Referenced by ProcessTarOrSingleFile().
|
private |
References AddInputLoadIndexToMemoryLoadIndexWrapper(), CConcIndexator::GetMaxInputLoadIndexSize(), CConcIndexator::GetMaxTokenCountInOnePeriod(), IndexFile(), m_bStoppedByUser, m_CurrentSourceFileName, and SaveLoadIndexToDisk().
Referenced by IndexFiles().
void ConcIndexatorInvoker::SetCurrMessage | ( | string | Message | ) | const |
outputs a message to stdout or to GUI
References m_bStdout, and m_CurrMessage.
Referenced by BuildIndex(), BuildIndexStart(), BuildOnlyMorphIndex(), FinalizeIndex(), IndexFile(), PrintProgress(), SaveLoadIndexToDisk(), and WriteTimeStatistics().
bool ConcIndexatorInvoker::BuildIndex | ( | string | ProjectFile | ) |
builds index files for project ProjectFile
References _MAX_PATH, BuildIndexStart(), BuildOnlyMorphIndex(), ddcLogDebug, ddcLogError, CConcIndexator::DestroyIndex(), Format(), CConcIndexator::GetMaxTokenCountInOnePeriod(), GetPathByFile(), IndexFiles(), m_bOnlyReindexMorphology, m_bStoppedByUser, CExpc::m_strCause, newhandler(), SetCurrMessage(), CConcIndexator::TerminateIndexing(), and WriteTimeStatistics().
|
private |
Referenced by BuildIndexStart(), and PrintProgress().
|
private |
|
private |
Referenced by FinalizeIndex(), IndexFile(), and IndexFiles().
bool ConcIndexatorInvoker::m_bStoppedByUser |
if true, CConcIndexatorInvoker tries to stop indexing
Referenced by BuildIndex(), ConcIndexatorInvoker(), IndexFiles(), and ProcessTarOrSingleFile().
bool ConcIndexatorInvoker::m_bOnlyReindexMorphology |
if true, then BuildIndex should only rebuild MorphPattern index
Referenced by BuildIndex(), and ConcIndexatorInvoker().
bool ConcIndexatorInvoker::m_bSkipInitialFileChecking |
if true, then there is no initial checking whether the source files exist
Referenced by BuildIndexStart(), and ConcIndexatorInvoker().
|
mutable |
the last message from indexing process
Referenced by SetCurrMessage().
bool ConcIndexatorInvoker::m_bStdout |
should DDC send all messages to stdout
Referenced by ConcIndexatorInvoker(), and SetCurrMessage().
int ConcIndexatorInvoker::m_CurrentSourceFileNo |
the index of the currently processing source file
Referenced by ConcIndexatorInvoker(), IndexFiles(), and PrintProgress().
int ConcIndexatorInvoker::m_SourceFilesNumber |
the number of files to index
Referenced by BuildIndexStart(), ConcIndexatorInvoker(), IndexFiles(), and PrintProgress().
string ConcIndexatorInvoker::m_CurrentSourceFileName |
the name of file
Referenced by AddInputLoadIndexToMemoryLoadIndexWrapper(), IndexFiles(), PrintProgress(), and ProcessTarOrSingleFile().
|
mutable |
a slot to gather profiling information for loading stage
Referenced by AddInputLoadIndexToMemoryLoadIndexWrapper(), BuildIndexStart(), ConcIndexatorInvoker(), FinalizeIndex(), IndexFile(), SaveLoadIndexToDisk(), and WriteTimeStatistics().