Skip to content

add rowset meta manager#429

Merged
chaoyli merged 2 commits into
apache:be_refactorfrom
kangpinghuang:be_refactor_add_rowset_meta_manager
Dec 17, 2018
Merged

add rowset meta manager#429
chaoyli merged 2 commits into
apache:be_refactorfrom
kangpinghuang:be_refactor_add_rowset_meta_manager

Conversation

@kangpinghuang
Copy link
Copy Markdown
Contributor

Add Rowset Meta Manager and move rowset related code to olap/rowset dir

Copy link
Copy Markdown
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kangpinghuang
Copy link
Copy Markdown
Contributor Author

Resolve ISSUE #431

Comment thread be/src/olap/rowset/rowset.h Outdated

std::unique_ptr<RowsetReader> create_reader() = 0;

NewStatus copy(RowsetBuilder* dest_rowset_builder) = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no virtual is OK?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

_rowset_meta_pb.set_index_disk_size(index_disk_size);
}

virtual void get_column_statistics(std::vector<ColumnPruning>* column_statistics) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColumnPruning may be better to replaced by ZoneMap?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the one side, I don't think ZoneMap is a better name; One the other side, Rename could be done in another cr, because there is many other places using ColumnPruning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZoneMap is the standard to describe min/max/avg/count statistics.

Comment thread be/src/olap/rowset/rowset_meta.h Outdated
*new_delete_condition = delete_predicate;
}

virtual int64_t get_transaction_id() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transaction_id has unified to txn_id.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

NewStatus RowsetMetaManager::save(OlapMeta* meta, int64_t rowset_id, RowsetMeta* rowset_meta) {
std::string key = ROWSET_PREFIX + std::to_string(rowset_id);
RowsetMetaPb rowset_meta_pb;
rowset_meta->get_rowset_meta_pb(&rowset_meta_pb);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RowsetMetaManager should not know RowsetMetaPB. RowsetMeta is stored as pb or another format is transparent
to RowsetMetaManager. Instead, Rowset provide a serialize interface to convert pb to bytes.

Comment thread be/src/olap/rowset/rowset_meta.h Outdated

class RowsetMeta {
public:
virtual void init(const RowsetMetaPb& rowset_meta_pb) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RowsetMeta use deserialize interface to convert bytes to RowsetMetaPB.
Only RowsetMeta can know it is stored as pb or another format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

namespace doris {

class RowsetMeta {
public:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base Class need a virtual destructor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

}

virtual void set_start_version(int start_version) {
_rowset_meta_pb.set_start_version(start_version);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_start_version and set_end_version can be merged into one set_verson function.
Similarly, get_start_version and get_end_version can be merged into on get_verson.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

1. add virtual destructor
2. modify RowsetMeta realization
@chaoyli chaoyli merged commit cef2d31 into apache:be_refactor Dec 17, 2018
kangpinghuang added a commit to kangpinghuang/incubator-doris that referenced this pull request Mar 14, 2019
* add rowset meta manager

* Fix cr related problem

1. add virtual destructor
2. modify RowsetMeta realization
@kangpinghuang kangpinghuang deleted the be_refactor_add_rowset_meta_manager branch August 20, 2019 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants