Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](index tool)Fix index_tool build error #32289

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[fix](index tool)Fix index_tool build error
  • Loading branch information
luennng committed Mar 15, 2024
commit 1beca68070d917ba8e458430ed67654a042e0676
21 changes: 10 additions & 11 deletions be/src/index-tools/index_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "olap/tablet_schema.h"

using doris::segment_v2::DorisCompoundReader;
using doris::segment_v2::DorisCompoundDirectoryFactory;
using doris::segment_v2::DorisFSDirectoryFactory;
using doris::segment_v2::InvertedIndexFileWriter;
using doris::segment_v2::InvertedIndexDescriptor;
using doris::segment_v2::InvertedIndexFileReader;
Expand Down Expand Up @@ -248,8 +248,8 @@ int main(int argc, char** argv) {
std::unique_ptr<DorisCompoundReader> reader;
try {
reader = std::make_unique<DorisCompoundReader>(
DorisCompoundDirectoryFactory::getDirectory(fs, dir_str.c_str()),
file_str.c_str(), 4096);
DorisFSDirectoryFactory::getDirectory(fs, dir_str.c_str()), file_str.c_str(),
4096);
std::vector<std::string> files;
std::cout << "Nested files for " << file_str << std::endl;
std::cout << "==================================" << std::endl;
Expand Down Expand Up @@ -283,8 +283,8 @@ int main(int argc, char** argv) {
std::unique_ptr<DorisCompoundReader> reader;
try {
reader = std::make_unique<DorisCompoundReader>(
DorisCompoundDirectoryFactory::getDirectory(fs, dir_str.c_str()),
file_str.c_str(), 4096);
DorisFSDirectoryFactory::getDirectory(fs, dir_str.c_str()), file_str.c_str(),
4096);
std::cout << "Term statistics for " << file_str << std::endl;
std::cout << "==================================" << std::endl;
check_terms_stats(reader.get());
Expand Down Expand Up @@ -327,7 +327,7 @@ int main(int argc, char** argv) {
continue;
}
reader = std::make_unique<DorisCompoundReader>(
DorisCompoundDirectoryFactory::getDirectory(fs, file_str.c_str()),
DorisFSDirectoryFactory::getDirectory(fs, file_str.c_str()),
file_str.c_str(), 4096);
std::cout << "Search " << FLAGS_column_name << ":" << FLAGS_term << " from "
<< file_str << std::endl;
Expand All @@ -351,7 +351,7 @@ int main(int argc, char** argv) {
return -1;
}
reader = std::make_unique<DorisCompoundReader>(
DorisCompoundDirectoryFactory::getDirectory(fs, FLAGS_directory.c_str()),
DorisFSDirectoryFactory::getDirectory(fs, FLAGS_directory.c_str()),
FLAGS_idx_file_name.c_str(), 4096);
std::cout << "Search " << FLAGS_column_name << ":" << FLAGS_term << " from "
<< FLAGS_idx_file_name << std::endl;
Expand Down Expand Up @@ -430,7 +430,7 @@ int main(int argc, char** argv) {

std::string index_writer_path = tablet_path + "/tmp_index_writer";
lucene::store::Directory* dir =
DorisCompoundDirectoryFactory::getDirectory(fs, index_writer_path.c_str(), false);
DorisFSDirectoryFactory::getDirectory(fs, index_writer_path.c_str(), false);
lucene::analysis::SimpleAnalyzer<char> analyzer;
auto index_writer = _CLNEW lucene::index::IndexWriter(dir, &analyzer, true /* create */,
true /* closeDirOnShutdown */);
Expand All @@ -443,7 +443,7 @@ int main(int argc, char** argv) {
std::string src_idx_full_name =
src_index_files[i] + "_" + std::to_string(index_id) + ".idx";
DorisCompoundReader* reader = new DorisCompoundReader(
DorisCompoundDirectoryFactory::getDirectory(fs, tablet_path.c_str()),
DorisFSDirectoryFactory::getDirectory(fs, tablet_path.c_str()),
src_idx_full_name.c_str());
src_index_dirs[i] = reader;
}
Expand All @@ -453,8 +453,7 @@ int main(int argc, char** argv) {
for (int i = 0; i < dest_segment_num; ++i) {
// format: rowsetId_segmentId_columnId
auto path = tablet_path + "/" + dest_index_files[i] + "_" + std::to_string(index_id);
dest_index_dirs[i] =
DorisCompoundDirectoryFactory::getDirectory(fs, path.c_str(), true);
dest_index_dirs[i] = DorisFSDirectoryFactory::getDirectory(fs, path.c_str(), true);
}

index_writer->indexCompaction(src_index_dirs, dest_index_dirs, trans_vec,
Expand Down
Loading