/* * Copyright (C) 2020, KylinSoft Co., Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Authors: zhangzihao * Modified by: zhangpengfei * */ #ifndef FIRSTINDEX_H #define FIRSTINDEX_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "traverse_bfs.h" #include "index-status-recorder.h" #include "index-generator.h" #include "file-utils.h" #include "common.h" namespace UkuiSearch { class FirstIndex : public QThread, public Traverse_BFS { public: FirstIndex(); ~FirstIndex(); virtual void DoSomething(const QFileInfo &) final; protected: void run() override; private: FirstIndex(const FirstIndex&) = delete; void operator=(const FirstIndex&) = delete; bool bool_dataBaseStatusOK = false; bool bool_dataBaseExist = false; IndexGenerator* p_indexGenerator = nullptr; QThreadPool m_pool; QQueue>* q_index; // QQueue* q_content_index; //修改QQueue存储数据为QPair,增加存储文件大小数据便于处理时统计--jxx20210519 QQueue>* q_content_index; //xapian will auto commit per 10,000 changes, donnot change it!!! const size_t u_send_length = 8192; }; } #endif // FIRSTINDEX_H