Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions be/src/olap/rowset/segment_v2/inverted_index_desc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ const std::string InvertedIndexDescriptor::index_suffix = ".idx";
const std::string InvertedIndexDescriptor::index_name_separator = "_";

std::string InvertedIndexDescriptor::get_temporary_index_path(
const std::string& segment_path, uint64_t uuid, const std::string& index_suffix_path) {
const std::string& segment_path, int64_t index_id, const std::string& index_suffix_path) {
std::string suffix = index_suffix_path.empty() ? "" : "@" + index_suffix_path;
return StripSuffixString(segment_path, segment_suffix) + index_name_separator +
std::to_string(uuid) + suffix;
std::to_string(index_id) + suffix;
}

std::string InvertedIndexDescriptor::get_index_file_name(const std::string& segment_path,
uint64_t uuid,
int64_t index_id,
const std::string& index_suffix_path) {
std::string suffix = index_suffix_path.empty() ? "" : "@" + index_suffix_path;
return StripSuffixString(segment_path, segment_suffix) + index_name_separator +
std::to_string(uuid) + suffix + index_suffix;
std::to_string(index_id) + suffix + index_suffix;
}

std::string InvertedIndexDescriptor::inverted_index_file_path(
Expand All @@ -63,4 +63,4 @@ std::string InvertedIndexDescriptor::local_inverted_index_path_segcompacted(
return fmt::format("{}/{}_{}-{}_{}{}.idx", tablet_path, rowset_id.to_string(), begin, end,
index_id, suffix);
}
} // namespace doris::segment_v2
} // namespace doris::segment_v2
6 changes: 3 additions & 3 deletions be/src/olap/rowset/segment_v2/inverted_index_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class InvertedIndexDescriptor {
static const std::string segment_suffix;
static const std::string index_suffix;
static const std::string index_name_separator;
static std::string get_temporary_index_path(const std::string& segment_path, uint64_t uuid,
static std::string get_temporary_index_path(const std::string& segment_path, int64_t index_id,
const std::string& index_suffix_path);
static std::string get_index_file_name(const std::string& path, uint64_t uuid,
static std::string get_index_file_name(const std::string& path, int64_t index_id,
const std::string& index_suffix_path);
static std::string get_index_file_name(const std::string& path);
static const std::string get_temporary_null_bitmap_file_name() { return "null_bitmap"; }
Expand All @@ -53,4 +53,4 @@ class InvertedIndexDescriptor {
};

} // namespace segment_v2
} // namespace doris
} // namespace doris
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Status InvertedIndexFileReader::_init_from_v2(int32_t read_buffer_size) {
ReaderFileEntry* entry = nullptr;

for (int32_t i = 0; i < numIndices; ++i) {
int64_t indexId = _stream->readInt(); // Read index ID
int64_t index_id = _stream->readLong(); // Read index ID
int32_t suffix_length = _stream->readInt(); // Read suffix length
std::vector<uint8_t> suffix_data(suffix_length);
_stream->readBytes(suffix_data.data(), suffix_length);
Expand All @@ -99,7 +99,7 @@ Status InvertedIndexFileReader::_init_from_v2(int32_t read_buffer_size) {
fileEntries->put(aid, entry);
}

_indices_entries.emplace(std::make_pair(indexId, std::move(suffix_str)),
_indices_entries.emplace(std::make_pair(index_id, std::move(suffix_str)),
std::move(fileEntries));
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ size_t InvertedIndexFileWriter::headerLength() {
sizeof(int) * 2; // Account for the size of the version number and number of indices
for (const auto& entry : _indices_dirs) {
auto suffix = entry.first.second;
header_size += sizeof(int); // index id
header_size += sizeof(int64_t); // index id
header_size += 4; // index suffix name size
header_size += suffix.length(); // index suffix name
header_size += sizeof(int); // index file count
Expand Down Expand Up @@ -199,7 +199,7 @@ size_t InvertedIndexFileWriter::write() {
int32_t file_count = sorted_files.size();

// Write the index ID and the number of files
compound_file_output->writeInt(index_id);
compound_file_output->writeLong(index_id);
const auto* index_suffix_str = reinterpret_cast<const uint8_t*>(index_suffix.c_str());
compound_file_output->writeInt(index_suffix.length());
compound_file_output->writeBytes(index_suffix_str, index_suffix.length());
Expand Down Expand Up @@ -413,4 +413,4 @@ void DorisCompoundFileWriter::copyFile(const char* fileName, lucene::store::Dire
}
input->close();
}
} // namespace doris::segment_v2
} // namespace doris::segment_v2