placeholder for data_disk_part2
This commit is contained in:
parent
d9938cb547
commit
38d42a7520
@ -151,6 +151,9 @@ int ObAllVirtualServer::inner_get_next_row(ObNewRow *&row)
|
||||
case DATA_DISK_ALLOCATED:
|
||||
cur_row_.cells_[i].set_int(data_disk_allocated);
|
||||
break;
|
||||
case DATA_DISK_ASSIGNED:
|
||||
cur_row_.cells_[i].set_null();
|
||||
break;
|
||||
case DATA_DISK_HEALTH_STATUS:
|
||||
cur_row_.cells_[i].set_varchar(data_disk_health_status);
|
||||
cur_row_.cells_[i].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
|
@ -42,7 +42,8 @@ class ObAllVirtualServer : public common::ObVirtualTableScannerIterator
|
||||
LOG_DISK_IN_USE,
|
||||
SSL_CERT_EXPIRED_TIME,
|
||||
MEMORY_LIMIT,
|
||||
DATA_DISK_ALLOCATED
|
||||
DATA_DISK_ALLOCATED,
|
||||
DATA_DISK_ASSIGNED // not used, only as placeholder
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -263,6 +263,10 @@ int ObAllVirtualUnit::inner_get_next_row(ObNewRow *&row)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_DISK_SIZE: {
|
||||
cur_row_.cells_[i].set_null();
|
||||
break;
|
||||
}
|
||||
case STATUS: {
|
||||
const char* status_str = share::ObUnitInfoGetter::get_unit_status_str(tenant_meta.unit_.unit_status_);
|
||||
cur_row_.cells_[i].set_varchar(status_str);
|
||||
|
@ -43,7 +43,8 @@ class ObAllVirtualUnit : public common::ObVirtualTableScannerIterator
|
||||
STATUS,
|
||||
CREATE_TIME,
|
||||
ZONE_TYPE,
|
||||
REGION
|
||||
REGION,
|
||||
DATA_DISK_SIZE // not used, only as placeholder
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -5890,6 +5890,21 @@ int ObInnerTableSchema::all_virtual_unit_schema(ObTableSchema &table_schema)
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("data_disk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
true, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
table_schema.get_part_option().set_part_num(1);
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ONE);
|
||||
@ -6244,6 +6259,21 @@ int ObInnerTableSchema::all_virtual_server_schema(ObTableSchema &table_schema)
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("data_disk_assigned", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
true, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
table_schema.get_part_option().set_part_num(1);
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ONE);
|
||||
|
@ -2656,6 +2656,21 @@ int ObInnerTableSchema::all_virtual_unit_ora_schema(ObTableSchema &table_schema)
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("DATA_DISK_SIZE", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObNumberType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
38, //column_length
|
||||
38, //column_precision
|
||||
0, //column_scale
|
||||
true, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
table_schema.get_part_option().set_part_num(1);
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ONE);
|
||||
|
@ -11729,6 +11729,7 @@ def_table_schema(
|
||||
('create_time', 'int'),
|
||||
('zone_type', 'varchar:MAX_ZONE_TYPE_LENGTH'),
|
||||
('region', 'varchar:MAX_REGION_LENGTH'),
|
||||
('data_disk_size', 'int', 'true'),
|
||||
],
|
||||
partition_columns = ['svr_ip', 'svr_port'],
|
||||
vtable_route_policy = 'distributed',
|
||||
@ -11766,6 +11767,7 @@ def_table_schema(
|
||||
('ssl_cert_expired_time', 'int'),
|
||||
('memory_limit', 'int'),
|
||||
('data_disk_allocated', 'int'),
|
||||
('data_disk_assigned', 'int', 'true'),
|
||||
],
|
||||
partition_columns = ['svr_ip', 'svr_port'],
|
||||
vtable_route_policy = 'distributed',
|
||||
|
@ -72,6 +72,10 @@ void ObServerResourceInfo::reset()
|
||||
|
||||
disk_total_ = 0;
|
||||
disk_in_use_ = 0;
|
||||
|
||||
// placeholders
|
||||
log_disk_in_use_ = 0; // not used
|
||||
report_data_disk_assigned_ = 0; // not used
|
||||
}
|
||||
|
||||
bool ObServerResourceInfo::is_valid() const
|
||||
@ -144,7 +148,9 @@ OB_SERIALIZE_MEMBER(ObServerResourceInfo,
|
||||
log_disk_total_,
|
||||
report_log_disk_assigned_,
|
||||
disk_total_,
|
||||
disk_in_use_);
|
||||
disk_in_use_,
|
||||
report_data_disk_assigned_, // not used, only as placeholder
|
||||
log_disk_in_use_); // not used, only as placeholder
|
||||
|
||||
DEF_TO_STRING(ObServerResourceInfo)
|
||||
{
|
||||
|
@ -83,9 +83,11 @@ public:
|
||||
|
||||
int64_t log_disk_total_; // 日志盘总容量
|
||||
int64_t report_log_disk_assigned_; // 日志盘已分配大小:server所有unit log_disk_size总和
|
||||
int64_t log_disk_in_use_; // not used, only as placeholder
|
||||
|
||||
int64_t disk_total_; // 数据盘总容量大小
|
||||
int64_t disk_in_use_; // 数据盘已使用大小
|
||||
int64_t report_data_disk_assigned_; // not used, only as placeholder
|
||||
|
||||
|
||||
ObServerResourceInfo();
|
||||
|
@ -62,7 +62,7 @@ ObUnitResource::ObUnitResource(
|
||||
max_iops_(max_iops),
|
||||
min_iops_(min_iops),
|
||||
iops_weight_(iops_weight),
|
||||
data_disk_size_(INVALID_DATA_DISK_SIZE)
|
||||
data_disk_size_(DEFAULT_DATA_DISK_SIZE)
|
||||
{
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ void ObUnitResource::reset()
|
||||
max_iops_ = 0;
|
||||
min_iops_ = 0;
|
||||
iops_weight_ = INVALID_IOPS_WEIGHT;
|
||||
data_disk_size_ = INVALID_DATA_DISK_SIZE;
|
||||
data_disk_size_ = DEFAULT_DATA_DISK_SIZE;
|
||||
}
|
||||
|
||||
void ObUnitResource::set(
|
||||
@ -94,7 +94,7 @@ void ObUnitResource::set(
|
||||
max_iops_ = max_iops;
|
||||
min_iops_ = min_iops;
|
||||
iops_weight_ = iops_weight;
|
||||
data_disk_size_ = INVALID_DATA_DISK_SIZE;
|
||||
data_disk_size_ = DEFAULT_DATA_DISK_SIZE;
|
||||
}
|
||||
|
||||
int ObUnitResource::init_and_check_cpu_(const ObUnitResource &user_spec)
|
||||
@ -511,7 +511,7 @@ ObUnitResource &ObUnitResource::operator=(const ObUnitResource &other)
|
||||
max_iops_ = other.max_iops_;
|
||||
min_iops_ = other.min_iops_;
|
||||
iops_weight_ = other.iops_weight_;
|
||||
data_disk_size_ = INVALID_DATA_DISK_SIZE;
|
||||
data_disk_size_ = DEFAULT_DATA_DISK_SIZE;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
static const int64_t INVALID_LOG_DISK_SIZE = -1;
|
||||
|
||||
////////////////////////// DATA DISK ////////////////////////////
|
||||
static const int64_t DEFAULT_DATA_DISK_SIZE = 0;
|
||||
static const int64_t INVALID_DATA_DISK_SIZE = -1;
|
||||
|
||||
////////////////////////// IOPS ////////////////////////////
|
||||
|
@ -2578,6 +2578,7 @@ status varchar(64) NO NULL
|
||||
create_time bigint(20) NO NULL
|
||||
zone_type varchar(128) NO NULL
|
||||
region varchar(128) NO NULL
|
||||
data_disk_size bigint(20) YES NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_unit;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
|
@ -6156,6 +6156,7 @@ status varchar(64) NO NULL
|
||||
create_time bigint(20) NO NULL
|
||||
zone_type varchar(128) NO NULL
|
||||
region varchar(128) NO NULL
|
||||
data_disk_size bigint(20) YES NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_unit;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
@ -6184,6 +6185,7 @@ log_disk_in_use bigint(20) NO NULL
|
||||
ssl_cert_expired_time bigint(20) NO NULL
|
||||
memory_limit bigint(20) NO NULL
|
||||
data_disk_allocated bigint(20) NO NULL
|
||||
data_disk_assigned bigint(20) YES NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_server;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
|
Loading…
x
Reference in New Issue
Block a user