提交 29d1fd04 编写于 作者: Z zs0 提交者: wangzelin.wzl

replace ObTableSchema to ObSimpleTableSchemaV2

上级 2b13a66b
......@@ -250,7 +250,7 @@ int ObAlterLocalityChecker::check_alter_locality_finished_by_tenant(const uint64
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_ids.count(); ++i) {
bool table_locality_finished = true;
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (OB_FAIL(check_stop())) {
LOG_WARN("root balancer stop", K(ret));
} else if (OB_FAIL(schema_guard.get_table_schema(table_ids.at(i), table_schema))) {
......@@ -504,7 +504,7 @@ int ObAlterLocalityChecker::check_locality_match_replica_distribution(
* the argument null_locality_table_match is an input/output argument
*/
int ObAlterLocalityChecker::process_single_table(share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTableSchema& table_schema, const share::schema::ObTenantSchema& tenant_schema,
const share::schema::ObSimpleTableSchemaV2& table_schema, const share::schema::ObTenantSchema& tenant_schema,
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& null_locality_table_match, bool& table_locality_finished)
{
......@@ -654,7 +654,7 @@ int ObAlterLocalityChecker::process_single_non_binding_tablegroup(share::schema:
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_ids.count() && tablegroup_locality_finished; ++i) {
bool table_locality_finished = true;
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (OB_FAIL(check_stop())) {
LOG_WARN("root balancer stop", K(ret));
} else if (OB_FAIL(schema_guard.get_table_schema(table_ids.at(i), table_schema))) {
......@@ -732,7 +732,8 @@ int ObAlterLocalityChecker::process_single_tablegroup(share::schema::ObSchemaGet
}
int ObAlterLocalityChecker::process_single_table_under_new_tablegroup(share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTableSchema& table_schema, const share::schema::ObTablegroupSchema& tablegroup_schema,
const share::schema::ObSimpleTableSchemaV2& table_schema,
const share::schema::ObTablegroupSchema& tablegroup_schema,
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& table_locality_finished)
{
......
......@@ -27,7 +27,7 @@ class ObPartitionInfo;
namespace schema {
class ObMultiVersionSchemaService;
class ObSchemaGetterGuard;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObTenantSchema;
} // namespace schema
} // namespace share
......@@ -127,7 +127,7 @@ private:
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& is_finished);
int process_single_table(share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTableSchema& table_schema, const share::schema::ObTenantSchema& tenant_schema,
const share::schema::ObSimpleTableSchemaV2& table_schema, const share::schema::ObTenantSchema& tenant_schema,
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& null_locality_table_finished, bool& table_locality_finished);
int process_single_binding_tablegroup(share::schema::ObSchemaGetterGuard& schema_guard,
......@@ -143,7 +143,8 @@ private:
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& tablegroup_locality_finished);
int process_single_table_under_new_tablegroup(share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTableSchema& table_schema, const share::schema::ObTablegroupSchema& tablegroup_schema,
const share::schema::ObSimpleTableSchemaV2& table_schema,
const share::schema::ObTablegroupSchema& tablegroup_schema,
const balancer::HashIndexCollection& hash_index_collection, rootserver::TenantBalanceStat& tenant_stat,
bool& table_locality_finished);
int check_stop();
......
......@@ -87,7 +87,7 @@ int ShardGroupAnalyzer::analysis(uint64_t tenant_id)
// 1. Partition function does not require equality
// 2. The number of partitions is not required to be equal
// (this is to ensure that the ShardGroup will not be broken up when adding partitions)
int ShardGroupAnalyzer::build_prefix_key(const ObTableSchema& table, TablePrefixKey& prefix_key)
int ShardGroupAnalyzer::build_prefix_key(const ObSimpleTableSchemaV2& table, TablePrefixKey& prefix_key)
{
int ret = OB_SUCCESS;
const ObString& table_name = table.get_table_name_str();
......@@ -100,7 +100,7 @@ int ShardGroupAnalyzer::build_prefix_key(const ObTableSchema& table, TablePrefix
int ShardGroupAnalyzer::build_prefix_map(uint64_t tenant_id, ShardGroupPrefixMap& prefix_map)
{
int ret = OB_SUCCESS;
ObArray<const ObTableSchema*> table_schemas;
ObArray<const ObSimpleTableSchemaV2*> table_schemas;
// In the case of shardgroup, just process standlone table, not process tablegroup
if (OB_FAIL(StatFinderUtil::get_need_balance_table_schemas_in_tenant(schema_guard_, tenant_id, table_schemas))) {
LOG_WARN("fail get schemas in tenant", K(tenant_id), K(ret));
......@@ -109,7 +109,7 @@ int ShardGroupAnalyzer::build_prefix_map(uint64_t tenant_id, ShardGroupPrefixMap
for (int64_t i = 0; i < table_schemas.count() && OB_SUCC(ret); ++i) {
ObIArray<TablePrefixValue>* prefix_info_array = NULL;
TablePrefixKey prefix_key;
const ObTableSchema& table = *table_schemas.at(i);
const ObSimpleTableSchemaV2& table = *table_schemas.at(i);
const ObString& table_name = table.get_table_name_str();
if (OB_FAIL(build_prefix_key(table, prefix_key))) {
LOG_WARN("fail extract prefix", K(ret), K(table_name), K(ret));
......@@ -415,7 +415,7 @@ int ShardGroupAnalyzer::add_to_shardgroup(ObIArray<TablePrefixValue>& cur_shard,
return ret;
}
int ShardGroupAnalyzer::next(ObIArray<const ObTableSchema*>& schemas)
int ShardGroupAnalyzer::next(ObIArray<const ObSimpleTableSchemaV2*>& schemas)
{
int ret = OB_SUCCESS;
if (cur_shard_group_idx_ >= shard_groups_.count()) {
......@@ -586,7 +586,7 @@ int TableGroupAnalyzer::next(const share::schema::ObPartitionSchema*& partition_
int PartitionTableAnalyzer::analysis(const uint64_t tenant_id)
{
int ret = OB_SUCCESS;
common::ObArray<const share::schema::ObTableSchema*> my_table_schemas;
common::ObArray<const share::schema::ObSimpleTableSchemaV2*> my_table_schemas;
if (OB_UNLIKELY(OB_INVALID_ID == tenant_id)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(ret), K(tenant_id));
......@@ -596,7 +596,7 @@ int PartitionTableAnalyzer::analysis(const uint64_t tenant_id)
} else {
table_schemas_.reset();
for (int64_t i = 0; OB_SUCC(ret) && i < my_table_schemas.count(); ++i) {
const share::schema::ObTableSchema* table_schema = my_table_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* table_schema = my_table_schemas.at(i);
int64_t part_num = 0;
if (OB_UNLIKELY(nullptr == table_schema)) {
ret = OB_ERR_UNEXPECTED;
......@@ -621,7 +621,7 @@ int PartitionTableAnalyzer::analysis(const uint64_t tenant_id)
return ret;
}
int PartitionTableAnalyzer::next(const share::schema::ObTableSchema*& table_schema)
int PartitionTableAnalyzer::next(const share::schema::ObSimpleTableSchemaV2*& table_schema)
{
int ret = OB_SUCCESS;
table_schema = nullptr;
......@@ -636,7 +636,7 @@ int PartitionTableAnalyzer::next(const share::schema::ObTableSchema*& table_sche
int NonPartitionTableAnalyzer::analysis(const uint64_t tenant_id)
{
int ret = OB_SUCCESS;
common::ObArray<const share::schema::ObTableSchema*> table_schemas;
common::ObArray<const share::schema::ObSimpleTableSchemaV2*> table_schemas;
common::ObArray<const share::schema::ObTablegroupSchema*> tg_schemas;
common::ObArray<const share::schema::ObPartitionSchema*> target_schemas;
if (OB_UNLIKELY(OB_INVALID_ID == tenant_id)) {
......@@ -649,7 +649,7 @@ int NonPartitionTableAnalyzer::analysis(const uint64_t tenant_id)
LOG_WARN("fail to get tablegroup schemas in tenant", K(ret), K(tenant_id));
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_schemas.count(); ++i) {
const ObTableSchema* schema = table_schemas.at(i);
const ObSimpleTableSchemaV2* schema = table_schemas.at(i);
int64_t part_num = 0;
if (OB_UNLIKELY(NULL == schema)) {
ret = OB_ERR_UNEXPECTED;
......
......@@ -25,7 +25,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaGetterGuard;
} // namespace schema
} // namespace share
......@@ -63,7 +63,7 @@ class TablePrefixValue {
public:
uint64_t tablegroup_id_;
uint64_t table_id_;
const share::schema::ObTableSchema* schema_;
const share::schema::ObSimpleTableSchemaV2* schema_;
TO_STRING_KV(K_(tablegroup_id), K_(table_id));
};
......@@ -91,7 +91,7 @@ public:
// Iterate the ShardGroup.
// Note: If there are multiple tables belonging to the same table group,
// only the primary table in the table group is taken as a representative and stored in tids
int next(common::ObIArray<const share::schema::ObTableSchema*>& schemas);
int next(common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& schemas);
private:
int build_prefix_map(uint64_t tenant_id, ShardGroupPrefixMap& prefix_map);
......@@ -101,7 +101,7 @@ private:
int add_to_shardgroup(common::ObIArray<TablePrefixValue>& cur_shard, int64_t cur_shard_idx,
common::hash::ObHashMap<uint64_t, int64_t>& shardgroup_map, common::ObIArray<ShardGroup*>& shardgroups);
int extract_table_name_prefix(const common::ObString& table, TablePrefixKey& prefix_info);
int build_prefix_key(const share::schema::ObTableSchema& table, TablePrefixKey& prefix_key);
int build_prefix_key(const share::schema::ObSimpleTableSchemaV2& table, TablePrefixKey& prefix_key);
private:
share::schema::ObSchemaGetterGuard& schema_guard_;
......@@ -153,14 +153,14 @@ public:
cur_table_idx_(0)
{}
int analysis(const uint64_t tenant_id);
int next(const share::schema::ObTableSchema*& table_schema);
int next(const share::schema::ObSimpleTableSchemaV2*& table_schema);
private:
share::schema::ObSchemaGetterGuard& schema_guard_;
ITenantStatFinder& stat_finder_;
common::ObIAllocator& allocator_;
common::hash::ObHashSet<uint64_t>& processed_tids_;
common::ObArray<const share::schema::ObTableSchema*> table_schemas_;
common::ObArray<const share::schema::ObSimpleTableSchemaV2*> table_schemas_;
int64_t cur_table_idx_;
};
......
......@@ -65,11 +65,11 @@ int PartitionSchemaChecker::check_same_primary_zone(
}
int PartitionSchemaChecker::check_same_primary_zone(
const common::ObIArray<const share::schema::ObTableSchema*>& table_schemas,
const common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& table_schemas,
share::schema::ObSchemaGetterGuard& schema_guard, bool& same)
{
int ret = OB_SUCCESS;
const share::schema::ObTableSchema* sample = nullptr;
const share::schema::ObSimpleTableSchemaV2* sample = nullptr;
if (OB_UNLIKELY(table_schemas.count()) <= 0) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(ret));
......@@ -79,7 +79,7 @@ int PartitionSchemaChecker::check_same_primary_zone(
} else {
same = true;
for (int64_t i = 0; OB_SUCC(ret) && i < table_schemas.count() && same; ++i) {
const share::schema::ObTableSchema* ref = table_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* ref = table_schemas.at(i);
if (nullptr == ref) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("ref ptr is null", K(ret));
......@@ -111,11 +111,12 @@ int PartitionSchemaChecker::check_same_primary_zone(
* For the range partition, this function ignores the part_num check
* FIXME:Support non-templated secondary partition
*/
bool PartitionSchemaChecker::is_same_partition_schema(const ObTableSchema& ref, const ObTableSchema& other)
bool PartitionSchemaChecker::is_same_partition_schema(
const ObSimpleTableSchemaV2& ref, const ObSimpleTableSchemaV2& other)
{
bool same = false;
if (!rootserver::ObTenantUtils::is_balance_target_schema(other)) {
/* Ignore irregular tables in system tables */
// Ignore irregular tables in system tables
same = true;
} else if (ref.get_part_level() == other.get_part_level()) {
switch (ref.get_part_level()) {
......@@ -126,9 +127,11 @@ bool PartitionSchemaChecker::is_same_partition_schema(const ObTableSchema& ref,
same = (ref.get_part_option().get_part_num() == other.get_part_option().get_part_num());
}
// The partition column needs to be able to compare
/*
if (same) {
same = (is_same_schema_partition_key_info(ref.get_partition_key_info(), other.get_partition_key_info()));
}
same = (is_same_schema_partition_key_info(ref.get_partition_key_info(),
other.get_partition_key_info()));
}*/
break;
case PARTITION_LEVEL_TWO:
same = (ref.get_part_option().get_part_func_type() == other.get_part_option().get_part_func_type()) &&
......@@ -141,34 +144,39 @@ bool PartitionSchemaChecker::is_same_partition_schema(const ObTableSchema& ref,
if (same && (ref.is_hash_subpart() || ref.is_key_subpart())) {
same = (ref.get_sub_part_option().get_part_num() == other.get_sub_part_option().get_part_num());
}
/*
if (same) {
same = (is_same_schema_partition_key_info(ref.get_partition_key_info(), other.get_partition_key_info()));
same = (is_same_schema_partition_key_info(ref.get_partition_key_info(),
other.get_partition_key_info()));
}
// subpartition column needs to be able to compare
if (same) {
same =
(is_same_schema_partition_key_info(ref.get_subpartition_key_info(), other.get_subpartition_key_info()));
same = (is_same_schema_partition_key_info(ref.get_subpartition_key_info(),
other.get_subpartition_key_info()));
}
*/
break;
default:
same = true; /* LEVEL_ZERO */
same = true; // LEVEL_ZERO
break;
}
}
return same;
}
/*
bool PartitionSchemaChecker::is_same_schema_partition_key_info(
const common::ObRowkeyInfo& left, const common::ObRowkeyInfo& right)
const common::ObRowkeyInfo &left,
const common::ObRowkeyInfo &right)
{
bool bool_ret = true;
if (left.get_size() != right.get_size()) {
bool_ret = false;
} else {
for (int64_t i = 0; bool_ret && i < left.get_size(); ++i) {
const ObRowkeyColumn* left_c = left.get_column(i);
const ObRowkeyColumn* right_c = right.get_column(i);
const ObRowkeyColumn *left_c = left.get_column(i);
const ObRowkeyColumn *right_c = right.get_column(i);
if (nullptr == left_c || nullptr == right_c) {
bool_ret = false;
} else if (left_c->get_meta_type() != right_c->get_meta_type()) {
......@@ -178,20 +186,21 @@ bool PartitionSchemaChecker::is_same_schema_partition_key_info(
}
return bool_ret;
}
*/
bool PartitionSchemaChecker::is_one_level_and_partition_by_range(
common::ObIArray<const share::schema::ObTableSchema*>& schemas)
common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& schemas)
{
bool bret = false;
if (schemas.count() > 0 && NULL != schemas.at(0)) {
const share::schema::ObTableSchema& schema = *schemas.at(0);
const share::schema::ObSimpleTableSchemaV2& schema = *schemas.at(0);
bret = PARTITION_LEVEL_ONE == schema.get_part_level() && schema.get_part_option().is_range_part();
}
return bret;
}
int ShardGroupValidator::check_table_schemas_compatible(ITenantStatFinder& stat_finder,
ObSchemaGetterGuard& schema_guard, const ObIArray<const ObTableSchema*>& tables, bool& compatible,
ObSchemaGetterGuard& schema_guard, const ObIArray<const ObSimpleTableSchemaV2*>& tables, bool& compatible,
const bool check_primary_zone)
{
int ret = OB_SUCCESS;
......@@ -221,14 +230,14 @@ int ShardGroupValidator::check_table_schemas_compatible(ITenantStatFinder& stat_
}
// 2. Ensure that the schema of each group of tablegroups is compatible,
// such as the compatibility of the partitioning method and the number of partitions
const ObTableSchema* first_table_schema = tables.at(0);
const ObSimpleTableSchemaV2* first_table_schema = tables.at(0);
ARRAY_FOREACH_X(tables, idx, cnt, OB_SUCC(ret) && compatible)
{
const ObTableSchema* table_schema = tables.at(idx);
const ObSimpleTableSchemaV2* table_schema = tables.at(idx);
uint64_t tablegroup_id = table_schema->get_tablegroup_id();
bool same = false;
if (OB_INVALID_ID != tablegroup_id) {
ObArray<const ObTableSchema*> tg_tables;
ObArray<const ObSimpleTableSchemaV2*> tg_tables;
if (OB_FAIL(schema_guard.get_table_schemas_in_tablegroup(tenant_id, tablegroup_id, tg_tables))) {
LOG_WARN("get_table_schema_by_tg_id fail", K(tenant_id), K(tablegroup_id), K(ret));
} else {
......@@ -452,7 +461,7 @@ int PartitionTableContainerBuilder::build()
if (OB_FAIL(analyzer.analysis(tenant_id_))) {
LOG_WARN("fail to analysis partition table", K(ret), K(tenant_id_));
} else {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
while (OB_SUCC(ret) && OB_SUCC(analyzer.next(table_schema))) {
if (OB_UNLIKELY(nullptr == table_schema)) {
ret = OB_ERR_UNEXPECTED;
......@@ -469,7 +478,8 @@ int PartitionTableContainerBuilder::build()
return ret;
}
int PartitionTableContainerBuilder::build_partition_table_container(const share::schema::ObTableSchema* table_schema)
int PartitionTableContainerBuilder::build_partition_table_container(
const share::schema::ObSimpleTableSchemaV2* table_schema)
{
int ret = OB_SUCCESS;
if (OB_UNLIKELY(!inited_)) {
......@@ -1023,7 +1033,7 @@ int ShardGroupContainerBuilder::TableSchemaPartitionCntCmp::sort()
}
bool ShardGroupContainerBuilder::TableSchemaPartitionCntCmp::operator()(
const share::schema::ObTableSchema* left, const share::schema::ObTableSchema* right)
const share::schema::ObSimpleTableSchemaV2* left, const share::schema::ObSimpleTableSchemaV2* right)
{
bool b_ret = false;
int64_t l_part_cnt = 0;
......@@ -1064,7 +1074,7 @@ int ShardGroupContainerBuilder::build()
if (OB_FAIL(analyzer.analysis(tenant_id_))) {
LOG_WARN("fail to analysis shardgroup", K(ret), K(tenant_id_));
} else {
ObArray<const ObTableSchema*> shardgroup_table_schemas;
ObArray<const ObSimpleTableSchemaV2*> shardgroup_table_schemas;
while (OB_SUCC(ret) && OB_SUCC(analyzer.next(shardgroup_table_schemas))) {
if (shardgroup_table_schemas.count() < 1) {
ret = OB_ERR_UNEXPECTED;
......@@ -1082,12 +1092,12 @@ int ShardGroupContainerBuilder::build()
}
int ShardGroupContainerBuilder::build_shardgroup_container(
common::ObArray<const share::schema::ObTableSchema*>& shardgroup_schemas)
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_schemas)
{
int ret = OB_SUCCESS;
common::ObZone integrated_primary_zone;
bool primary_zone_match = true;
const share::schema::ObTableSchema* sample_schema = nullptr;
const share::schema::ObSimpleTableSchemaV2* sample_schema = nullptr;
if (OB_UNLIKELY(!inited_)) {
ret = OB_NOT_INIT;
LOG_WARN("not init", K(ret));
......@@ -1160,7 +1170,7 @@ int ShardGroupContainerBuilder::locate_same_range_array(
int ShardGroupContainerBuilder::set_same_range_array(SameRangeMap& same_range_map,
const share::schema::ObPartition& partition, const int64_t part_idx,
const share::schema::ObTableSchema& table_schema)
const share::schema::ObSimpleTableSchemaV2& table_schema)
{
int ret = OB_SUCCESS;
if (OB_UNLIKELY(!inited_)) {
......@@ -1193,7 +1203,7 @@ int ShardGroupContainerBuilder::set_same_range_array(SameRangeMap& same_range_ma
}
int ShardGroupContainerBuilder::build_one_level_range_shard_partition_container(
common::ObArray<const share::schema::ObTableSchema*>& shardgroup_schemas, const bool primary_zone_match,
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_schemas, const bool primary_zone_match,
const common::ObZone& integrated_primary_zone)
{
int ret = OB_SUCCESS;
......@@ -1218,7 +1228,7 @@ int ShardGroupContainerBuilder::build_one_level_range_shard_partition_container(
// invalid shard group map
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < shardgroup_schemas.count(); ++i) {
const share::schema::ObTableSchema* table_schema = shardgroup_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* table_schema = shardgroup_schemas.at(i);
if (OB_UNLIKELY(NULL == table_schema)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("table schema ptr is null", K(ret));
......@@ -1333,7 +1343,7 @@ int ShardGroupContainerBuilder::do_build_one_level_range_partition_container(Sam
* - - - - ..... pkn p(k+1)n 2 p(k+1)n
*/
int ShardGroupContainerBuilder::build_shardgroup_partition_container(
common::ObArray<const share::schema::ObTableSchema*>& shardgroup_schemas, const bool primary_zone_match,
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_schemas, const bool primary_zone_match,
const common::ObZone& integrated_primary_zone)
{
int ret = OB_SUCCESS;
......@@ -1372,7 +1382,7 @@ int ShardGroupContainerBuilder::build_shardgroup_partition_container(
}
}
for (int64_t i = 0; OB_SUCC(ret) && i < shardgroup_schemas.count(); ++i) {
const share::schema::ObTableSchema* table_schema = shardgroup_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* table_schema = shardgroup_schemas.at(i);
int64_t this_part_num = 0;
if (OB_UNLIKELY(NULL == table_schema)) {
ret = OB_ERR_UNEXPECTED;
......@@ -1414,7 +1424,7 @@ int ShardGroupContainerBuilder::build_shardgroup_partition_container(
int64_t start_balance_group_id = max_used_balance_group_id_ + 1;
for (int64_t i = shardgroup_schemas.count() - 1; OB_SUCC(ret) && i >= 0; --i) {
const int64_t in_shard_index = shardgroup_schemas.count() - (i + 1);
const share::schema::ObTableSchema* table_schema = shardgroup_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* table_schema = shardgroup_schemas.at(i);
int64_t all_tg_idx = OB_INVALID_INDEX_INT64;
if (OB_UNLIKELY(NULL == table_schema)) {
ret = OB_ERR_UNEXPECTED;
......
......@@ -31,7 +31,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaGetterGuard;
class ObPartition;
} // namespace schema
......@@ -53,19 +53,24 @@ public:
const share::schema::ObPartitionSchema& other, share::schema::ObSchemaGetterGuard& schema_guard, bool& same);
static int check_same_primary_zone(const common::ObIArray<const share::schema::ObPartitionSchema*>& partition_schemas,
share::schema::ObSchemaGetterGuard& schema_guard, bool& same);
static int check_same_primary_zone(const common::ObIArray<const share::schema::ObTableSchema*>& partition_schemas,
static int check_same_primary_zone(
const common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& partition_schemas,
share::schema::ObSchemaGetterGuard& schema_guard, bool& same);
static bool is_same_partition_schema(
const share::schema::ObTableSchema& ref, const share::schema::ObTableSchema& other);
static bool is_same_schema_partition_key_info(const common::ObRowkeyInfo& left, const common::ObRowkeyInfo& right);
static bool is_one_level_and_partition_by_range(common::ObIArray<const share::schema::ObTableSchema*>& schemas);
const share::schema::ObSimpleTableSchemaV2& ref, const share::schema::ObSimpleTableSchemaV2& other);
/*
static bool is_same_schema_partition_key_info(const common::ObRowkeyInfo &left,
const common::ObRowkeyInfo &right);
*/
static bool is_one_level_and_partition_by_range(
common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& schemas);
};
class ShardGroupValidator {
public:
static int check_table_schemas_compatible(ITenantStatFinder& stat_finder,
share::schema::ObSchemaGetterGuard& schema_guard,
const common::ObIArray<const share::schema::ObTableSchema*>& tables, bool& compatible,
const common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& tables, bool& compatible,
const bool check_primary_zone = false);
};
......@@ -118,7 +123,7 @@ public:
int build() override;
private:
int build_partition_table_container(const share::schema::ObTableSchema* table_schema);
int build_partition_table_container(const share::schema::ObSimpleTableSchemaV2* table_schema);
};
class NonPartitionTableContainerBuilder : public IBalanceGroupContainerBuilder {
......@@ -178,29 +183,30 @@ private:
typedef common::hash::ObHashMap<common::ObRowkey, SameRangeArray*> SameRangeMap;
class TableSchemaPartitionCntCmp {
public:
TableSchemaPartitionCntCmp(common::ObArray<const share::schema::ObTableSchema*>& shardgroup_schemas)
TableSchemaPartitionCntCmp(common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_schemas)
: shardgroup_schemas_(shardgroup_schemas), ret_(common::OB_SUCCESS)
{}
int sort();
public:
bool operator()(const share::schema::ObTableSchema* l, const share::schema::ObTableSchema* r);
bool operator()(const share::schema::ObSimpleTableSchemaV2* l, const share::schema::ObSimpleTableSchemaV2* r);
private:
common::ObArray<const share::schema::ObTableSchema*>& shardgroup_schemas_;
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_schemas_;
int ret_;
};
private:
int build_shardgroup_container(common::ObArray<const share::schema::ObTableSchema*>& shardgroup_table_schemas);
int build_shardgroup_container(
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_table_schemas);
int build_one_level_range_shard_partition_container(
common::ObArray<const share::schema::ObTableSchema*>& shardgroup_table_schemas, const bool primary_zone_match,
const common::ObZone& integrated_primary_zone);
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shardgroup_table_schemas,
const bool primary_zone_match, const common::ObZone& integrated_primary_zone);
int build_shardgroup_partition_container(
common::ObArray<const share::schema::ObTableSchema*>& shargroup_table_schemas, const bool primary_zone_match,
const common::ObZone& integrated_primary_zone);
common::ObArray<const share::schema::ObSimpleTableSchemaV2*>& shargroup_table_schemas,
const bool primary_zone_match, const common::ObZone& integrated_primary_zone);
int set_same_range_array(SameRangeMap& same_range_map, const share::schema::ObPartition& partition,
const int64_t part_idx, const share::schema::ObTableSchema& table_schema);
const int64_t part_idx, const share::schema::ObSimpleTableSchemaV2& table_schema);
int locate_same_range_array(
SameRangeMap& same_range_map, const share::schema::ObPartition& partition, SameRangeArray*& same_range_array);
int do_build_one_level_range_partition_container(SameRangeMap& same_range_map, const uint64_t base_index_group_id,
......
......@@ -1559,7 +1559,7 @@ int TenantBalanceStat::get_partition_locality(const Partition& partition,
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid schema guard", K(ret), K_(schema_guard));
} else if (!is_tablegroup_id(partition.table_id_)) {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
const uint64_t table_id = partition.table_id_;
if (OB_FAIL(schema_guard_->get_table_schema(table_id, table_schema))) {
LOG_WARN("fail to get table schema", K(ret), K(table_id));
......@@ -3254,7 +3254,7 @@ int TenantBalanceStat::get_full_replica_num(const Partition& p, int64_t& count)
const uint64_t schema_id = p.table_id_;
int64_t full_count = 0;
if (!is_tablegroup_id(schema_id)) {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
if (OB_FAIL(schema_guard_->get_table_schema(schema_id, table_schema))) {
LOG_WARN("fail to get table schema", "table_id", schema_id);
} else if (OB_UNLIKELY(NULL == table_schema)) {
......@@ -3309,7 +3309,7 @@ int TenantBalanceStat::get_schema_quorum_size(const Partition& p, int64_t& quoru
const uint64_t schema_id = p.table_id_;
int64_t paxos_count = 0;
if (!is_tablegroup_id(schema_id)) {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
if (OB_FAIL(schema_guard_->get_table_schema(schema_id, table_schema))) {
LOG_WARN("fail to get table schema", "table_id", schema_id);
} else if (OB_UNLIKELY(NULL == table_schema)) {
......
......@@ -100,7 +100,7 @@ int StatFinderUtil::get_partition_entity_schemas_by_tg_idx(ITenantStatFinder& st
FOREACH_X(tid, tids, OB_SUCC(ret))
{
if (!is_new_tablegroup_id(*tid)) {
const ObTableSchema* schema = nullptr;
const ObSimpleTableSchemaV2* schema = nullptr;
if (OB_FAIL(schema_guard.get_table_schema(*tid, schema))) {
LOG_WARN("fail get table schema", K(tenant_id), K(*tid), K(tids), K(ret));
} else if (OB_ISNULL(schema)) {
......@@ -126,7 +126,7 @@ int StatFinderUtil::get_partition_entity_schemas_by_tg_idx(ITenantStatFinder& st
}
int StatFinderUtil::get_need_balance_table_schemas_in_tenant(share::schema::ObSchemaGetterGuard& schema_guard,
uint64_t tenant_id, common::ObIArray<const share::schema::ObTableSchema*>& tables)
uint64_t tenant_id, common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& tables)
{
int ret = OB_SUCCESS;
ObArray<uint64_t> tids;
......@@ -135,7 +135,7 @@ int StatFinderUtil::get_need_balance_table_schemas_in_tenant(share::schema::ObSc
} else {
FOREACH_X(tid, tids, OB_SUCC(ret))
{
const ObTableSchema* schema = NULL;
const ObSimpleTableSchemaV2* schema = NULL;
if (OB_FAIL(schema_guard.get_table_schema(*tid, schema))) {
LOG_WARN("fail get table schema", K(tenant_id), K(*tid), K(ret));
} else if (OB_ISNULL(schema)) {
......
......@@ -21,7 +21,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaGetterGuard;
} // namespace schema
} // namespace share
......@@ -105,7 +105,7 @@ public:
// Obtaining the table list from StatFinder is a snapshot, not because of map_balancer
// The result of each call in the running process is different
static int get_need_balance_table_schemas_in_tenant(share::schema::ObSchemaGetterGuard& schema_guard,
uint64_t tenant_id, common::ObIArray<const share::schema::ObTableSchema*>& tables);
uint64_t tenant_id, common::ObIArray<const share::schema::ObSimpleTableSchemaV2*>& tables);
};
class IUnitProvider {
......
......@@ -619,7 +619,7 @@ int ObLocalityChecker::check_can_modify_quorum(const balancer::HashIndexCollecti
ret = OB_EAGAIN;
LOG_WARN("locality changed, generate task next round", K(ret));
} else if (!is_tablegroup_id(table_id)) {
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
LOG_WARN("fail to get table schema", K(ret), K(table_id));
} else if (OB_ISNULL(table_schema)) {
......@@ -738,7 +738,7 @@ int ObLocalityChecker::get_partition_locality(ObFilterLocalityUtility& checker,
ret = OB_EAGAIN;
LOG_WARN("locality changed, generate task next round", K(ret));
} else if (!is_tablegroup_id(table_id)) {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
LOG_WARN("fail to get table schema", K(ret), K(table_id));
} else if (OB_UNLIKELY(nullptr == table_schema)) {
......
......@@ -22,7 +22,7 @@ namespace oceanbase {
namespace share {
class ObPartitionInfo;
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObMultiVersionSchemaService;
} // namespace schema
} // namespace share
......
......@@ -31,7 +31,7 @@ namespace schema {
class ObZoneRegion;
class ObSchemaGetterGuard;
class ObLocality;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObTablegroupSchema;
class ObTenantSchema;
class ObDatabaseSchema;
......
......@@ -22,7 +22,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObMultiVersionSchemaService;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaGetterGuard;
} // namespace schema
} // namespace share
......
......@@ -408,7 +408,7 @@ int PartitionLeaderCountBalancer::do_update_map_item_replica_attributes(SquareId
common::ObSEArray<share::ObZoneReplicaAttrSet, 7> designated_zone_locality;
bool compensate_readonly_all_server = false;
if (!is_tablegroup_id(schema_id)) {
const ObTableSchema* table_schema = nullptr;
const ObSimpleTableSchemaV2* table_schema = nullptr;
if (OB_FAIL(schema_guard_.get_table_schema(schema_id, table_schema))) {
LOG_WARN("fail to get table schema", K(ret), "table_id", schema_id);
} else if (OB_UNLIKELY(nullptr == table_schema)) {
......
......@@ -22,7 +22,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObMultiVersionSchemaService;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaGetterGuard;
} // namespace schema
} // namespace share
......
......@@ -194,7 +194,7 @@ int ObPartitionSpliter::try_split_partition()
/////////////////////////////////////////////
int ObPartitionSplitExecutor::split_table_partition(const share::schema::ObTableSchema& schema,
int ObPartitionSplitExecutor::split_table_partition(const share::schema::ObSimpleTableSchemaV2& schema,
share::ObPartitionTableOperator& pt_operator, obrpc::ObSrvRpcProxy& rpc_proxy, ObSplitPartitionArg& arg,
ObSplitProgress& split_process)
{
......
......@@ -96,8 +96,9 @@ public:
int split_tablegroup_partition(share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTablegroupSchema& tablegroup_schema, common::ObISQLClient& client,
share::ObSplitProgress& split_status);
int split_table_partition(const share::schema::ObTableSchema& schema, share::ObPartitionTableOperator& pt_operator,
obrpc::ObSrvRpcProxy& rpc_proxy, obrpc::ObSplitPartitionArg& arg, share::ObSplitProgress& split_process);
int split_table_partition(const share::schema::ObSimpleTableSchemaV2& schema,
share::ObPartitionTableOperator& pt_operator, obrpc::ObSrvRpcProxy& rpc_proxy, obrpc::ObSplitPartitionArg& arg,
share::ObSplitProgress& split_process);
int split_binding_tablegroup_partition(const share::schema::ObTablegroupSchema& schema,
share::ObPartitionTableOperator& pt_operator, obrpc::ObSrvRpcProxy& rpc_proxy, obrpc::ObSplitPartitionArg& arg,
share::ObSplitProgress& split_process);
......
......@@ -164,7 +164,7 @@ int ObPartitionTableUtil::check_merge_progress(
} else if (is_restore && !is_inner_table(this_partition_entity_id)) {
need_check = false; // user table do not suspend merge during restore
} else if (!is_tablegroup_id(this_partition_entity_id)) {
const share::schema::ObTableSchema* table_schema = nullptr;
const share::schema::ObSimpleTableSchemaV2* table_schema = nullptr;
if (OB_FAIL(schema_guard.get_table_schema(this_partition_entity_id, table_schema))) {
LOG_WARN("fail to get table schema", K(ret), "table_id", this_partition_entity_id);
} else if (nullptr == table_schema) {
......
......@@ -1435,7 +1435,7 @@ int ObAddTaskInfo::check_quorum(const share::ObPartitionInfo& partition, const b
// we need to try to modify quorum at the same time
int64_t paxos_num = OB_INVALID_COUNT;
if (!is_tablegroup_id(partition.get_table_id())) {
const share::schema::ObTableSchema* schema = NULL;
const share::schema::ObSimpleTableSchemaV2* schema = NULL;
if (OB_FAIL(schema_guard.get_table_schema(partition.get_table_id(), schema))) {
LOG_WARN("get table schema failed", K(ret), "table", partition.get_table_id());
} else if (OB_ISNULL(schema)) {
......
......@@ -147,8 +147,8 @@ int ObReplicaCreator::alloc_tablegroup_partitions_for_create(const share::schema
* partition replicas are aligned to the partition replicas
* already exist of this tablegroup.
*/
int ObReplicaCreator::alloc_partitions_for_create(const ObTableSchema& table, obrpc::ObCreateTableMode create_mode,
ObITablePartitionAddr& addr, ObIArray<TenantUnitRepCnt*>& ten_unit_arr)
int ObReplicaCreator::alloc_partitions_for_create(const ObSimpleTableSchemaV2& table,
obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr, ObIArray<TenantUnitRepCnt*>& ten_unit_arr)
{
int ret = OB_SUCCESS;
RS_TRACE(alloc_replica_begin);
......@@ -1170,7 +1170,7 @@ int ObReplicaCreator::init_addr_allocator_parameter(const share::schema::ObParti
return ret;
}
int ObReplicaCreator::get_pg_partitions(const ObTableSchema& table, ObITablePartitionAddr& addr)
int ObReplicaCreator::get_pg_partitions(const ObSimpleTableSchemaV2& table, ObITablePartitionAddr& addr)
{
int ret = OB_SUCCESS;
ObSchemaGetterGuard guard;
......@@ -1330,7 +1330,7 @@ int ObReplicaCreator::check_all_partition_allocated(
// sample_info: logonly replicas on logonly unit are filtered already
// only replicas on non logonly unit are concerned
int ObReplicaCreator::set_same_addr_ignore_logonly(const share::ObPartitionInfo& sample_info,
share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObTableSchema& table_schema,
share::schema::ObSchemaGetterGuard& schema_guard, const share::schema::ObSimpleTableSchemaV2& table_schema,
const int64_t replica_num, ObPartitionAddr& paddr)
{
int ret = OB_SUCCESS;
......@@ -1432,7 +1432,7 @@ int ObReplicaCreator::partition_all_replica(
const uint64_t table_id, const uint64_t partition_id, share::ObPartitionInfo& partition_info)
{
int ret = OB_SUCCESS;
const ObTableSchema* table = NULL;
const ObSimpleTableSchemaV2* table = NULL;
const ObTablegroupSchema* tablegroup = NULL;
const uint64_t tenant_id = extract_tenant_id(table_id);
ObReplicaFilterHolder filter;
......@@ -1479,7 +1479,7 @@ int ObReplicaCreator::table_all_partition(
{
int ret = OB_SUCCESS;
const uint64_t tenant_id = extract_tenant_id(table_id);
const ObTableSchema* table = NULL;
const ObSimpleTableSchemaV2* table = NULL;
ObReplicaFilterHolder filter;
ObSchemaGetterGuard schema_guard;
ObArray<uint64_t> unit_ids;
......@@ -1750,7 +1750,7 @@ int ObReplicaCreator::process_replica_in_logonly_unit(const share::schema::ObPar
return ret;
}
int ObReplicaCreator::standby_alloc_partitions_for_split(const share::schema::ObTableSchema& table,
int ObReplicaCreator::standby_alloc_partitions_for_split(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<int64_t>& source_part_ids, const common::ObIArray<int64_t>& partition_ids,
ObITablePartitionAddr& addr)
{
......@@ -1797,7 +1797,7 @@ int ObReplicaCreator::standby_alloc_partitions_for_split(const share::schema::Ob
RS_TRACE(alloc_replica_end);
return ret;
}
int ObReplicaCreator::alloc_table_partitions_for_standby(const share::schema::ObTableSchema& schema,
int ObReplicaCreator::alloc_table_partitions_for_standby(const share::schema::ObSimpleTableSchemaV2& schema,
const common::ObIArray<ObPartitionKey>& keys, obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr,
share::schema::ObSchemaGetterGuard& guard)
{
......
......@@ -67,8 +67,9 @@ public:
const obrpc::ObCreateTableMode create_mode, common::ObIArray<ObPartitionAddr>& tablegroup_addr,
ObIArray<share::TenantUnitRepCnt*>& ten_unit_arr);
// add partition for create table
int alloc_partitions_for_create(const share::schema::ObTableSchema& table, obrpc::ObCreateTableMode create_mode,
ObITablePartitionAddr& addr, ObIArray<share::TenantUnitRepCnt*>& ten_unit_arr);
int alloc_partitions_for_create(const share::schema::ObSimpleTableSchemaV2& table,
obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr,
ObIArray<share::TenantUnitRepCnt*>& ten_unit_arr);
// add partition for add partition
template <typename SCHEMA>
int alloc_partitions_for_add(const SCHEMA& table, const SCHEMA& inc_table, const obrpc::ObCreateTableMode create_mode,
......@@ -76,10 +77,10 @@ public:
// add partition for split
int alloc_partitions_for_split(const share::schema::ObPartitionSchema& table,
const share::schema::ObPartitionSchema& inc_table, ObITablePartitionAddr& addr);
int standby_alloc_partitions_for_split(const share::schema::ObTableSchema& table,
int standby_alloc_partitions_for_split(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<int64_t>& source_part_ids, const common::ObIArray<int64_t>& dest_partition_ids,
ObITablePartitionAddr& addr);
int alloc_table_partitions_for_standby(const share::schema::ObTableSchema& table,
int alloc_table_partitions_for_standby(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<ObPartitionKey>& keys, obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr,
share::schema::ObSchemaGetterGuard& guard);
int alloc_tablegroup_partitions_for_standby(const share::schema::ObTablegroupSchema& table_group,
......@@ -117,7 +118,7 @@ private:
balancer::ObSinglePtBalanceContainer& pt_balance_container,
common::ObIArray<common::ObZone>& high_priority_zone_array,
common::ObSEArray<share::ObRawPrimaryZoneUtil::ZoneScore, MAX_ZONE_NUM>& zone_score_array);
int get_pg_partitions(const share::schema::ObTableSchema& table, ObITablePartitionAddr& addr);
int get_pg_partitions(const share::schema::ObSimpleTableSchemaV2& table, ObITablePartitionAddr& addr);
int init_addr_allocator_parameter(const share::schema::ObPartitionSchema& partition_schema,
const obrpc::ObCreateTableMode create_mode, ObIArray<common::ObZone>& zone_list, ZoneUnitArray& unit_pool,
ObIArray<share::ObZoneReplicaAttrSet>& zone_locality, ZoneUnitPtrArray& all_zone_units_alive,
......@@ -184,7 +185,7 @@ private:
int partition_all_replica(const uint64_t table_id, const uint64_t partition_id, share::ObPartitionInfo& part);
int set_same_addr_ignore_logonly(const share::ObPartitionInfo& info, share::schema::ObSchemaGetterGuard& schema_guard,
const share::schema::ObTableSchema& table, const int64_t replica_num, ObPartitionAddr& addr);
const share::schema::ObSimpleTableSchemaV2& table, const int64_t replica_num, ObPartitionAddr& addr);
int set_same_addr(const share::ObPartitionInfo& sample_info, ObPartitionAddr& paddr);
// Get tenant all online (has heartbeat with rs) unit grouped by zone.
......
......@@ -2661,7 +2661,7 @@ int ObTenantBackup::generate_standalone_backup_task(const share::ObTenantBackupT
int ret = OB_SUCCESS;
ObSchemaGetterGuard schema_guard;
ObArray<uint64_t> table_ids;
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
int64_t table_id_index = 0;
if (!is_inited_) {
......@@ -3059,7 +3059,7 @@ int ObTenantBackup::add_standalone_key_to_extern_list(ObExternPGListMgr& pg_list
int ret = OB_SUCCESS;
ObSchemaGetterGuard schema_guard;
ObArray<uint64_t> table_ids;
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (!is_inited_) {
ret = OB_NOT_INIT;
LOG_WARN("tenant backup do not init", K(ret));
......@@ -3616,7 +3616,7 @@ int ObTenantBackup::get_table_count_with_partition(const uint64_t tenant_id, con
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_ids.count(); ++i) {
const uint64_t table_id = table_ids.at(i);
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
LOG_WARN("failed to get table schema", K(ret), K(table_id));
} else if (OB_ISNULL(table_schema)) {
......@@ -3631,7 +3631,7 @@ int ObTenantBackup::get_table_count_with_partition(const uint64_t tenant_id, con
}
int ObTenantBackup::check_standalone_table_need_backup(
const share::schema::ObTableSchema* table_schema, bool& need_backup)
const share::schema::ObSimpleTableSchemaV2* table_schema, bool& need_backup)
{
int ret = OB_SUCCESS;
ObIndexStatus status;
......
......@@ -42,7 +42,7 @@ class ObPartitionTableOperator;
class ObIBackupLeaseService;
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObMultiVersionSchemaService;
class ObSchemaGetterGuard;
} // namespace schema
......@@ -306,7 +306,7 @@ private:
int cancel_doing_pg_tasks(const share::ObTenantBackupTaskInfo& task_info, common::ObISQLClient& trans);
int get_table_count_with_partition(const uint64_t tenant_id, const int64_t tablegroup_id,
share::schema::ObSchemaGetterGuard& schema_guard, int64_t& table_count);
int check_standalone_table_need_backup(const share::schema::ObTableSchema* table_schema, bool& need_backup);
int check_standalone_table_need_backup(const share::schema::ObSimpleTableSchemaV2* table_schema, bool& need_backup);
int commit_trans(ObMySQLTransaction& trans);
int start_trans(ObTimeoutCtx& timeout_ctx, ObMySQLTransaction& trans);
int cancel_pending_pg_tasks(const share::ObTenantBackupTaskInfo& task_info, common::ObISQLClient& trans);
......
......@@ -329,15 +329,15 @@ int ObRootBalancer::alloc_tablegroup_partitions_for_create(const share::schema::
return ret;
}
int ObRootBalancer::standby_alloc_partitions_for_split(const share::schema::ObTableSchema& table,
int ObRootBalancer::standby_alloc_partitions_for_split(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<int64_t>& source_partition_ids, const common::ObIArray<int64_t>& dest_partition_ids,
ObITablePartitionAddr& addr)
{
return replica_creator_.standby_alloc_partitions_for_split(table, source_partition_ids, dest_partition_ids, addr);
}
int ObRootBalancer::alloc_partitions_for_create(
const share::schema::ObTableSchema& table, obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr)
int ObRootBalancer::alloc_partitions_for_create(const share::schema::ObSimpleTableSchemaV2& table,
obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr)
{
int ret = OB_SUCCESS;
SpinWLockGuard guard(refresh_unit_replica_cnt_lock_);
......@@ -355,7 +355,7 @@ int ObRootBalancer::alloc_partitions_for_create(
return ret;
}
int ObRootBalancer::alloc_table_partitions_for_standby(const share::schema::ObTableSchema& table,
int ObRootBalancer::alloc_table_partitions_for_standby(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<ObPartitionKey>& keys, obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr,
share::schema::ObSchemaGetterGuard& guard)
{
......
......@@ -50,7 +50,7 @@ class ObPartitionInfo;
class ObPartitionTableOperator;
class ObSplitInfo;
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObMultiVersionSchemaService;
class ObSchemaGetterGuard;
} // namespace schema
......@@ -137,16 +137,16 @@ public:
void check_server_deleting();
virtual int alloc_tablegroup_partitions_for_create(const share::schema::ObTablegroupSchema& tablegroup_schema,
const obrpc::ObCreateTableMode create_mode, common::ObIArray<ObPartitionAddr>& tablegroup_addr);
virtual int alloc_partitions_for_create(const share::schema::ObTableSchema& table,
virtual int alloc_partitions_for_create(const share::schema::ObSimpleTableSchemaV2& table,
const obrpc::ObCreateTableMode create_mode, ObITablePartitionAddr& addr);
virtual int alloc_table_partitions_for_standby(const share::schema::ObTableSchema& table,
virtual int alloc_table_partitions_for_standby(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<ObPartitionKey>& keys, const obrpc::ObCreateTableMode create_mode,
ObITablePartitionAddr& addr, share::schema::ObSchemaGetterGuard& guard);
virtual int alloc_tablegroup_partitions_for_standby(const share::schema::ObTablegroupSchema& table_group,
const common::ObIArray<ObPartitionKey>& keys, const obrpc::ObCreateTableMode create_mode,
ObITablePartitionAddr& addr, share::schema::ObSchemaGetterGuard& guard);
virtual int standby_alloc_partitions_for_split(const share::schema::ObTableSchema& table,
virtual int standby_alloc_partitions_for_split(const share::schema::ObSimpleTableSchemaV2& table,
const common::ObIArray<int64_t>& source_partition_ids, const common::ObIArray<int64_t>& dest_partition_ids,
ObITablePartitionAddr& addr);
template <typename SCHEMA>
......
......@@ -349,7 +349,7 @@ int ObTenantUtils::remove_ineffective_task(ObMySQLTransaction& trans, const uint
return ret;
}
bool ObTenantUtils::is_balance_target_schema(const share::schema::ObTableSchema& table_schema)
bool ObTenantUtils::is_balance_target_schema(const share::schema::ObSimpleTableSchemaV2& table_schema)
{
return USER_TABLE == table_schema.get_table_type() || TMP_TABLE == table_schema.get_table_type() ||
MATERIALIZED_VIEW == table_schema.get_table_type() || TMP_TABLE_ORA_SESS == table_schema.get_table_type() ||
......
......@@ -232,7 +232,7 @@ public:
static int check_small_tenant(const uint64_t tenant_id, bool& small_tenant);
static int remove_ineffective_task(common::ObMySQLTransaction& trans, const uint64_t tenant_id);
static bool is_balance_target_schema(const share::schema::ObTableSchema& table_schema);
static bool is_balance_target_schema(const share::schema::ObSimpleTableSchemaV2& table_schema);
private:
static int check_small_tenant_primary_zone_and_locality_condition(
......
......@@ -247,7 +247,7 @@ int ObSinglePartBalance::prepare_replica_capacity(const uint64_t tenant_id,
LOG_WARN("not init", KR(ret));
} else {
const share::schema::ObTenantSchema* tenant_schema = NULL;
common::ObArray<const share::schema::ObTableSchema*> table_schemas;
common::ObArray<const share::schema::ObSimpleTableSchemaV2*> table_schemas;
common::ObArray<const share::schema::ObTablegroupSchema*> tablegroup_schemas;
common::ObArray<uint64_t> non_partition_tg;
ObSEArray<ObRawPrimaryZoneUtil::ZoneScore, MAX_ZONE_NUM> zone_score_array;
......@@ -275,7 +275,7 @@ int ObSinglePartBalance::prepare_replica_capacity(const uint64_t tenant_id,
LOG_WARN("fail to get table schemas in tenant", KR(ret));
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < table_schemas.count(); ++i) {
const share::schema::ObTableSchema* table_schema = table_schemas.at(i);
const share::schema::ObSimpleTableSchemaV2* table_schema = table_schemas.at(i);
if (OB_ISNULL(table_schema)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("schema ptr is null", KR(ret));
......
......@@ -24,7 +24,7 @@ class ObPartitionReplica;
namespace schema {
class ObTenantSchema;
class ObTablegroupSchema;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObSchemaMgr;
class ObSchemaGetterGuard;
} // namespace schema
......
......@@ -25,7 +25,7 @@ class ObPartitionTableOperator;
namespace schema {
class ObMultiVersionSchemaService;
class ObSchemaGetterGuard;
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObTenantSchema;
} // namespace schema
} // namespace share
......
......@@ -148,7 +148,7 @@ int ObStartupProgressTracker::calculate_startup_progress(bool& is_finished)
LOG_WARN("table iterator iterate failed", K(ret), K(table_iterator));
}
} else {
const ObTableSchema* table_schema = NULL;
const ObSimpleTableSchemaV2* table_schema = NULL;
if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
LOG_WARN("get table schema failed", KT(table_id), K(ret));
} else if (NULL == table_schema) {
......
......@@ -22,7 +22,7 @@ namespace oceanbase {
namespace share {
namespace schema {
class ObMultiVersionSchemaService;
class ObTableSchema;
class ObSimpleTableSchemaV2;
} // namespace schema
} // namespace share
namespace rootserver {
......
......@@ -96,7 +96,7 @@ int ObLeaderElectionWaiter::wait(const ObTablegroupSchema& tablegroup_schema, co
return ret;
}
int ObLeaderElectionWaiter::wait(const ObTableSchema& table_schema, const int64_t timeout)
int ObLeaderElectionWaiter::wait(const ObSimpleTableSchemaV2& table_schema, const int64_t timeout)
{
int ret = OB_SUCCESS;
const int64_t start_time = ObTimeUtility::current_time();
......
......@@ -29,7 +29,7 @@ class ObMySQLResult;
} // namespace common
namespace share {
namespace schema {
class ObTableSchema;
class ObSimpleTableSchemaV2;
class ObTablegroupSchema;
} // namespace schema
class ObPartitionTableOperator;
......@@ -58,7 +58,7 @@ public:
int wait(const uint64_t table_id, const int64_t partition_id, const int64_t timeout, common::ObAddr& leader);
// when observer finish sending create table rpc to rs,
// invoke following function to wait the new table's leader elected
int wait(const share::schema::ObTableSchema& table_schema, const int64_t timeout);
int wait(const share::schema::ObSimpleTableSchemaV2& table_schema, const int64_t timeout);
int wait(const share::schema::ObTablegroupSchema& tablegroup_schema, const int64_t timeout);
int wait(
const common::ObArray<uint64_t>& table_ids, const common::ObArray<int64_t>& part_nums, const int64_t timeout);
......
......@@ -2562,7 +2562,7 @@ int ObPartitionLocationCache::get(const uint64_t table_id, ObIArray<ObPartitionL
LOG_WARN("location cache is not inited", K(ret));
} else {
if (!is_virtual_table(table_id)) {
const ObTableSchema* table = NULL;
const ObSimpleTableSchemaV2* table = NULL;
ObSchemaGetterGuard schema_guard;
const uint64_t tenant_id = extract_tenant_id(table_id);
if (OB_FAIL(schema_service_->get_tenant_schema_guard(tenant_id, schema_guard))) {
......
......@@ -1306,7 +1306,7 @@ int ObFullMetaTableIterator::get_part_num(const uint64_t table_id, int64_t& part
{
int ret = OB_SUCCESS;
ObSchemaGetterGuard guard;
const ObTableSchema* table = NULL;
const ObSimpleTableSchemaV2* table = NULL;
const uint64_t tenant_id = extract_tenant_id(table_id);
if (!inited_) {
ret = OB_NOT_INIT;
......
......@@ -303,7 +303,7 @@ int ObSchemaUtils::get_primary_zone_array(common::PageArena<>& alloc, const ObTa
return ret;
}
int ObSchemaUtils::get_primary_zone_array(common::PageArena<>& alloc, const ObTableSchema& table_schema,
int ObSchemaUtils::get_primary_zone_array(common::PageArena<>& alloc, const ObSimpleTableSchemaV2& table_schema,
ObSchemaGetterGuard& schema_guard, common::ObIArray<ObZoneScore>& primary_zone_array)
{
int ret = OB_SUCCESS;
......
......@@ -67,7 +67,7 @@ public:
}
static int add_column_to_table_schema(ObColumnSchemaV2& column, ObTableSchema& table_schema);
static int convert_sys_param_to_sysvar_schema(const ObSysParam& sysparam, ObSysVarSchema& sysvar_schema);
static int get_primary_zone_array(common::PageArena<>& alloc, const ObTableSchema& table_schema,
static int get_primary_zone_array(common::PageArena<>& alloc, const ObSimpleTableSchemaV2& table_schema,
ObSchemaGetterGuard& schema_guard, common::ObIArray<ObZoneScore>& primary_zone_array);
static int get_primary_zone_array(common::PageArena<>& alloc, const ObTablegroupSchema& tg_schema,
ObSchemaGetterGuard& schema_guard, common::ObIArray<ObZoneScore>& primary_zone_array);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册