data: indexer processes

* TaskBuildIndex starts seperate indexer processes and communicates via shared memory
* indexer processes get restarted if they fail
* indexer processes are killed when the app closes or crashes
* added utility class SharedMemory to allocate and access shared memory, providing basic data structures
* added SharedMemoryGarbageCollector for keeping track of running instances and cleaning up shared memory in case of a crash
* show errors for source files that crashed during indexing
* added basic exception handling to task scheduling
* added option to turn off processes and use threads in preferences, but still use shared memory

fortune cookie message = Good news from someone dear is coming soon.
This commit is contained in:
Eberhard Graether
2017-05-04 15:50:59 +02:00
parent 9beea94fd8
commit 706119ebcc
109 changed files with 3351 additions and 1261 deletions
@@ -0,0 +1,34 @@
#ifndef INTERPROCESS_INDEXING_STATUS_MANAGER_H
#define INTERPROCESS_INDEXING_STATUS_MANAGER_H
#include <set>
#include "utility/file/FilePath.h"
#include "BaseInterprocessDataManager.h"
class InterprocessIndexingStatusManager
: public BaseInterprocessDataManager
{
public:
InterprocessIndexingStatusManager(const std::string& instanceUuid, Id processId, bool isOwner);
virtual ~InterprocessIndexingStatusManager();
void setCurrentlyIndexedSourceFilePath(const FilePath& filePath);
void clearCurrentlyIndexedSourceFilePath();
FilePath getCurrentlyIndexedSourceFilePath();
std::vector<FilePath> getCrashedSourceFilePaths();
std::set<FilePath> getIndexedFiles();
void addIndexedFiles(std::set<FilePath> filePaths);
private:
static const char* s_sharedMemoryNamePrefix;
static const char* s_lastFileKeyName;
static const char* s_currentFilesKeyName;
static const char* s_crashedFilesKeyName;
static const char* s_indexedFilesKeyName;
};
#endif // INTERPROCESS_INDEXING_STATUS_MANAGER_H