Skip to content

Commit

Permalink
do some more rename
Browse files Browse the repository at this point in the history
  • Loading branch information
lidezhu committed Feb 7, 2022
1 parent 13ac1e9 commit 35f4547
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions dbms/src/Storages/DeltaMerge/ColumnFile/ColumnFilePersisted.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ BlockPtr deserializeSchema(ReadBuffer & buf);
void serializeColumn(MemoryWriteBuffer & buf, const IColumn & column, const DataTypePtr & type, size_t offset, size_t limit, bool compress);
void deserializeColumn(IColumn & column, const DataTypePtr & type, const ByteBuffer & data_buf, size_t rows);

/// Serialize those packs' metadata into buf.
/// Note that this method stop at the first unsaved pack.
/// Serialize those column files' metadata into buf.
void serializeSavedColumnFiles(WriteBuffer & buf, const ColumnFilePersisteds & column_files);
/// Recreate pack instances from buf.
/// Recreate column file instances from buf.
ColumnFilePersisteds deserializeSavedColumnFiles(DMContext & context, const RowKeyRange & segment_range, ReadBuffer & buf);

void serializeSavedColumnFilesInV2Format(WriteBuffer & buf, const ColumnFilePersisteds & column_files);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ColumnFilePersisteds ColumnFilePersistedSet::checkHeadAndCloneTail(DMContext & c
auto new_dr = d_file->getDeleteRange().shrink(target_range);
if (!new_dr.none())
{
// Only use the available delete_range pack.
// Only use the available delete_range column file.
cloned_tail.push_back(d_file->cloneWith(new_dr));
}
}
Expand Down
8 changes: 4 additions & 4 deletions dbms/src/Storages/DeltaMerge/Delta/MemTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ ColumnFiles MemTableSet::cloneColumnFiles(DMContext & context, const RowKeyRange
auto new_dr = dr->getDeleteRange().shrink(target_range);
if (!new_dr.none())
{
// Only use the available delete_range pack.
// Only use the available delete_range column file.
cloned_column_files.push_back(dr->cloneWith(new_dr));
}
}
else if (auto * b = column_file->tryToInMemoryFile(); b)
{
auto new_column_file = b->clone();

// No matter or what, don't append to packs which cloned from old packs again.
// Because they could shared the same cache. And the cache can NOT be inserted from different packs in different delta.
// No matter or what, don't append to column files which cloned from old column file again.
// Because they could shared the same cache. And the cache can NOT be inserted from different column files in different delta.
new_column_file->disableAppend();
cloned_column_files.push_back(new_column_file);
}
else if (auto * t = column_file->tryToTinyFile(); t)
{
// Use a newly created page_id to reference the data page_id of current pack.
// Use a newly created page_id to reference the data page_id of current column file.
PageId new_data_page_id = context.storage_pool.newLogPageId();
wbs.log.putRefPage(new_data_page_id, t->getDataPageId());
auto new_column_file = t->cloneWith(new_data_page_id);
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Storages/DeltaMerge/Segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,6 @@ SegmentPtr Segment::applyMerge(DMContext & dm_context, //
// Created references to tail pages' pages in "log" storage, we need to write them down.
wbs.writeLogAndData();

/// Make sure saved packs are appended before unsaved packs.
ColumnFilePersisteds merged_persisted_column_files = std::move(left_persisted_files);
ColumnFiles merged_in_memory_files = std::move(left_in_memory_files);

Expand Down

0 comments on commit 35f4547

Please sign in to comment.