[Refactor] Remove alpha/beta rowset type (#7357)
This commit is contained in:
parent
8bc3213474
commit
28cf7fac01
|
|
@ -251,10 +251,6 @@ Status Compaction::_merge_rowsets_vertically(size_t segment_iterator_num, Statis
|
|||
int64_t total_num_rows = 0;
|
||||
int64_t total_mem_footprint = 0;
|
||||
for (auto& rowset : _input_rowsets) {
|
||||
if (rowset->rowset_meta()->rowset_type() != BETA_ROWSET) {
|
||||
continue;
|
||||
}
|
||||
|
||||
total_num_rows += rowset->num_rows();
|
||||
auto* beta_rowset = down_cast<BetaRowset*>(rowset.get());
|
||||
for (auto& segment : beta_rowset->segments()) {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ Status CompactionUtils::construct_output_rowset_writer(Tablet* tablet, uint32_t
|
|||
context.tablet_id = tablet->tablet_id();
|
||||
context.partition_id = tablet->partition_id();
|
||||
context.tablet_schema_hash = tablet->schema_hash();
|
||||
context.rowset_type = BETA_ROWSET;
|
||||
context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
context.tablet_schema = &(tablet->tablet_schema());
|
||||
context.rowset_state = VISIBLE;
|
||||
|
|
|
|||
|
|
@ -243,10 +243,6 @@ Status DataDir::load() {
|
|||
// return false will break meta iterator, return true to skip this error
|
||||
return true;
|
||||
}
|
||||
LOG_IF(FATAL, rowset_meta->rowset_type() == ALPHA_ROWSET)
|
||||
<< "must change V1 format to V2 format."
|
||||
<< "tablet_id: " << rowset_meta->tablet_id() << ", tablet_uid:" << rowset_meta->tablet_uid()
|
||||
<< ", schema_hash: " << rowset_meta->tablet_schema_hash() << ", rowset_id:" << rowset_meta->rowset_id();
|
||||
dir_rowset_metas.push_back(rowset_meta);
|
||||
return true;
|
||||
};
|
||||
|
|
@ -319,8 +315,7 @@ Status DataDir::load() {
|
|||
rowset_meta, &rowset);
|
||||
if (!create_status.ok()) {
|
||||
LOG(WARNING) << "Fail to create rowset from rowsetmeta,"
|
||||
<< " rowset=" << rowset_meta->rowset_id() << " type=" << rowset_meta->rowset_type()
|
||||
<< " state=" << rowset_meta->rowset_state();
|
||||
<< " rowset=" << rowset_meta->rowset_id() << " state=" << rowset_meta->rowset_state();
|
||||
continue;
|
||||
}
|
||||
if (rowset_meta->rowset_state() == RowsetStatePB::COMMITTED &&
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ Status DeltaWriter::_init() {
|
|||
writer_context.tablet_id = _opt.tablet_id;
|
||||
writer_context.partition_id = _opt.partition_id;
|
||||
writer_context.tablet_schema_hash = _opt.schema_hash;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = _tablet->schema_hash_path();
|
||||
writer_context.rowset_state = PREPARED;
|
||||
writer_context.txn_id = _opt.txn_id;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ Status TabletManager::create_tablet(const TCreateTabletReq& req) {
|
|||
col_idx_to_unique_id[col_idx] = col_idx;
|
||||
}
|
||||
RETURN_IF_ERROR(starrocks::convert_t_schema_to_pb_schema(req.tablet_schema, next_unique_id, col_idx_to_unique_id,
|
||||
RowsetTypePB::BETA_ROWSET,
|
||||
tablet_metadata_pb.mutable_schema()));
|
||||
|
||||
// get shard group
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static Status t_column_to_pb_column(int32_t unique_id, const TColumn& t_column,
|
|||
|
||||
Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_t next_unique_id,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id,
|
||||
RowsetTypePB rowset_type, TabletSchemaPB* schema) {
|
||||
TabletSchemaPB* schema) {
|
||||
if (tablet_schema.__isset.id) {
|
||||
schema->set_id(tablet_schema.id);
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_
|
|||
schema->set_compress_kind(COMPRESS_LZ4);
|
||||
|
||||
FieldTypeVersion field_version = FieldTypeVersion::kV1;
|
||||
if ((rowset_type == BETA_ROWSET) && (config::storage_format_version == 2)) {
|
||||
if (config::storage_format_version == 2) {
|
||||
field_version = FieldTypeVersion::kV2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ enum RowsetTypePB : int;
|
|||
|
||||
Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_t next_unique_id,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id,
|
||||
RowsetTypePB rowset_type, TabletSchemaPB* schema);
|
||||
TabletSchemaPB* schema);
|
||||
|
||||
} // namespace starrocks
|
||||
|
|
@ -463,7 +463,6 @@ Status PushHandler::_delete_convert(const TabletSharedPtr& cur_tablet, RowsetSha
|
|||
context.tablet_id = cur_tablet->tablet_id();
|
||||
context.partition_id = _request.partition_id;
|
||||
context.tablet_schema_hash = cur_tablet->schema_hash();
|
||||
context.rowset_type = BETA_ROWSET;
|
||||
context.rowset_path_prefix = cur_tablet->schema_hash_path();
|
||||
context.tablet_schema = &cur_tablet->tablet_schema();
|
||||
context.rowset_state = PREPARED;
|
||||
|
|
@ -520,7 +519,6 @@ Status PushHandler::_load_convert(const TabletSharedPtr& cur_tablet, RowsetShare
|
|||
context.tablet_id = cur_tablet->tablet_id();
|
||||
context.partition_id = _request.partition_id;
|
||||
context.tablet_schema_hash = cur_tablet->schema_hash();
|
||||
context.rowset_type = BETA_ROWSET;
|
||||
context.rowset_path_prefix = cur_tablet->schema_hash_path();
|
||||
context.tablet_schema = &(cur_tablet->tablet_schema());
|
||||
context.rowset_state = PREPARED;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ Status BetaRowsetWriter::init() {
|
|||
_rowset_meta->set_partition_id(_context.partition_id);
|
||||
_rowset_meta->set_tablet_id(_context.tablet_id);
|
||||
_rowset_meta->set_tablet_schema_hash(_context.tablet_schema_hash);
|
||||
_rowset_meta->set_rowset_type(_context.rowset_type);
|
||||
_rowset_meta->set_rowset_state(_context.rowset_state);
|
||||
_rowset_meta->set_segments_overlap(_context.segments_overlap);
|
||||
if (_context.rowset_state == PREPARED || _context.rowset_state == COMMITTED) {
|
||||
|
|
@ -370,7 +369,6 @@ Status HorizontalBetaRowsetWriter::flush_chunk_with_deletes(const vectorized::Ch
|
|||
}
|
||||
|
||||
Status HorizontalBetaRowsetWriter::add_rowset(RowsetSharedPtr rowset) {
|
||||
assert(rowset->rowset_meta()->rowset_type() == BETA_ROWSET);
|
||||
RETURN_IF_ERROR(rowset->link_files_to(_context.rowset_path_prefix, _context.rowset_id));
|
||||
_num_rows_written += rowset->num_rows();
|
||||
_total_row_size += static_cast<int64_t>(rowset->total_row_size());
|
||||
|
|
|
|||
|
|
@ -35,20 +35,12 @@ namespace starrocks {
|
|||
|
||||
Status RowsetFactory::create_rowset(const TabletSchema* schema, const std::string& rowset_path,
|
||||
const RowsetMetaSharedPtr& rowset_meta, RowsetSharedPtr* rowset) {
|
||||
if (rowset_meta->rowset_type() == BETA_ROWSET) {
|
||||
*rowset =
|
||||
BetaRowset::create(ExecEnv::GetInstance()->tablet_meta_mem_tracker(), schema, rowset_path, rowset_meta);
|
||||
RETURN_IF_ERROR((*rowset)->init());
|
||||
return Status::OK();
|
||||
}
|
||||
return Status::NotSupported("unsupported rowset type");
|
||||
*rowset = BetaRowset::create(ExecEnv::GetInstance()->tablet_meta_mem_tracker(), schema, rowset_path, rowset_meta);
|
||||
RETURN_IF_ERROR((*rowset)->init());
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status RowsetFactory::create_rowset_writer(const RowsetWriterContext& context, std::unique_ptr<RowsetWriter>* output) {
|
||||
if (UNLIKELY(context.rowset_type != BETA_ROWSET)) {
|
||||
return Status::NotSupported("unsupported rowset type");
|
||||
}
|
||||
|
||||
auto tablet_schema = context.tablet_schema;
|
||||
auto memory_format_version = context.memory_format_version;
|
||||
auto storage_format_version = context.storage_format_version;
|
||||
|
|
|
|||
|
|
@ -107,10 +107,6 @@ public:
|
|||
_rowset_meta_pb.set_tablet_schema_hash(tablet_schema_hash);
|
||||
}
|
||||
|
||||
RowsetTypePB rowset_type() const { return _rowset_meta_pb.rowset_type(); }
|
||||
|
||||
void set_rowset_type(RowsetTypePB rowset_type) { _rowset_meta_pb.set_rowset_type(rowset_type); }
|
||||
|
||||
RowsetStatePB rowset_state() const { return _rowset_meta_pb.rowset_state(); }
|
||||
|
||||
void set_rowset_state(RowsetStatePB rowset_state) { _rowset_meta_pb.set_rowset_state(rowset_state); }
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ public:
|
|||
bool write_tmp = false;
|
||||
|
||||
RowsetStatePB rowset_state = PREPARED;
|
||||
RowsetTypePB rowset_type = BETA_ROWSET;
|
||||
SegmentsOverlapPB segments_overlap = OVERLAP_UNKNOWN;
|
||||
|
||||
// segment file use uint32 to represent row number, therefore the maximum is UINT32_MAX.
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,6 @@ Status SchemaChangeHandler::_convert_historical_rowsets(SchemaChangeParams& sc_p
|
|||
writer_context.tablet_id = new_tablet->tablet_id();
|
||||
writer_context.partition_id = new_tablet->partition_id();
|
||||
writer_context.tablet_schema_hash = new_tablet->schema_hash();
|
||||
writer_context.rowset_type = sc_params.new_tablet->tablet_meta()->preferred_rowset_type();
|
||||
writer_context.rowset_path_prefix = new_tablet->schema_hash_path();
|
||||
writer_context.tablet_schema = &new_tablet->tablet_schema();
|
||||
writer_context.rowset_state = VISIBLE;
|
||||
|
|
@ -1729,11 +1728,6 @@ Status SchemaChangeHandler::_parse_request(
|
|||
*sc_directly = true;
|
||||
}
|
||||
|
||||
if (base_tablet->tablet_meta()->preferred_rowset_type() != new_tablet->tablet_meta()->preferred_rowset_type()) {
|
||||
// If the base_tablet and new_tablet rowset types are different, just use directly type
|
||||
*sc_directly = true;
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -192,14 +192,6 @@ Status SnapshotManager::convert_rowset_ids(const string& clone_dir, int64_t tabl
|
|||
|
||||
std::unordered_map<Version, RowsetMetaPB*, HashOfVersion> rs_version_map;
|
||||
for (const auto& visible_rowset : cloned_tablet_meta_pb.rs_metas()) {
|
||||
if (visible_rowset.rowset_type() == ALPHA_ROWSET) {
|
||||
LOG(WARNING) << "must change V1 format to V2 format. "
|
||||
<< "tablet_id: " << visible_rowset.tablet_id()
|
||||
<< ", tablet_uid: " << visible_rowset.tablet_uid()
|
||||
<< ", schema_hash: " << visible_rowset.tablet_schema_hash()
|
||||
<< ", rowset_id:" << visible_rowset.rowset_id();
|
||||
return Status::RuntimeError("unknown rowset type");
|
||||
}
|
||||
RowsetMetaPB* rowset_meta = new_tablet_meta_pb.add_rs_metas();
|
||||
RowsetId rowset_id = StorageEngine::instance()->next_rowset_id();
|
||||
RETURN_IF_ERROR(_rename_rowset_id(visible_rowset, clone_dir, tablet_schema, rowset_id, rowset_meta));
|
||||
|
|
@ -210,13 +202,6 @@ Status SnapshotManager::convert_rowset_ids(const string& clone_dir, int64_t tabl
|
|||
}
|
||||
|
||||
for (const auto& inc_rowset : cloned_tablet_meta_pb.inc_rs_metas()) {
|
||||
if (inc_rowset.rowset_type() == ALPHA_ROWSET) {
|
||||
LOG(WARNING) << "must change V1 format to V2 format. "
|
||||
<< "tablet_id: " << inc_rowset.tablet_id() << ", tablet_uid: " << inc_rowset.tablet_uid()
|
||||
<< ", schema_hash: " << inc_rowset.tablet_schema_hash()
|
||||
<< ", rowset_id:" << inc_rowset.rowset_id();
|
||||
return Status::RuntimeError("unknown rowset type");
|
||||
}
|
||||
Version rowset_version = {inc_rowset.start_version(), inc_rowset.end_version()};
|
||||
auto exist_rs = rs_version_map.find(rowset_version);
|
||||
if (exist_rs != rs_version_map.end()) {
|
||||
|
|
@ -254,7 +239,6 @@ Status SnapshotManager::_rename_rowset_id(const RowsetMetaPB& rs_meta_pb, const
|
|||
context.tablet_id = org_rowset_meta->tablet_id();
|
||||
context.partition_id = org_rowset_meta->partition_id();
|
||||
context.tablet_schema_hash = org_rowset_meta->tablet_schema_hash();
|
||||
context.rowset_type = org_rowset_meta->rowset_type();
|
||||
context.rowset_path_prefix = new_path;
|
||||
context.tablet_schema = &tablet_schema;
|
||||
context.rowset_state = org_rowset_meta->rowset_state();
|
||||
|
|
|
|||
|
|
@ -690,12 +690,6 @@ Status TabletManager::load_tablet_from_meta(DataDir* data_dir, TTabletId tablet_
|
|||
return Status::InternalError("Invalid serialized tablet meta");
|
||||
}
|
||||
|
||||
for (const auto& rs : tablet_meta->all_rs_metas()) {
|
||||
LOG_IF(FATAL, rs->rowset_type() != BETA_ROWSET)
|
||||
<< "Unsupported rowset type " << rs->rowset_type() << " tablet_id=" << tablet_meta->tablet_id()
|
||||
<< " tablet_uid=" << rs->tablet_uid() << " schema_hash=" << tablet_meta->schema_hash()
|
||||
<< " rowset_id=" << rs->rowset_id();
|
||||
}
|
||||
if (tablet_meta->tablet_id() != tablet_id) {
|
||||
LOG(WARNING) << "Mismatched tablet_id. expect=" << tablet_id << " real=" << tablet_meta->tablet_id();
|
||||
return Status::InternalError("mismatched tablet_id");
|
||||
|
|
@ -1115,7 +1109,6 @@ Status TabletManager::_create_inital_rowset_unlocked(const TCreateTabletReq& req
|
|||
context.tablet_id = tablet->tablet_id();
|
||||
context.partition_id = tablet->partition_id();
|
||||
context.tablet_schema_hash = tablet->schema_hash();
|
||||
context.rowset_type = RowsetTypePB::BETA_ROWSET;
|
||||
context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
context.tablet_schema = &tablet->tablet_schema();
|
||||
context.rowset_state = VISIBLE;
|
||||
|
|
@ -1210,7 +1203,7 @@ Status TabletManager::_create_tablet_meta_unlocked(const TCreateTabletReq& reque
|
|||
}
|
||||
// We generate a new tablet_uid for this new tablet.
|
||||
return TabletMeta::create(_mem_tracker, normal_request, TabletUid::gen_uid(), shard_id, next_unique_id,
|
||||
col_idx_to_unique_id, RowsetTypePB::BETA_ROWSET, tablet_meta);
|
||||
col_idx_to_unique_id, tablet_meta);
|
||||
}
|
||||
|
||||
Status TabletManager::_drop_tablet_directly_unlocked(TTabletId tablet_id, TabletDropFlag flag) {
|
||||
|
|
|
|||
|
|
@ -63,14 +63,13 @@ Status AlterTabletTask::set_alter_state(AlterTabletState alter_state) {
|
|||
Status TabletMeta::create(MemTracker* mem_tracker, const TCreateTabletReq& request, const TabletUid& tablet_uid,
|
||||
uint64_t shard_id, uint32_t next_unique_id,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id,
|
||||
RowsetTypePB rowset_type, TabletMetaSharedPtr* tablet_meta) {
|
||||
TabletMetaSharedPtr* tablet_meta) {
|
||||
*tablet_meta = std::shared_ptr<TabletMeta>(
|
||||
new TabletMeta(request.table_id, request.partition_id, request.tablet_id, request.tablet_schema.schema_hash,
|
||||
shard_id, request.tablet_schema, next_unique_id,
|
||||
request.__isset.enable_persistent_index ? request.enable_persistent_index : false,
|
||||
col_ordinal_to_unique_id, tablet_uid,
|
||||
request.__isset.tablet_type ? request.tablet_type : TTabletType::TABLET_TYPE_DISK,
|
||||
rowset_type),
|
||||
request.__isset.tablet_type ? request.tablet_type : TTabletType::TABLET_TYPE_DISK),
|
||||
DeleterWithMemTracker<TabletMeta>(mem_tracker));
|
||||
mem_tracker->consume((*tablet_meta)->mem_usage());
|
||||
return Status::OK();
|
||||
|
|
@ -86,8 +85,8 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id
|
|||
uint64_t shard_id, const TTabletSchema& tablet_schema, uint32_t next_unique_id,
|
||||
bool enable_persistent_index,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id,
|
||||
const TabletUid& tablet_uid, TTabletType::type tabletType, RowsetTypePB rowset_type)
|
||||
: _tablet_uid(0, 0), _preferred_rowset_type(rowset_type) {
|
||||
const TabletUid& tablet_uid, TTabletType::type tabletType)
|
||||
: _tablet_uid(0, 0) {
|
||||
TabletMetaPB tablet_meta_pb;
|
||||
tablet_meta_pb.set_table_id(table_id);
|
||||
tablet_meta_pb.set_partition_id(partition_id);
|
||||
|
|
@ -104,7 +103,7 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id
|
|||
tablet_meta_pb.set_in_restore_mode(false);
|
||||
|
||||
TabletSchemaPB* schema = tablet_meta_pb.mutable_schema();
|
||||
convert_t_schema_to_pb_schema(tablet_schema, next_unique_id, col_ordinal_to_unique_id, rowset_type, schema);
|
||||
convert_t_schema_to_pb_schema(tablet_schema, next_unique_id, col_ordinal_to_unique_id, schema);
|
||||
|
||||
init_from_pb(&tablet_meta_pb);
|
||||
}
|
||||
|
|
@ -273,9 +272,6 @@ void TabletMeta::init_from_pb(TabletMetaPB* ptablet_meta_pb) {
|
|||
_in_restore_mode = tablet_meta_pb.in_restore_mode();
|
||||
}
|
||||
|
||||
if (tablet_meta_pb.has_preferred_rowset_type()) {
|
||||
_preferred_rowset_type = tablet_meta_pb.preferred_rowset_type();
|
||||
}
|
||||
if (tablet_meta_pb.has_updates()) {
|
||||
_updatesPB.reset(tablet_meta_pb.release_updates());
|
||||
}
|
||||
|
|
@ -326,9 +322,6 @@ void TabletMeta::to_meta_pb(TabletMetaPB* tablet_meta_pb) {
|
|||
tablet_meta_pb->set_in_restore_mode(in_restore_mode());
|
||||
|
||||
// to avoid modify tablet meta to the greatest extend
|
||||
if (_preferred_rowset_type == BETA_ROWSET) {
|
||||
tablet_meta_pb->set_preferred_rowset_type(_preferred_rowset_type);
|
||||
}
|
||||
if (_updates != nullptr) {
|
||||
_updates->to_updates_pb(tablet_meta_pb->mutable_updates());
|
||||
} else if (_updatesPB) {
|
||||
|
|
@ -604,7 +597,6 @@ bool operator==(const TabletMeta& a, const TabletMeta& b) {
|
|||
}
|
||||
if (a._alter_task != b._alter_task) return false;
|
||||
if (a._in_restore_mode != b._in_restore_mode) return false;
|
||||
if (a._preferred_rowset_type != b._preferred_rowset_type) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public:
|
|||
static Status create(MemTracker* mem_tracker, const TCreateTabletReq& request, const TabletUid& tablet_uid,
|
||||
uint64_t shard_id, uint32_t next_unique_id,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id,
|
||||
RowsetTypePB rowset_type, TabletMetaSharedPtr* tablet_meta);
|
||||
TabletMetaSharedPtr* tablet_meta);
|
||||
|
||||
static TabletMetaSharedPtr create(MemTracker* mem_tracker);
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id, int32_t schema_hash, uint64_t shard_id,
|
||||
const TTabletSchema& tablet_schema, uint32_t next_unique_id, bool enable_persistent_index,
|
||||
const std::unordered_map<uint32_t, uint32_t>& col_ordinal_to_unique_id, const TabletUid& tablet_uid,
|
||||
TTabletType::type tabletType, RowsetTypePB roset_type);
|
||||
TTabletType::type tabletType);
|
||||
|
||||
virtual ~TabletMeta() {}
|
||||
|
||||
|
|
@ -203,12 +203,6 @@ public:
|
|||
|
||||
Status set_partition_id(int64_t partition_id);
|
||||
|
||||
RowsetTypePB preferred_rowset_type() const { return _preferred_rowset_type; }
|
||||
|
||||
void set_preferred_rowset_type(RowsetTypePB preferred_rowset_type) {
|
||||
_preferred_rowset_type = preferred_rowset_type;
|
||||
}
|
||||
|
||||
// used when create new tablet
|
||||
void create_inital_updates_meta();
|
||||
// _updates will become empty after release
|
||||
|
|
@ -266,7 +260,6 @@ private:
|
|||
DelPredicateArray _del_pred_array;
|
||||
AlterTabletTaskSharedPtr _alter_task;
|
||||
bool _in_restore_mode = false;
|
||||
RowsetTypePB _preferred_rowset_type = BETA_ROWSET;
|
||||
|
||||
// This meta is used for TabletUpdates' load process,
|
||||
// to save memory it will be passed to TabletUpdates for usage
|
||||
|
|
|
|||
|
|
@ -151,8 +151,7 @@ Status TabletUpdates::_load_from_pb(const TabletUpdatesPB& tablet_updates_pb) {
|
|||
_pending_commits.emplace(version, rowset);
|
||||
} else {
|
||||
LOG(WARNING) << "Fail to create rowset from pending rowset meta. rowset="
|
||||
<< rowset_meta->rowset_id() << " type=" << rowset_meta->rowset_type()
|
||||
<< " state=" << rowset_meta->rowset_state();
|
||||
<< rowset_meta->rowset_id() << " state=" << rowset_meta->rowset_state();
|
||||
}
|
||||
return true;
|
||||
}));
|
||||
|
|
@ -174,7 +173,7 @@ Status TabletUpdates::_load_from_pb(const TabletUpdatesPB& tablet_updates_pb) {
|
|||
_rowsets[rowset_meta->get_rowset_seg_id()] = std::move(rowset);
|
||||
} else {
|
||||
LOG(WARNING) << "Fail to create rowset from rowset meta. rowset=" << rowset_meta->rowset_id()
|
||||
<< " type=" << rowset_meta->rowset_type() << " state=" << rowset_meta->rowset_state();
|
||||
<< " state=" << rowset_meta->rowset_state();
|
||||
}
|
||||
all_rowsets.insert(rowset_meta->get_rowset_seg_id());
|
||||
return true;
|
||||
|
|
@ -1098,7 +1097,6 @@ Status TabletUpdates::_do_compaction(std::unique_ptr<CompactionInfo>* pinfo, boo
|
|||
context.tablet_id = _tablet.tablet_id();
|
||||
context.partition_id = _tablet.partition_id();
|
||||
context.tablet_schema_hash = _tablet.schema_hash();
|
||||
context.rowset_type = BETA_ROWSET;
|
||||
context.rowset_path_prefix = _tablet.schema_hash_path();
|
||||
context.tablet_schema = &(_tablet.tablet_schema());
|
||||
context.rowset_state = COMMITTED;
|
||||
|
|
@ -2260,7 +2258,6 @@ Status TabletUpdates::convert_from(const std::shared_ptr<Tablet>& base_tablet, i
|
|||
writer_context.tablet_id = _tablet.tablet_id();
|
||||
writer_context.partition_id = _tablet.partition_id();
|
||||
writer_context.tablet_schema_hash = _tablet.schema_hash();
|
||||
writer_context.rowset_type = _tablet.tablet_meta()->preferred_rowset_type();
|
||||
writer_context.rowset_path_prefix = _tablet.schema_hash_path();
|
||||
writer_context.tablet_schema = &_tablet.tablet_schema();
|
||||
writer_context.rowset_state = VISIBLE;
|
||||
|
|
|
|||
|
|
@ -152,11 +152,6 @@ StatusOr<int32_t> VerticalCompactionTask::_calculate_chunk_size_for_column_group
|
|||
int64_t total_num_rows = 0;
|
||||
int64_t total_mem_footprint = 0;
|
||||
for (auto& rowset : _input_rowsets) {
|
||||
if (rowset->rowset_meta()->rowset_type() != BETA_ROWSET) {
|
||||
LOG(WARNING) << "unsupported rowset type:" << rowset->rowset_meta()->rowset_type();
|
||||
return Status::InternalError("unsupported rowset type");
|
||||
}
|
||||
|
||||
total_num_rows += rowset->num_rows();
|
||||
auto* beta_rowset = down_cast<BetaRowset*>(rowset.get());
|
||||
for (auto& segment : beta_rowset->segments()) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ public:
|
|||
rowset_writer_context->tablet_id = 12345;
|
||||
rowset_writer_context->tablet_schema_hash = 1111;
|
||||
rowset_writer_context->partition_id = 10;
|
||||
rowset_writer_context->rowset_type = _rowset_type;
|
||||
rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/0/12345/1111";
|
||||
rowset_writer_context->rowset_state = VISIBLE;
|
||||
rowset_writer_context->tablet_schema = _tablet_schema.get();
|
||||
|
|
@ -230,7 +229,6 @@ public:
|
|||
|
||||
protected:
|
||||
std::unique_ptr<TabletSchema> _tablet_schema;
|
||||
RowsetTypePB _rowset_type = BETA_ROWSET;
|
||||
std::string _schema_hash_path;
|
||||
std::unique_ptr<MemTracker> _compaction_mem_tracker;
|
||||
std::unique_ptr<MemPool> _mem_pool;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public:
|
|||
rowset_writer_context->tablet_id = 12345;
|
||||
rowset_writer_context->tablet_schema_hash = 1111;
|
||||
rowset_writer_context->partition_id = 10;
|
||||
rowset_writer_context->rowset_type = _rowset_type;
|
||||
rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/0/12345/1111";
|
||||
rowset_writer_context->rowset_state = VISIBLE;
|
||||
rowset_writer_context->tablet_schema = _tablet_schema.get();
|
||||
|
|
@ -213,7 +212,6 @@ public:
|
|||
|
||||
protected:
|
||||
std::unique_ptr<TabletSchema> _tablet_schema;
|
||||
RowsetTypePB _rowset_type = BETA_ROWSET;
|
||||
std::string _schema_hash_path;
|
||||
std::unique_ptr<MemTracker> _tablet_meta_mem_tracker;
|
||||
std::unique_ptr<MemTracker> _compaction_mem_tracker;
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ public:
|
|||
writer_context.tablet_id = rand() % 1000000;
|
||||
writer_context.tablet_schema_hash = 1111;
|
||||
writer_context.partition_id = 10;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = _root_path;
|
||||
writer_context.rowset_state = VISIBLE;
|
||||
writer_context.tablet_schema = _schema.get();
|
||||
|
|
|
|||
|
|
@ -309,7 +309,6 @@ RowsetSharedPtr create_rowset(const TabletSharedPtr& tablet, const vector<int64_
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &tablet->tablet_schema();
|
||||
|
|
|
|||
|
|
@ -190,7 +190,6 @@ protected:
|
|||
rowset_writer_context->tablet_id = 12345;
|
||||
rowset_writer_context->tablet_schema_hash = 1111;
|
||||
rowset_writer_context->partition_id = 10;
|
||||
rowset_writer_context->rowset_type = BETA_ROWSET;
|
||||
rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/beta_rowset_test";
|
||||
rowset_writer_context->rowset_state = VISIBLE;
|
||||
rowset_writer_context->tablet_schema = tablet_schema;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &tablet->tablet_schema();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &tablet->tablet_schema();
|
||||
|
|
@ -119,7 +118,6 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
|
||||
|
|
@ -280,7 +278,6 @@ TEST_F(RowsetUpdateStateTest, check_conflict) {
|
|||
writer_context.tablet_id = _tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = _tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = _tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &_tablet->tablet_schema();
|
||||
|
|
|
|||
|
|
@ -108,8 +108,7 @@ TEST(TabletMetaTest, test_create) {
|
|||
std::unique_ptr<MemTracker> mem_tracker = std::make_unique<MemTracker>(-1);
|
||||
TabletMetaSharedPtr tablet_meta;
|
||||
Status st = TabletMeta::create(mem_tracker.get(), request, TabletUid(321, 456), 987 /*shared_id*/,
|
||||
20000 /*next_unique_id*/, col_ordinal_to_unique_id, RowsetTypePB::BETA_ROWSET,
|
||||
&tablet_meta);
|
||||
20000 /*next_unique_id*/, col_ordinal_to_unique_id, &tablet_meta);
|
||||
ASSERT_TRUE(st.ok());
|
||||
ASSERT_TRUE(tablet_meta != nullptr);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &tablet->tablet_schema();
|
||||
|
|
@ -99,10 +98,8 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
|
||||
writer_context.partial_update_tablet_schema = partial_schema;
|
||||
writer_context.referenced_column_ids = column_indexes;
|
||||
writer_context.tablet_schema = partial_schema.get();
|
||||
|
|
@ -134,7 +131,6 @@ public:
|
|||
writer_context.tablet_id = tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &tablet->tablet_schema();
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ public:
|
|||
rowset_writer_context->tablet_id = 12345;
|
||||
rowset_writer_context->tablet_schema_hash = 1111;
|
||||
rowset_writer_context->partition_id = 10;
|
||||
rowset_writer_context->rowset_type = BETA_ROWSET;
|
||||
rowset_writer_context->rowset_path_prefix = schema_hash_path;
|
||||
rowset_writer_context->rowset_state = VISIBLE;
|
||||
rowset_writer_context->tablet_schema = tablet_schema;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public:
|
|||
writer_context.tablet_id = _tablet->tablet_id();
|
||||
writer_context.tablet_schema_hash = _tablet->schema_hash();
|
||||
writer_context.partition_id = 0;
|
||||
writer_context.rowset_type = BETA_ROWSET;
|
||||
writer_context.rowset_path_prefix = _tablet->schema_hash_path();
|
||||
writer_context.rowset_state = COMMITTED;
|
||||
writer_context.tablet_schema = &_tablet->tablet_schema();
|
||||
|
|
|
|||
|
|
@ -959,10 +959,6 @@ public class SchemaChangeHandler extends AlterHandler {
|
|||
schemaChangeJob.setBloomFilterInfo(hasBfChange, bfColumns, bfFpp);
|
||||
schemaChangeJob.setAlterIndexInfo(hasIndexChange, indexes);
|
||||
schemaChangeJob.setStartTime(ConnectContext.get().getStartTime());
|
||||
|
||||
// If StorageFormat is set to TStorageFormat.V2
|
||||
// which will create tablet with preferred_rowset_type set to BETA
|
||||
// for both base table and rollup index
|
||||
schemaChangeJob.setStorageFormat(storageFormat);
|
||||
|
||||
// begin checking each table
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ message RowsetMetaPB {
|
|||
optional int64 txn_id = 4;
|
||||
// tablet id and schema hash could find tablet
|
||||
optional int32 tablet_schema_hash = 5;
|
||||
optional RowsetTypePB rowset_type = 6;
|
||||
optional RowsetTypePB rowset_type = 6 [default = BETA_ROWSET]; // deprecated
|
||||
optional RowsetStatePB rowset_state = 7;
|
||||
// only for visible rowset.
|
||||
optional int64 start_version = 8;
|
||||
|
|
@ -244,7 +244,7 @@ message TabletMetaPB {
|
|||
// a uniqued id to identified tablet with same tablet_id and schema hash
|
||||
optional PUniqueId tablet_uid = 14;
|
||||
optional int64 end_rowset_id = 15;
|
||||
optional RowsetTypePB preferred_rowset_type = 16;
|
||||
optional RowsetTypePB preferred_rowset_type = 16 [default = BETA_ROWSET]; // deprecated
|
||||
optional TabletTypePB tablet_type = 17;
|
||||
optional TabletUpdatesPB updates = 50; // used for new updatable tablet
|
||||
optional bool enable_persistent_index = 51 [default = false]; // used for persistent index in primary index
|
||||
|
|
|
|||
|
|
@ -90,10 +90,6 @@ class BeTabletResolver:
|
|||
rowset['tablet_id'] = rs_meta['tablet_id']
|
||||
rowset['num_rows'] = rs_meta['num_rows']
|
||||
rowset['data_disk_size'] = rs_meta['data_disk_size']
|
||||
if rs_meta['rowset_type'] == 'BETA_ROWSET':
|
||||
rowset['is_beta'] = True
|
||||
else:
|
||||
rowset['is_beta'] = False
|
||||
rowsets.append(rowset);
|
||||
|
||||
self.tablet_infos[rs_meta['tablet_id']] = rowsets
|
||||
|
|
|
|||
Loading…
Reference in New Issue