kangpinghuang commented on a change in pull request #596: Add implementation to
tablet
URL: https://github.com/apache/incubator-doris/pull/596#discussion_r252129200
##########
File path: be/src/olap/task/engine_storage_migration_task.cpp
##########
@@ -217,42 +213,13 @@ OLAPStatus
EngineStorageMigrationTask::_copy_index_and_data_files(
const string& schema_hash_path,
const TabletSharedPtr& ref_tablet,
vector<VersionEntity>& version_entity_vec) {
- std::stringstream prefix_stream;
- prefix_stream << schema_hash_path << "/" << ref_tablet->tablet_id();
- std::string tablet_path_prefix = prefix_stream.str();
- for (VersionEntity& entity : version_entity_vec) {
+ // TODO(lcy). copy function should be implemented
+ for (auto& entity : version_entity_vec) {
Version version = entity.version;
- VersionHash v_hash = entity.version_hash;
- for (SegmentGroupEntity segment_group_entity :
entity.segment_group_vec) {
- int32_t segment_group_id = segment_group_entity.segment_group_id;
- for (int seg_id = 0; seg_id < segment_group_entity.num_segments;
++seg_id) {
- string index_path =
-
SnapshotManager::instance()->construct_index_file_path(tablet_path_prefix,
version, v_hash, segment_group_id, seg_id);
- string ref_tablet_index_path =
ref_tablet->construct_index_file_path(
- version, v_hash, segment_group_id, seg_id);
- Status res = FileUtils::copy_file(ref_tablet_index_path,
index_path);
- if (!res.ok()) {
- LOG(WARNING) << "fail to copy index file."
- << "dest=" << index_path
- << ", src=" << ref_tablet_index_path;
- return OLAP_ERR_COPY_FILE_ERROR;
- }
-
- string data_path =
-
SnapshotManager::instance()->construct_data_file_path(tablet_path_prefix,
version, v_hash, segment_group_id, seg_id);
- string ref_tablet_data_path =
ref_tablet->construct_data_file_path(
- version, v_hash, segment_group_id, seg_id);
- res = FileUtils::copy_file(ref_tablet_data_path, data_path);
- if (!res.ok()) {
- LOG(WARNING) << "fail to copy data file."
- << "dest=" << index_path
- << ", src=" << ref_tablet_index_path;
- return OLAP_ERR_COPY_FILE_ERROR;
- }
- }
- }
+ const RowsetSharedPtr rowset =
ref_tablet->get_rowset_by_version(version);
+ std::vector<std::string> success_files;
+ RETURN_NOT_OK(rowset->make_snapshot(&success_files));
Review comment:
this should be modified
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]