add virtual table| view about tmp file
This commit is contained in:
parent
6d520e25a9
commit
695a8e0b54
@ -448,6 +448,7 @@ ob_set_subtarget(ob_server virtual_table
|
||||
virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp
|
||||
virtual_table/ob_all_virtual_compatibility_control.cpp
|
||||
virtual_table/ob_all_virtual_session_ps_info.cpp
|
||||
virtual_table/ob_all_virtual_tmp_file.cpp
|
||||
)
|
||||
|
||||
ob_server_add_target(ob_server)
|
||||
|
221
src/observer/virtual_table/ob_all_virtual_tmp_file.cpp
Normal file
221
src/observer/virtual_table/ob_all_virtual_tmp_file.cpp
Normal file
@ -0,0 +1,221 @@
|
||||
/**
|
||||
* Copyright (c) 2021 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#include "observer/virtual_table/ob_all_virtual_tmp_file.h"
|
||||
#include "observer/ob_server.h"
|
||||
#include "storage/tmp_file/ob_shared_nothing_tmp_file.h"
|
||||
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::transaction;
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace observer
|
||||
{
|
||||
|
||||
ObAllVirtualTmpFileInfo::ObAllVirtualTmpFileInfo()
|
||||
: ObVirtualTableScannerIterator(),
|
||||
fd_arr_(),
|
||||
is_ready_(false),
|
||||
fd_idx_(-1)
|
||||
{
|
||||
}
|
||||
|
||||
ObAllVirtualTmpFileInfo::~ObAllVirtualTmpFileInfo()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
void ObAllVirtualTmpFileInfo::reset()
|
||||
{
|
||||
// release tenant resources first
|
||||
omt::ObMultiTenantOperator::reset();
|
||||
ip_buffer_[0] = '\0';
|
||||
trace_id_buffer_[0] = '\0';
|
||||
fd_arr_.reset();
|
||||
is_ready_ = false;
|
||||
fd_idx_ = -1;
|
||||
ObVirtualTableScannerIterator::reset();
|
||||
}
|
||||
|
||||
void ObAllVirtualTmpFileInfo::release_last_tenant()
|
||||
{
|
||||
// resources related with tenant must be released by this function
|
||||
fd_arr_.reset();
|
||||
is_ready_ = false;
|
||||
fd_idx_ = -1;
|
||||
}
|
||||
|
||||
bool ObAllVirtualTmpFileInfo::is_need_process(uint64_t tenant_id)
|
||||
{
|
||||
bool bool_ret = false;
|
||||
if (is_sys_tenant(effective_tenant_id_) || tenant_id == effective_tenant_id_) {
|
||||
bool_ret = true;
|
||||
}
|
||||
|
||||
return bool_ret;
|
||||
}
|
||||
|
||||
int ObAllVirtualTmpFileInfo::get_next_tmp_file_info_(tmp_file::ObSNTmpFileInfo &tmp_file_info)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_UNLIKELY(0 > fd_idx_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SERVER_LOG(WARN, "unexpected fd_idx_", KR(ret), K(fd_idx_));
|
||||
} else {
|
||||
bool has_get = false;
|
||||
while (OB_SUCC(ret)
|
||||
&& !has_get) {
|
||||
if (fd_idx_ >= fd_arr_.count()) {
|
||||
ret = OB_ITER_END;
|
||||
SERVER_LOG(INFO, "iterate current tenant reach end", K(fd_idx_), K(fd_arr_.count()));
|
||||
} else if (OB_FAIL(FILE_MANAGER_INSTANCE_V2.get_tmp_file_info(fd_arr_.at(fd_idx_), tmp_file_info))) {
|
||||
if (OB_ENTRY_NOT_EXIST == ret || OB_TIMEOUT == ret) {
|
||||
SERVER_LOG(INFO, "tmp file does not exist or is locked by others", KR(ret), K(fd_arr_.at(fd_idx_)));
|
||||
ret = OB_SUCCESS;
|
||||
} else {
|
||||
SERVER_LOG(WARN, "fail to get tmp file info", KR(ret), K(fd_idx_), K(fd_arr_), K(fd_arr_.at(fd_idx_)));
|
||||
}
|
||||
} else {
|
||||
has_get = true;
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
fd_idx_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObAllVirtualTmpFileInfo::process_curr_tenant(common::ObNewRow *&row)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (nullptr == allocator_) {
|
||||
ret = OB_NOT_INIT;
|
||||
SERVER_LOG(WARN, "allocator_ shouldn't be nullptr", K(allocator_), KR(ret));
|
||||
} else if (FALSE_IT(start_to_read_ = true)) {
|
||||
} else if (!is_ready_) {
|
||||
if (OB_UNLIKELY(!fd_arr_.empty())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SERVER_LOG(WARN, "unexpected fd_arr_", KR(ret), K(fd_arr_));
|
||||
} else if (OB_FAIL(FILE_MANAGER_INSTANCE_V2.get_tmp_file_fds(fd_arr_))) {
|
||||
SERVER_LOG(WARN, "fail to get tmp file fd arr", KR(ret));
|
||||
if (OB_NOT_INIT == ret) {
|
||||
ret = OB_SUCCESS;
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
is_ready_ = true;
|
||||
fd_idx_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
tmp_file::ObSNTmpFileInfo tmp_file_info;
|
||||
if (OB_FAIL(get_next_tmp_file_info_(tmp_file_info))) {
|
||||
if (OB_ITER_END != ret) {
|
||||
SERVER_LOG(WARN, "fail to get next tmp file info", KR(ret));
|
||||
}
|
||||
} else {
|
||||
const int64_t col_count = output_column_ids_.count();
|
||||
ObAddr self_addr = GCONF.self_addr_;
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) {
|
||||
uint64_t col_id = output_column_ids_.at(i);
|
||||
switch (col_id) {
|
||||
case TENANT_ID:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.tenant_id_);
|
||||
break;
|
||||
case SVR_IP:
|
||||
MEMSET(ip_buffer_, '\0', OB_IP_STR_BUFF);
|
||||
(void)self_addr.ip_to_string(ip_buffer_, common::OB_IP_STR_BUFF);
|
||||
cur_row_.cells_[i].set_varchar(ip_buffer_);
|
||||
cur_row_.cells_[i].set_default_collation_type();
|
||||
break;
|
||||
case SVR_PORT:
|
||||
cur_row_.cells_[i].set_int(self_addr.get_port());
|
||||
break;
|
||||
case FILE_ID:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.fd_);
|
||||
break;
|
||||
case TRACE_ID:
|
||||
MEMSET(trace_id_buffer_, '\0', OB_MAX_TRACE_ID_BUFFER_SIZE);
|
||||
if (!tmp_file_info.trace_id_.is_invalid()) {
|
||||
tmp_file_info.trace_id_.to_string(trace_id_buffer_, OB_MAX_TRACE_ID_BUFFER_SIZE);
|
||||
}
|
||||
cur_row_.cells_[i].set_varchar(trace_id_buffer_);
|
||||
cur_row_.cells_[i].set_default_collation_type();
|
||||
break;
|
||||
case DIR_ID:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.dir_id_);
|
||||
break;
|
||||
case BYTES:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.file_size_);
|
||||
break;
|
||||
case START_OFFSET:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.truncated_offset_);
|
||||
break;
|
||||
case IS_DELETING:
|
||||
cur_row_.cells_[i].set_bool(tmp_file_info.is_deleting_);
|
||||
break;
|
||||
case CACHED_PAGE_NUM:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.cached_page_num_);
|
||||
break;
|
||||
case WRITE_BACK_PAGE_NUM:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.write_back_data_page_num_);
|
||||
break;
|
||||
case FLUSHED_PAGE_NUM:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.flushed_data_page_num_);
|
||||
break;
|
||||
case REF_CNT:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.ref_cnt_);
|
||||
break;
|
||||
case TOTAL_WRITES:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.write_req_cnt_);
|
||||
break;
|
||||
case UNALIGNED_WRITES:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.unaligned_write_req_cnt_);
|
||||
break;
|
||||
case TOTAL_READS:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.read_req_cnt_);
|
||||
break;
|
||||
case UNALIGNED_READS:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.unaligned_read_req_cnt_);
|
||||
break;
|
||||
case TOTAL_READ_BYTES:
|
||||
cur_row_.cells_[i].set_int(tmp_file_info.total_read_size_);
|
||||
break;
|
||||
case LAST_ACCESS_TIME:
|
||||
cur_row_.cells_[i].set_timestamp(tmp_file_info.last_access_ts_);
|
||||
break;
|
||||
case LAST_MODIFY_TIME:
|
||||
cur_row_.cells_[i].set_timestamp(tmp_file_info.last_modify_ts_);
|
||||
break;
|
||||
case BIRTH_TIME:
|
||||
cur_row_.cells_[i].set_timestamp(tmp_file_info.birth_ts_);
|
||||
break;
|
||||
default:
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SERVER_LOG(WARN, "invalid coloum_id", KR(ret), K(col_id));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
row = &cur_row_;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
81
src/observer/virtual_table/ob_all_virtual_tmp_file.h
Normal file
81
src/observer/virtual_table/ob_all_virtual_tmp_file.h
Normal file
@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Copyright (c) 2023 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#ifndef OB_ALL_VIRTUAL_TMP_FILE_H_
|
||||
#define OB_ALL_VIRTUAL_TMP_FILE_H_
|
||||
|
||||
#include "share/ob_virtual_table_scanner_iterator.h"
|
||||
#include "common/ob_clock_generator.h"
|
||||
#include "observer/omt/ob_multi_tenant_operator.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace tmp_file
|
||||
{
|
||||
class ObSNTmpFileInfo;
|
||||
}
|
||||
namespace observer
|
||||
{
|
||||
|
||||
class ObAllVirtualTmpFileInfo: public common::ObVirtualTableScannerIterator,
|
||||
public omt::ObMultiTenantOperator
|
||||
{
|
||||
public:
|
||||
ObAllVirtualTmpFileInfo();
|
||||
~ObAllVirtualTmpFileInfo();
|
||||
|
||||
public:
|
||||
virtual int inner_get_next_row(common::ObNewRow *&row) { return execute(row);}
|
||||
virtual void reset();
|
||||
|
||||
private:
|
||||
virtual bool is_need_process(uint64_t tenant_id) override;
|
||||
virtual int process_curr_tenant(common::ObNewRow *&row) override;
|
||||
virtual void release_last_tenant() override;
|
||||
int get_next_tmp_file_info_(tmp_file::ObSNTmpFileInfo &tmp_file_info);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
TENANT_ID = common::OB_APP_MIN_COLUMN_ID,
|
||||
SVR_IP,
|
||||
SVR_PORT,
|
||||
FILE_ID,
|
||||
TRACE_ID,
|
||||
DIR_ID,
|
||||
BYTES,
|
||||
START_OFFSET,
|
||||
IS_DELETING,
|
||||
CACHED_PAGE_NUM,
|
||||
WRITE_BACK_PAGE_NUM,
|
||||
FLUSHED_PAGE_NUM,
|
||||
REF_CNT,
|
||||
TOTAL_WRITES,
|
||||
UNALIGNED_WRITES,
|
||||
TOTAL_READS,
|
||||
UNALIGNED_READS,
|
||||
TOTAL_READ_BYTES,
|
||||
LAST_ACCESS_TIME,
|
||||
LAST_MODIFY_TIME,
|
||||
BIRTH_TIME
|
||||
};
|
||||
char ip_buffer_[common::OB_IP_STR_BUFF];
|
||||
char trace_id_buffer_[common::OB_MAX_TRACE_ID_BUFFER_SIZE];
|
||||
ObArray<int64_t> fd_arr_;
|
||||
bool is_ready_;
|
||||
int64_t fd_idx_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTmpFileInfo);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
#endif /* OB_ALL_VIRTUAL_TMP_FILE_H_ */
|
@ -233,6 +233,7 @@
|
||||
#include "observer/virtual_table/ob_information_schema_enable_roles_table.h"
|
||||
#include "observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h"
|
||||
#include "observer/virtual_table/ob_all_virtual_compatibility_control.h"
|
||||
#include "observer/virtual_table/ob_all_virtual_tmp_file.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
@ -2779,6 +2780,18 @@ int ObVTIterCreator::create_vt_iter(ObVTableScanParam ¶ms,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OB_ALL_VIRTUAL_TEMP_FILE_TID:
|
||||
{
|
||||
ObAllVirtualTmpFileInfo *all_tmp_file_info = NULL;
|
||||
if (OB_FAIL(NEW_VIRTUAL_TABLE(ObAllVirtualTmpFileInfo, all_tmp_file_info))) {
|
||||
SERVER_LOG(ERROR, "ObAllVirtualTmpFileInfo construct failed", K(ret));
|
||||
} else if (OB_FAIL(all_tmp_file_info->init())) {
|
||||
SERVER_LOG(WARN, "fail to init all_tmp_file_info", K(ret));
|
||||
} else {
|
||||
vt_iter = static_cast<ObVirtualTableIterator *>(all_tmp_file_info);
|
||||
}
|
||||
break;
|
||||
}
|
||||
END_CREATE_VT_ITER_SWITCH_LAMBDA
|
||||
|
||||
#define AGENT_VIRTUAL_TABLE_CREATE_ITER
|
||||
|
402
src/share/inner_table/ob_inner_table_schema.12501_12550.cpp
Normal file
402
src/share/inner_table/ob_inner_table_schema.12501_12550.cpp
Normal file
@ -0,0 +1,402 @@
|
||||
/**
|
||||
* Copyright (c) 2021 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#define USING_LOG_PREFIX SHARE_SCHEMA
|
||||
#include "ob_inner_table_schema.h"
|
||||
|
||||
#include "share/schema/ob_schema_macro_define.h"
|
||||
#include "share/schema/ob_schema_service_sql_impl.h"
|
||||
#include "share/schema/ob_table_schema.h"
|
||||
#include "share/scn.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
using namespace share::schema;
|
||||
using namespace common;
|
||||
namespace share
|
||||
{
|
||||
|
||||
int ObInnerTableSchema::all_virtual_temp_file_schema(ObTableSchema &table_schema)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
||||
|
||||
//generated fields:
|
||||
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
||||
table_schema.set_tablegroup_id(OB_INVALID_ID);
|
||||
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
||||
table_schema.set_table_id(OB_ALL_VIRTUAL_TEMP_FILE_TID);
|
||||
table_schema.set_rowkey_split_pos(0);
|
||||
table_schema.set_is_use_bloomfilter(false);
|
||||
table_schema.set_progressive_merge_num(0);
|
||||
table_schema.set_rowkey_column_num(0);
|
||||
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
||||
table_schema.set_table_type(VIRTUAL_TABLE);
|
||||
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
||||
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TEMP_FILE_TNAME))) {
|
||||
LOG_ERROR("fail to set table_name", K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
||||
LOG_ERROR("fail to set compress_func_name", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
||||
table_schema.set_charset_type(ObCharset::get_default_charset());
|
||||
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("tenant_id", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("svr_ip", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
1, //part_key_pos
|
||||
ObVarcharType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
MAX_IP_ADDR_LENGTH, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("svr_port", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
2, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("file_id", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("trace_id", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObVarcharType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
OB_MAX_TRACE_ID_BUFFER_SIZE, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("dir_id", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("bytes", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("start_offset", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("is_deleting", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTinyIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
1, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("cached_page_num", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("write_back_page_num", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("flushed_page_num", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("ref_cnt", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("total_writes", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("unaligned_writes", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("total_reads", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("unaligned_reads", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("total_read_bytes", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA_TS("last_access_time", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(ObPreciseDateTime), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
false); //is_on_update_for_timestamp
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA_TS("last_modify_time", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(ObPreciseDateTime), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
false); //is_on_update_for_timestamp
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA_TS("birth_time", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(ObPreciseDateTime), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
false); //is_on_update_for_timestamp
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
table_schema.get_part_option().set_part_num(1);
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ONE);
|
||||
table_schema.get_part_option().set_part_func_type(PARTITION_FUNC_TYPE_LIST_COLUMNS);
|
||||
if (OB_FAIL(table_schema.get_part_option().set_part_expr("svr_ip, svr_port"))) {
|
||||
LOG_WARN("set_part_expr failed", K(ret));
|
||||
} else if (OB_FAIL(table_schema.mock_list_partition_array())) {
|
||||
LOG_WARN("mock list partition array failed", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
table_schema.set_progressive_merge_round(1);
|
||||
table_schema.set_storage_format_version(3);
|
||||
table_schema.set_tablet_id(0);
|
||||
|
||||
table_schema.set_max_used_column_id(column_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace share
|
||||
} // end namespace oceanbase
|
@ -1220,6 +1220,375 @@ int ObInnerTableSchema::all_virtual_spatial_reference_systems_real_agent_ora_sch
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObInnerTableSchema::all_virtual_temp_file_ora_schema(ObTableSchema &table_schema)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
||||
|
||||
//generated fields:
|
||||
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
||||
table_schema.set_tablegroup_id(OB_INVALID_ID);
|
||||
table_schema.set_database_id(OB_ORA_SYS_DATABASE_ID);
|
||||
table_schema.set_table_id(OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID);
|
||||
table_schema.set_rowkey_split_pos(0);
|
||||
table_schema.set_is_use_bloomfilter(false);
|
||||
table_schema.set_progressive_merge_num(0);
|
||||
table_schema.set_rowkey_column_num(0);
|
||||
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
||||
table_schema.set_table_type(VIRTUAL_TABLE);
|
||||
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
||||
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TEMP_FILE_ORA_TNAME))) {
|
||||
LOG_ERROR("fail to set table_name", K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
||||
LOG_ERROR("fail to set compress_func_name", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
||||
table_schema.set_charset_type(ObCharset::get_default_charset());
|
||||
table_schema.set_collation_type(ObCollationType::CS_TYPE_UTF8MB4_BIN);
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("TENANT_ID", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("SVR_IP", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
1, //part_key_pos
|
||||
ObVarcharType, //column_type
|
||||
CS_TYPE_UTF8MB4_BIN, //column_collation_type
|
||||
MAX_IP_ADDR_LENGTH, //column_length
|
||||
2, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("SVR_PORT", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
2, //part_key_pos
|
||||
ObNumberType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
38, //column_length
|
||||
38, //column_precision
|
||||
0, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("FILE_ID", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("TRACE_ID", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObVarcharType, //column_type
|
||||
CS_TYPE_UTF8MB4_BIN, //column_collation_type
|
||||
OB_MAX_TRACE_ID_BUFFER_SIZE, //column_length
|
||||
2, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("DIR_ID", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("BYTES", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("START_OFFSET", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("IS_DELETING", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("CACHED_PAGE_NUM", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("WRITE_BACK_PAGE_NUM", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("FLUSHED_PAGE_NUM", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("REF_CNT", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("TOTAL_WRITES", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("UNALIGNED_WRITES", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("TOTAL_READS", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("UNALIGNED_READS", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("TOTAL_READ_BYTES", //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
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("LAST_ACCESS_TIME", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampLTZType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
0, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("LAST_MODIFY_TIME", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampLTZType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
0, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("BIRTH_TIME", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObTimestampLTZType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
0, //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //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);
|
||||
table_schema.get_part_option().set_part_func_type(PARTITION_FUNC_TYPE_LIST);
|
||||
if (OB_FAIL(table_schema.get_part_option().set_part_expr("SVR_IP, SVR_PORT"))) {
|
||||
LOG_WARN("set_part_expr failed", K(ret));
|
||||
} else if (OB_FAIL(table_schema.mock_list_partition_array())) {
|
||||
LOG_WARN("mock list partition array failed", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
table_schema.set_progressive_merge_round(1);
|
||||
table_schema.set_storage_format_version(3);
|
||||
table_schema.set_tablet_id(0);
|
||||
|
||||
table_schema.set_max_used_column_id(column_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace share
|
||||
} // end namespace oceanbase
|
||||
|
@ -175,6 +175,106 @@ int ObInnerTableSchema::innodb_sys_foreign_cols_schema(ObTableSchema &table_sche
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObInnerTableSchema::dba_ob_temp_files_schema(ObTableSchema &table_schema)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
||||
|
||||
//generated fields:
|
||||
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
||||
table_schema.set_tablegroup_id(OB_INVALID_ID);
|
||||
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
||||
table_schema.set_table_id(OB_DBA_OB_TEMP_FILES_TID);
|
||||
table_schema.set_rowkey_split_pos(0);
|
||||
table_schema.set_is_use_bloomfilter(false);
|
||||
table_schema.set_progressive_merge_num(0);
|
||||
table_schema.set_rowkey_column_num(0);
|
||||
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
||||
table_schema.set_table_type(SYSTEM_VIEW);
|
||||
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
||||
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_table_name(OB_DBA_OB_TEMP_FILES_TNAME))) {
|
||||
LOG_ERROR("fail to set table_name", K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
||||
LOG_ERROR("fail to set compress_func_name", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
||||
table_schema.set_charset_type(ObCharset::get_default_charset());
|
||||
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_view_definition(R"__(SELECT SVR_IP, SVR_PORT, FILE_ID, TRACE_ID, DIR_ID, BYTES, START_OFFSET, TOTAL_WRITES, UNALIGNED_WRITES, TOTAL_READS, UNALIGNED_READS, TOTAL_READ_BYTES, LAST_ACCESS_TIME, LAST_MODIFY_TIME, BIRTH_TIME FROM oceanbase.__all_virtual_temp_file WHERE TENANT_ID = EFFECTIVE_TENANT_ID() )__"))) {
|
||||
LOG_ERROR("fail to set view_definition", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
table_schema.set_progressive_merge_round(1);
|
||||
table_schema.set_storage_format_version(3);
|
||||
table_schema.set_tablet_id(0);
|
||||
|
||||
table_schema.set_max_used_column_id(column_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObInnerTableSchema::cdb_ob_temp_files_schema(ObTableSchema &table_schema)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1;
|
||||
|
||||
//generated fields:
|
||||
table_schema.set_tenant_id(OB_SYS_TENANT_ID);
|
||||
table_schema.set_tablegroup_id(OB_INVALID_ID);
|
||||
table_schema.set_database_id(OB_SYS_DATABASE_ID);
|
||||
table_schema.set_table_id(OB_CDB_OB_TEMP_FILES_TID);
|
||||
table_schema.set_rowkey_split_pos(0);
|
||||
table_schema.set_is_use_bloomfilter(false);
|
||||
table_schema.set_progressive_merge_num(0);
|
||||
table_schema.set_rowkey_column_num(0);
|
||||
table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK);
|
||||
table_schema.set_table_type(SYSTEM_VIEW);
|
||||
table_schema.set_index_type(INDEX_TYPE_IS_NOT);
|
||||
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_table_name(OB_CDB_OB_TEMP_FILES_TNAME))) {
|
||||
LOG_ERROR("fail to set table_name", K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) {
|
||||
LOG_ERROR("fail to set compress_func_name", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_part_level(PARTITION_LEVEL_ZERO);
|
||||
table_schema.set_charset_type(ObCharset::get_default_charset());
|
||||
table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(table_schema.set_view_definition(R"__(SELECT TENANT_ID, SVR_IP, SVR_PORT, FILE_ID, TRACE_ID, DIR_ID, BYTES, START_OFFSET, TOTAL_WRITES, UNALIGNED_WRITES, TOTAL_READS, UNALIGNED_READS, TOTAL_READ_BYTES, LAST_ACCESS_TIME, LAST_MODIFY_TIME, BIRTH_TIME FROM oceanbase.__all_virtual_temp_file )__"))) {
|
||||
LOG_ERROR("fail to set view_definition", K(ret));
|
||||
}
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
table_schema.set_progressive_merge_round(1);
|
||||
table_schema.set_storage_format_version(3);
|
||||
table_schema.set_tablet_id(0);
|
||||
|
||||
table_schema.set_max_used_column_id(column_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace share
|
||||
} // end namespace oceanbase
|
||||
|
File diff suppressed because it is too large
Load Diff
19830
src/share/inner_table/ob_inner_table_schema.28251_28300.cpp
Normal file
19830
src/share/inner_table/ob_inner_table_schema.28251_28300.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -1090,6 +1090,7 @@ public:
|
||||
static int all_virtual_nic_info_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_scheduler_job_run_detail_v2_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_spatial_reference_systems_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_temp_file_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_plan_stat_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_plan_cache_plan_explain_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
@ -1366,6 +1367,7 @@ public:
|
||||
static int all_virtual_nic_info_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_scheduler_job_run_detail_v2_real_agent_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_spatial_reference_systems_real_agent_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_virtual_temp_file_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int gv_ob_plan_cache_stat_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int gv_ob_plan_cache_plan_stat_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int schemata_schema(share::schema::ObTableSchema &table_schema);
|
||||
@ -1826,6 +1828,8 @@ public:
|
||||
static int innodb_sys_fields_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int innodb_sys_foreign_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int innodb_sys_foreign_cols_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int dba_ob_temp_files_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int cdb_ob_temp_files_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int dba_synonyms_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int dba_objects_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_objects_schema(share::schema::ObTableSchema &table_schema);
|
||||
@ -2293,6 +2297,7 @@ public:
|
||||
static int gv_ob_nic_info_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int v_ob_nic_info_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int dba_ob_spatial_columns_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int dba_ob_temp_files_ora_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_table_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_column_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
|
||||
static int all_ddl_operation_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
|
||||
@ -3883,6 +3888,7 @@ const schema_create_func virtual_table_schema_creators [] = {
|
||||
ObInnerTableSchema::all_virtual_nic_info_schema,
|
||||
ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_schema,
|
||||
ObInnerTableSchema::all_virtual_spatial_reference_systems_schema,
|
||||
ObInnerTableSchema::all_virtual_temp_file_schema,
|
||||
ObInnerTableSchema::all_virtual_ash_all_virtual_ash_i1_schema,
|
||||
ObInnerTableSchema::all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema,
|
||||
ObInnerTableSchema::all_virtual_sql_audit_all_virtual_sql_audit_i1_schema,
|
||||
@ -4169,6 +4175,7 @@ const schema_create_func virtual_table_schema_creators [] = {
|
||||
ObInnerTableSchema::all_virtual_nic_info_ora_schema,
|
||||
ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_schema,
|
||||
ObInnerTableSchema::all_virtual_spatial_reference_systems_real_agent_ora_schema,
|
||||
ObInnerTableSchema::all_virtual_temp_file_ora_schema,
|
||||
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_data_table_id_real_agent_schema,
|
||||
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_db_tb_name_real_agent_schema,
|
||||
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_tb_name_real_agent_schema,
|
||||
@ -4716,6 +4723,8 @@ const schema_create_func sys_view_schema_creators [] = {
|
||||
ObInnerTableSchema::innodb_sys_fields_schema,
|
||||
ObInnerTableSchema::innodb_sys_foreign_schema,
|
||||
ObInnerTableSchema::innodb_sys_foreign_cols_schema,
|
||||
ObInnerTableSchema::dba_ob_temp_files_schema,
|
||||
ObInnerTableSchema::cdb_ob_temp_files_schema,
|
||||
ObInnerTableSchema::dba_synonyms_schema,
|
||||
ObInnerTableSchema::dba_objects_ora_schema,
|
||||
ObInnerTableSchema::all_objects_schema,
|
||||
@ -5183,6 +5192,7 @@ const schema_create_func sys_view_schema_creators [] = {
|
||||
ObInnerTableSchema::gv_ob_nic_info_ora_schema,
|
||||
ObInnerTableSchema::v_ob_nic_info_ora_schema,
|
||||
ObInnerTableSchema::dba_ob_spatial_columns_ora_schema,
|
||||
ObInnerTableSchema::dba_ob_temp_files_ora_schema,
|
||||
NULL,};
|
||||
|
||||
const schema_create_func core_index_table_schema_creators [] = {
|
||||
@ -5823,6 +5833,7 @@ const uint64_t tenant_space_tables [] = {
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID,
|
||||
OB_ALL_VIRTUAL_NIC_INFO_TID,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_TID,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TID,
|
||||
OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID,
|
||||
@ -6108,6 +6119,7 @@ const uint64_t tenant_space_tables [] = {
|
||||
OB_ALL_VIRTUAL_NIC_INFO_ORA_TID,
|
||||
OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID,
|
||||
OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TID,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID,
|
||||
OB_GV_OB_PLAN_CACHE_STAT_TID,
|
||||
OB_GV_OB_PLAN_CACHE_PLAN_STAT_TID,
|
||||
OB_SCHEMATA_TID,
|
||||
@ -6446,6 +6458,7 @@ const uint64_t tenant_space_tables [] = {
|
||||
OB_INNODB_SYS_FIELDS_TID,
|
||||
OB_INNODB_SYS_FOREIGN_TID,
|
||||
OB_INNODB_SYS_FOREIGN_COLS_TID,
|
||||
OB_DBA_OB_TEMP_FILES_TID,
|
||||
OB_DBA_SYNONYMS_TID,
|
||||
OB_DBA_OBJECTS_ORA_TID,
|
||||
OB_ALL_OBJECTS_TID,
|
||||
@ -6913,6 +6926,7 @@ const uint64_t tenant_space_tables [] = {
|
||||
OB_GV_OB_NIC_INFO_ORA_TID,
|
||||
OB_V_OB_NIC_INFO_ORA_TID,
|
||||
OB_DBA_OB_SPATIAL_COLUMNS_ORA_TID,
|
||||
OB_DBA_OB_TEMP_FILES_ORA_TID,
|
||||
OB_ALL_TABLE_IDX_DATA_TABLE_ID_TID,
|
||||
OB_ALL_TABLE_IDX_DB_TB_NAME_TID,
|
||||
OB_ALL_TABLE_IDX_TB_NAME_TID,
|
||||
@ -7799,7 +7813,8 @@ const uint64_t all_ora_mapping_virtual_table_org_tables [] = {
|
||||
OB_ALL_VIRTUAL_SERVICE_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID,
|
||||
OB_ALL_VIRTUAL_NIC_INFO_TID, };
|
||||
OB_ALL_VIRTUAL_NIC_INFO_TID,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_TID, };
|
||||
|
||||
const uint64_t all_ora_mapping_virtual_tables [] = { OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID
|
||||
, OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID
|
||||
@ -7949,6 +7964,7 @@ const uint64_t all_ora_mapping_virtual_tables [] = { OB_ALL_VIRTUAL_SQL_AUDIT_O
|
||||
, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_ORA_TID
|
||||
, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID
|
||||
, OB_ALL_VIRTUAL_NIC_INFO_ORA_TID
|
||||
, OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID
|
||||
, };
|
||||
|
||||
/* start/end_pos is start/end postition for column with tenant id */
|
||||
@ -8478,6 +8494,7 @@ const char* const tenant_space_table_names [] = {
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TNAME,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TNAME,
|
||||
OB_ALL_VIRTUAL_NIC_INFO_TNAME,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_TNAME,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TNAME,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TNAME,
|
||||
OB_ALL_VIRTUAL_PLAN_STAT_ORA_TNAME,
|
||||
@ -8763,6 +8780,7 @@ const char* const tenant_space_table_names [] = {
|
||||
OB_ALL_VIRTUAL_NIC_INFO_ORA_TNAME,
|
||||
OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TNAME,
|
||||
OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TNAME,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_ORA_TNAME,
|
||||
OB_GV_OB_PLAN_CACHE_STAT_TNAME,
|
||||
OB_GV_OB_PLAN_CACHE_PLAN_STAT_TNAME,
|
||||
OB_SCHEMATA_TNAME,
|
||||
@ -9101,6 +9119,7 @@ const char* const tenant_space_table_names [] = {
|
||||
OB_INNODB_SYS_FIELDS_TNAME,
|
||||
OB_INNODB_SYS_FOREIGN_TNAME,
|
||||
OB_INNODB_SYS_FOREIGN_COLS_TNAME,
|
||||
OB_DBA_OB_TEMP_FILES_TNAME,
|
||||
OB_DBA_SYNONYMS_TNAME,
|
||||
OB_DBA_OBJECTS_ORA_TNAME,
|
||||
OB_ALL_OBJECTS_TNAME,
|
||||
@ -9568,6 +9587,7 @@ const char* const tenant_space_table_names [] = {
|
||||
OB_GV_OB_NIC_INFO_ORA_TNAME,
|
||||
OB_V_OB_NIC_INFO_ORA_TNAME,
|
||||
OB_DBA_OB_SPATIAL_COLUMNS_ORA_TNAME,
|
||||
OB_DBA_OB_TEMP_FILES_ORA_TNAME,
|
||||
OB_ALL_TABLE_IDX_DATA_TABLE_ID_TNAME,
|
||||
OB_ALL_TABLE_IDX_DB_TB_NAME_TNAME,
|
||||
OB_ALL_TABLE_IDX_TB_NAME_TNAME,
|
||||
@ -10463,6 +10483,7 @@ const uint64_t tenant_distributed_vtables [] = {
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID,
|
||||
OB_ALL_VIRTUAL_NIC_INFO_TID,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_TID,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID,
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TID,
|
||||
OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID,
|
||||
@ -10537,7 +10558,8 @@ const uint64_t tenant_distributed_vtables [] = {
|
||||
OB_ALL_VIRTUAL_TRACEPOINT_INFO_ORA_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_ORA_TID,
|
||||
OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID,
|
||||
OB_ALL_VIRTUAL_NIC_INFO_ORA_TID, };
|
||||
OB_ALL_VIRTUAL_NIC_INFO_ORA_TID,
|
||||
OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID, };
|
||||
|
||||
const uint64_t restrict_access_virtual_tables[] = {
|
||||
OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID,
|
||||
@ -13280,11 +13302,11 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid,
|
||||
|
||||
const int64_t OB_CORE_TABLE_COUNT = 4;
|
||||
const int64_t OB_SYS_TABLE_COUNT = 300;
|
||||
const int64_t OB_VIRTUAL_TABLE_COUNT = 829;
|
||||
const int64_t OB_SYS_VIEW_COUNT = 927;
|
||||
const int64_t OB_SYS_TENANT_TABLE_COUNT = 2061;
|
||||
const int64_t OB_VIRTUAL_TABLE_COUNT = 831;
|
||||
const int64_t OB_SYS_VIEW_COUNT = 930;
|
||||
const int64_t OB_SYS_TENANT_TABLE_COUNT = 2066;
|
||||
const int64_t OB_CORE_SCHEMA_VERSION = 1;
|
||||
const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2064;
|
||||
const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2069;
|
||||
|
||||
} // end namespace share
|
||||
} // end namespace oceanbase
|
||||
|
@ -790,6 +790,7 @@ const uint64_t OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID = 12482; // "__al
|
||||
const uint64_t OB_ALL_VIRTUAL_NIC_INFO_TID = 12487; // "__all_virtual_nic_info"
|
||||
const uint64_t OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_TID = 12488; // "__all_virtual_scheduler_job_run_detail_v2"
|
||||
const uint64_t OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_TID = 12490; // "__all_virtual_spatial_reference_systems"
|
||||
const uint64_t OB_ALL_VIRTUAL_TEMP_FILE_TID = 12505; // "__all_virtual_temp_file"
|
||||
const uint64_t OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID = 15009; // "ALL_VIRTUAL_SQL_AUDIT_ORA"
|
||||
const uint64_t OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID = 15010; // "ALL_VIRTUAL_PLAN_STAT_ORA"
|
||||
const uint64_t OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TID = 15012; // "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA"
|
||||
@ -1066,6 +1067,7 @@ const uint64_t OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID = 15451; // "
|
||||
const uint64_t OB_ALL_VIRTUAL_NIC_INFO_ORA_TID = 15456; // "ALL_VIRTUAL_NIC_INFO_ORA"
|
||||
const uint64_t OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID = 15458; // "ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA"
|
||||
const uint64_t OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TID = 15459; // "ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA"
|
||||
const uint64_t OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID = 15485; // "ALL_VIRTUAL_TEMP_FILE_ORA"
|
||||
const uint64_t OB_GV_OB_PLAN_CACHE_STAT_TID = 20001; // "GV$OB_PLAN_CACHE_STAT"
|
||||
const uint64_t OB_GV_OB_PLAN_CACHE_PLAN_STAT_TID = 20002; // "GV$OB_PLAN_CACHE_PLAN_STAT"
|
||||
const uint64_t OB_SCHEMATA_TID = 20003; // "SCHEMATA"
|
||||
@ -1526,6 +1528,8 @@ const uint64_t OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TID = 21590; // "CDB_SCHEDULER_J
|
||||
const uint64_t OB_INNODB_SYS_FIELDS_TID = 21603; // "INNODB_SYS_FIELDS"
|
||||
const uint64_t OB_INNODB_SYS_FOREIGN_TID = 21604; // "INNODB_SYS_FOREIGN"
|
||||
const uint64_t OB_INNODB_SYS_FOREIGN_COLS_TID = 21605; // "INNODB_SYS_FOREIGN_COLS"
|
||||
const uint64_t OB_DBA_OB_TEMP_FILES_TID = 21622; // "DBA_OB_TEMP_FILES"
|
||||
const uint64_t OB_CDB_OB_TEMP_FILES_TID = 21623; // "CDB_OB_TEMP_FILES"
|
||||
const uint64_t OB_DBA_SYNONYMS_TID = 25001; // "DBA_SYNONYMS"
|
||||
const uint64_t OB_DBA_OBJECTS_ORA_TID = 25002; // "DBA_OBJECTS_ORA"
|
||||
const uint64_t OB_ALL_OBJECTS_TID = 25003; // "ALL_OBJECTS"
|
||||
@ -1993,6 +1997,7 @@ const uint64_t OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID = 28227; // "V$OB_TE
|
||||
const uint64_t OB_GV_OB_NIC_INFO_ORA_TID = 28230; // "GV$OB_NIC_INFO_ORA"
|
||||
const uint64_t OB_V_OB_NIC_INFO_ORA_TID = 28231; // "V$OB_NIC_INFO_ORA"
|
||||
const uint64_t OB_DBA_OB_SPATIAL_COLUMNS_ORA_TID = 28234; // "DBA_OB_SPATIAL_COLUMNS_ORA"
|
||||
const uint64_t OB_DBA_OB_TEMP_FILES_ORA_TID = 28264; // "DBA_OB_TEMP_FILES_ORA"
|
||||
const uint64_t OB_ALL_TABLE_AUX_LOB_META_TID = 50003; // "__all_table_aux_lob_meta"
|
||||
const uint64_t OB_ALL_COLUMN_AUX_LOB_META_TID = 50004; // "__all_column_aux_lob_meta"
|
||||
const uint64_t OB_ALL_DDL_OPERATION_AUX_LOB_META_TID = 50005; // "__all_ddl_operation_aux_lob_meta"
|
||||
@ -3567,6 +3572,7 @@ const char *const OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TNAME = "__all_vir
|
||||
const char *const OB_ALL_VIRTUAL_NIC_INFO_TNAME = "__all_virtual_nic_info";
|
||||
const char *const OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_TNAME = "__all_virtual_scheduler_job_run_detail_v2";
|
||||
const char *const OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_TNAME = "__all_virtual_spatial_reference_systems";
|
||||
const char *const OB_ALL_VIRTUAL_TEMP_FILE_TNAME = "__all_virtual_temp_file";
|
||||
const char *const OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TNAME = "ALL_VIRTUAL_SQL_AUDIT";
|
||||
const char *const OB_ALL_VIRTUAL_PLAN_STAT_ORA_TNAME = "ALL_VIRTUAL_PLAN_STAT";
|
||||
const char *const OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TNAME = "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN";
|
||||
@ -3843,6 +3849,7 @@ const char *const OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TNAME = "ALL_V
|
||||
const char *const OB_ALL_VIRTUAL_NIC_INFO_ORA_TNAME = "ALL_VIRTUAL_NIC_INFO";
|
||||
const char *const OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TNAME = "ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT";
|
||||
const char *const OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TNAME = "ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT";
|
||||
const char *const OB_ALL_VIRTUAL_TEMP_FILE_ORA_TNAME = "ALL_VIRTUAL_TEMP_FILE";
|
||||
const char *const OB_GV_OB_PLAN_CACHE_STAT_TNAME = "GV$OB_PLAN_CACHE_STAT";
|
||||
const char *const OB_GV_OB_PLAN_CACHE_PLAN_STAT_TNAME = "GV$OB_PLAN_CACHE_PLAN_STAT";
|
||||
const char *const OB_SCHEMATA_TNAME = "SCHEMATA";
|
||||
@ -4303,6 +4310,8 @@ const char *const OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TNAME = "CDB_SCHEDULER_JOB_RU
|
||||
const char *const OB_INNODB_SYS_FIELDS_TNAME = "INNODB_SYS_FIELDS";
|
||||
const char *const OB_INNODB_SYS_FOREIGN_TNAME = "INNODB_SYS_FOREIGN";
|
||||
const char *const OB_INNODB_SYS_FOREIGN_COLS_TNAME = "INNODB_SYS_FOREIGN_COLS";
|
||||
const char *const OB_DBA_OB_TEMP_FILES_TNAME = "DBA_OB_TEMP_FILES";
|
||||
const char *const OB_CDB_OB_TEMP_FILES_TNAME = "CDB_OB_TEMP_FILES";
|
||||
const char *const OB_DBA_SYNONYMS_TNAME = "DBA_SYNONYMS";
|
||||
const char *const OB_DBA_OBJECTS_ORA_TNAME = "DBA_OBJECTS";
|
||||
const char *const OB_ALL_OBJECTS_TNAME = "ALL_OBJECTS";
|
||||
@ -4770,6 +4779,7 @@ const char *const OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TNAME = "V$OB_TENANT_
|
||||
const char *const OB_GV_OB_NIC_INFO_ORA_TNAME = "GV$OB_NIC_INFO";
|
||||
const char *const OB_V_OB_NIC_INFO_ORA_TNAME = "V$OB_NIC_INFO";
|
||||
const char *const OB_DBA_OB_SPATIAL_COLUMNS_ORA_TNAME = "DBA_OB_SPATIAL_COLUMNS";
|
||||
const char *const OB_DBA_OB_TEMP_FILES_ORA_TNAME = "DBA_OB_TEMP_FILES";
|
||||
const char *const OB_ALL_TABLE_AUX_LOB_META_TNAME = "__all_table_aux_lob_meta";
|
||||
const char *const OB_ALL_COLUMN_AUX_LOB_META_TNAME = "__all_column_aux_lob_meta";
|
||||
const char *const OB_ALL_DDL_OPERATION_AUX_LOB_META_TNAME = "__all_ddl_operation_aux_lob_meta";
|
||||
|
@ -14730,7 +14730,43 @@ def_table_schema(**gen_iterate_virtual_table_def(
|
||||
# 12502: __all_virtual_wr_res_mgr_sysstat
|
||||
# 12503: __all_virtual_kv_redis_table
|
||||
# 12504: __all_virtual_function_io_stat
|
||||
# 12505: __all_virtual_temp_file
|
||||
|
||||
def_table_schema(
|
||||
owner = 'wuyuefei.wyf',
|
||||
table_name = '__all_virtual_temp_file',
|
||||
table_id = '12505',
|
||||
table_type = 'VIRTUAL_TABLE',
|
||||
gm_columns = [],
|
||||
rowkey_columns = [],
|
||||
in_tenant_space = True,
|
||||
|
||||
normal_columns = [
|
||||
('tenant_id', 'int'),
|
||||
('svr_ip', 'varchar:MAX_IP_ADDR_LENGTH'),
|
||||
('svr_port', 'int'),
|
||||
('file_id', 'int'),
|
||||
('trace_id', 'varchar:OB_MAX_TRACE_ID_BUFFER_SIZE', 'false'),
|
||||
('dir_id', 'int'),
|
||||
('bytes', 'int'),
|
||||
('start_offset', 'int'),
|
||||
('is_deleting', 'bool'),
|
||||
('cached_page_num', 'int'),
|
||||
('write_back_page_num', 'int'),
|
||||
('flushed_page_num', 'int'),
|
||||
('ref_cnt', 'int'),
|
||||
('total_writes', 'int'),
|
||||
('unaligned_writes', 'int'),
|
||||
('total_reads', 'int'),
|
||||
('unaligned_reads', 'int'),
|
||||
('total_read_bytes', 'int'),
|
||||
('last_access_time', 'timestamp'),
|
||||
('last_modify_time', 'timestamp'),
|
||||
('birth_time', 'timestamp'),
|
||||
],
|
||||
partition_columns = ['svr_ip', 'svr_port'],
|
||||
vtable_route_policy = 'distributed',
|
||||
)
|
||||
|
||||
# 余留位置(此行之前占位)
|
||||
# 本区域占位建议:采用真实表名进行占位
|
||||
################################################################################
|
||||
@ -15238,7 +15274,9 @@ def_table_schema(**no_direct_access(gen_oracle_mapping_real_virtual_table_def('1
|
||||
# 15482: __all_virtual_res_mgr_sysstat
|
||||
# 15483: __all_virtual_wr_res_mgr_sysstat
|
||||
# 15484: __all_virtual_function_io_stat
|
||||
# 15485: __all_virtual_temp_file
|
||||
|
||||
def_table_schema(**gen_oracle_mapping_virtual_table_def('15485', all_def_keywords['__all_virtual_temp_file']))
|
||||
|
||||
# 余留位置(此行之前占位)
|
||||
# 本区域定义的Oracle表名比较复杂,一般都采用gen_xxx_table_def()方式定义,占位建议采用基表表名占位
|
||||
# - 示例:def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15009', all_def_keywords['__all_virtual_sql_audit'])))
|
||||
@ -36427,8 +36465,66 @@ def_table_schema(
|
||||
# 21619: CDB_OB_KV_REDIS_TABLE
|
||||
# 21620: GV$OB_FUNCTION_IO_STAT
|
||||
# 21621: V$OB_FUNCTION_IO_STAT
|
||||
# 21622: DBA_OB_TEMP_FILES
|
||||
# 21623: CDB_OB_TEMP_FILES
|
||||
|
||||
def_table_schema(
|
||||
owner = 'wuyuefei.wyf',
|
||||
table_name = 'DBA_OB_TEMP_FILES',
|
||||
table_id = '21622',
|
||||
table_type = 'SYSTEM_VIEW',
|
||||
rowkey_columns = [],
|
||||
normal_columns = [],
|
||||
gm_columns = [],
|
||||
in_tenant_space = True,
|
||||
view_definition = """SELECT
|
||||
SVR_IP,
|
||||
SVR_PORT,
|
||||
FILE_ID,
|
||||
TRACE_ID,
|
||||
DIR_ID,
|
||||
BYTES,
|
||||
START_OFFSET,
|
||||
TOTAL_WRITES,
|
||||
UNALIGNED_WRITES,
|
||||
TOTAL_READS,
|
||||
UNALIGNED_READS,
|
||||
TOTAL_READ_BYTES,
|
||||
LAST_ACCESS_TIME,
|
||||
LAST_MODIFY_TIME,
|
||||
BIRTH_TIME
|
||||
FROM oceanbase.__all_virtual_temp_file
|
||||
WHERE TENANT_ID = EFFECTIVE_TENANT_ID()
|
||||
""".replace("\n", " "),
|
||||
)
|
||||
|
||||
def_table_schema(
|
||||
owner = 'wuyuefei.wyf',
|
||||
table_name = 'CDB_OB_TEMP_FILES',
|
||||
table_id = '21623',
|
||||
table_type = 'SYSTEM_VIEW',
|
||||
rowkey_columns = [],
|
||||
normal_columns = [],
|
||||
gm_columns = [],
|
||||
view_definition = """SELECT
|
||||
TENANT_ID,
|
||||
SVR_IP,
|
||||
SVR_PORT,
|
||||
FILE_ID,
|
||||
TRACE_ID,
|
||||
DIR_ID,
|
||||
BYTES,
|
||||
START_OFFSET,
|
||||
TOTAL_WRITES,
|
||||
UNALIGNED_WRITES,
|
||||
TOTAL_READS,
|
||||
UNALIGNED_READS,
|
||||
TOTAL_READ_BYTES,
|
||||
LAST_ACCESS_TIME,
|
||||
LAST_MODIFY_TIME,
|
||||
BIRTH_TIME
|
||||
FROM oceanbase.__all_virtual_temp_file
|
||||
""".replace("\n", " ")
|
||||
)
|
||||
|
||||
# 余留位置(此行之前占位)
|
||||
# 本区域占位建议:采用真实视图名进行占位
|
||||
################################################################################
|
||||
@ -64566,7 +64662,39 @@ left join
|
||||
# 28261: DBA_OB_SPM_EVO_RESULT
|
||||
# 28262: GV$OB_FUNCTION_IO_STAT
|
||||
# 28263: V$OB_FUNCTION_IO_STAT
|
||||
# 28264: DBA_OB_TEMP_FILES
|
||||
|
||||
def_table_schema(
|
||||
owner = 'wuyuefei.wyf',
|
||||
table_name = 'DBA_OB_TEMP_FILES',
|
||||
name_postfix = '_ORA',
|
||||
database_id = 'OB_ORA_SYS_DATABASE_ID',
|
||||
table_id = '28264',
|
||||
table_type = 'SYSTEM_VIEW',
|
||||
rowkey_columns = [],
|
||||
normal_columns = [],
|
||||
gm_columns = [],
|
||||
in_tenant_space = True,
|
||||
view_definition = """SELECT
|
||||
SVR_IP,
|
||||
SVR_PORT,
|
||||
FILE_ID,
|
||||
TRACE_ID,
|
||||
DIR_ID,
|
||||
BYTES,
|
||||
START_OFFSET,
|
||||
TOTAL_WRITES,
|
||||
UNALIGNED_WRITES,
|
||||
TOTAL_READS,
|
||||
UNALIGNED_READS,
|
||||
TOTAL_READ_BYTES,
|
||||
LAST_ACCESS_TIME,
|
||||
LAST_MODIFY_TIME,
|
||||
BIRTH_TIME
|
||||
FROM SYS.ALL_VIRTUAL_TEMP_FILE
|
||||
WHERE TENANT_ID = EFFECTIVE_TENANT_ID()
|
||||
""".replace("\n", " "),
|
||||
)
|
||||
|
||||
# 余留位置(此行之前占位)
|
||||
# 本区域占位建议:采用真实视图名进行占位
|
||||
################################################################################
|
||||
|
@ -1137,6 +1137,7 @@
|
||||
# 12488: __all_scheduler_job_run_detail_v2 # BASE_TABLE_NAME
|
||||
# 12490: __all_virtual_spatial_reference_systems
|
||||
# 12490: __all_spatial_reference_systems # BASE_TABLE_NAME
|
||||
# 12505: __all_virtual_temp_file
|
||||
# 15009: ALL_VIRTUAL_SQL_AUDIT
|
||||
# 15009: __all_virtual_sql_audit # BASE_TABLE_NAME
|
||||
# 15010: ALL_VIRTUAL_PLAN_STAT
|
||||
@ -1748,6 +1749,8 @@
|
||||
# 15458: __all_scheduler_job_run_detail_v2 # BASE_TABLE_NAME
|
||||
# 15459: ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT
|
||||
# 15459: __all_spatial_reference_systems # BASE_TABLE_NAME
|
||||
# 15485: ALL_VIRTUAL_TEMP_FILE
|
||||
# 15485: __all_virtual_temp_file # BASE_TABLE_NAME
|
||||
# 20001: GV$OB_PLAN_CACHE_STAT
|
||||
# 20002: GV$OB_PLAN_CACHE_PLAN_STAT
|
||||
# 20003: SCHEMATA
|
||||
@ -2208,6 +2211,8 @@
|
||||
# 21603: INNODB_SYS_FIELDS
|
||||
# 21604: INNODB_SYS_FOREIGN
|
||||
# 21605: INNODB_SYS_FOREIGN_COLS
|
||||
# 21622: DBA_OB_TEMP_FILES
|
||||
# 21623: CDB_OB_TEMP_FILES
|
||||
# 25001: DBA_SYNONYMS
|
||||
# 25002: DBA_OBJECTS
|
||||
# 25003: ALL_OBJECTS
|
||||
@ -2675,6 +2680,7 @@
|
||||
# 28230: GV$OB_NIC_INFO
|
||||
# 28231: V$OB_NIC_INFO
|
||||
# 28234: DBA_OB_SPATIAL_COLUMNS
|
||||
# 28264: DBA_OB_TEMP_FILES
|
||||
# 14999: __idx_11003_all_virtual_plan_cache_stat_i1
|
||||
# 14999: all_virtual_plan_cache_stat_i1 # INDEX_NAME
|
||||
# 14999: __all_virtual_plan_cache_stat # DATA_BASE_TABLE_NAME
|
||||
|
@ -28,6 +28,74 @@ namespace oceanbase
|
||||
{
|
||||
namespace tmp_file
|
||||
{
|
||||
|
||||
int ObSNTmpFileInfo::init(
|
||||
const ObCurTraceId::TraceId &trace_id,
|
||||
const uint64_t tenant_id,
|
||||
const int64_t dir_id,
|
||||
const int64_t fd,
|
||||
const int64_t file_size,
|
||||
const int64_t truncated_offset,
|
||||
const bool is_deleting,
|
||||
const int64_t cached_page_num,
|
||||
const int64_t write_back_data_page_num,
|
||||
const int64_t flushed_data_page_num,
|
||||
const int64_t ref_cnt,
|
||||
const int64_t write_req_cnt,
|
||||
const int64_t unaligned_write_req_cnt,
|
||||
const int64_t read_req_cnt,
|
||||
const int64_t unaligned_read_req_cnt,
|
||||
const int64_t total_read_size,
|
||||
const int64_t last_access_ts,
|
||||
const int64_t last_modify_ts,
|
||||
const int64_t birth_ts)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
trace_id_ = trace_id;
|
||||
tenant_id_ = tenant_id;
|
||||
dir_id_ = dir_id;
|
||||
fd_ = fd;
|
||||
file_size_ = file_size;
|
||||
truncated_offset_ = truncated_offset;
|
||||
is_deleting_ = is_deleting;
|
||||
cached_page_num_ = cached_page_num;
|
||||
write_back_data_page_num_ = write_back_data_page_num;
|
||||
flushed_data_page_num_ = flushed_data_page_num;
|
||||
ref_cnt_ = ref_cnt;
|
||||
write_req_cnt_ = write_req_cnt;
|
||||
unaligned_write_req_cnt_ = unaligned_write_req_cnt;
|
||||
read_req_cnt_ = read_req_cnt;
|
||||
unaligned_read_req_cnt_ = unaligned_read_req_cnt;
|
||||
total_read_size_ = total_read_size;
|
||||
last_access_ts_ = last_access_ts;
|
||||
last_modify_ts_ = last_modify_ts;
|
||||
birth_ts_ = birth_ts;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ObSNTmpFileInfo::reset()
|
||||
{
|
||||
trace_id_.reset();
|
||||
tenant_id_ = OB_INVALID_TENANT_ID;
|
||||
dir_id_ = ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID;
|
||||
fd_ = ObTmpFileGlobal::INVALID_TMP_FILE_FD;
|
||||
file_size_ = 0;
|
||||
truncated_offset_ = 0;
|
||||
is_deleting_ = false;
|
||||
cached_page_num_ = 0;
|
||||
write_back_data_page_num_ = 0;
|
||||
flushed_data_page_num_ = 0;
|
||||
ref_cnt_ = 0;
|
||||
write_req_cnt_ = 0;
|
||||
unaligned_write_req_cnt_ = 0;
|
||||
read_req_cnt_ = 0;
|
||||
unaligned_read_req_cnt_ = 0;
|
||||
total_read_size_ = 0;
|
||||
last_access_ts_ = -1;
|
||||
last_modify_ts_ = -1;
|
||||
birth_ts_ = -1;
|
||||
}
|
||||
|
||||
ObTmpFileHandle::ObTmpFileHandle(ObSharedNothingTmpFile *tmp_file)
|
||||
: ptr_(tmp_file)
|
||||
{
|
||||
@ -188,7 +256,16 @@ ObSharedNothingTmpFile::ObSharedNothingTmpFile()
|
||||
last_page_lock_(common::ObLatchIds::TMP_FILE_LOCK),
|
||||
multi_write_lock_(common::ObLatchIds::TMP_FILE_LOCK),
|
||||
truncate_lock_(common::ObLatchIds::TMP_FILE_LOCK),
|
||||
inner_flush_ctx_()
|
||||
inner_flush_ctx_(),
|
||||
trace_id_(),
|
||||
write_req_cnt_(0),
|
||||
unaligned_write_req_cnt_(0),
|
||||
read_req_cnt_(0),
|
||||
unaligned_read_req_cnt_(0),
|
||||
total_read_size_(0),
|
||||
last_access_ts_(-1),
|
||||
last_modify_ts_(-1),
|
||||
birth_ts_(-1)
|
||||
{
|
||||
}
|
||||
|
||||
@ -233,6 +310,15 @@ int ObSharedNothingTmpFile::init(const uint64_t tenant_id, const int64_t fd, con
|
||||
tenant_id_ = tenant_id;
|
||||
dir_id_ = dir_id;
|
||||
fd_ = fd;
|
||||
ObCurTraceId::TraceId *cur_trace_id = ObCurTraceId::get_trace_id();
|
||||
if (nullptr != cur_trace_id) {
|
||||
trace_id_ = *cur_trace_id;
|
||||
} else {
|
||||
trace_id_.init(GCONF.self_addr_);
|
||||
}
|
||||
last_access_ts_ = ObTimeUtility::current_time();
|
||||
last_modify_ts_ = ObTimeUtility::current_time();
|
||||
birth_ts_ = ObTimeUtility::current_time();
|
||||
}
|
||||
|
||||
LOG_INFO("tmp file init over", KR(ret), K(fd), K(dir_id));
|
||||
@ -314,6 +400,17 @@ void ObSharedNothingTmpFile::reset()
|
||||
data_eviction_node_.unlink();
|
||||
meta_eviction_node_.unlink();
|
||||
inner_flush_ctx_.reset();
|
||||
/******for virtual table begin******/
|
||||
trace_id_.reset();
|
||||
write_req_cnt_ = 0;
|
||||
unaligned_write_req_cnt_ = 0;
|
||||
read_req_cnt_ = 0;
|
||||
unaligned_read_req_cnt_ = 0;
|
||||
total_read_size_ = 0;
|
||||
last_access_ts_ = -1;
|
||||
last_modify_ts_ = -1;
|
||||
birth_ts_ = -1;
|
||||
/******for virtual table end******/
|
||||
}
|
||||
|
||||
bool ObSharedNothingTmpFile::is_deleting()
|
||||
@ -360,6 +457,10 @@ int ObSharedNothingTmpFile::aio_pread(ObTmpFileIOCtx &io_ctx)
|
||||
if (io_ctx.get_read_offset_in_file() < 0) {
|
||||
io_ctx.set_read_offset_in_file(read_offset_);
|
||||
}
|
||||
if (0 != io_ctx.get_read_offset_in_file() % ObTmpFileGlobal::PAGE_SIZE
|
||||
|| 0 != io_ctx.get_todo_size() % ObTmpFileGlobal::PAGE_SIZE) {
|
||||
io_ctx.set_is_unaligned_read(true);
|
||||
}
|
||||
|
||||
LOG_DEBUG("start to inner read tmp file", K(fd_), K(io_ctx.get_read_offset_in_file()),
|
||||
K(io_ctx.get_todo_size()), K(io_ctx.get_done_size()), KPC(this));
|
||||
@ -898,6 +999,8 @@ int ObSharedNothingTmpFile::aio_write(ObTmpFileIOCtx &io_ctx)
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("attempt to write a deleting file", KR(ret), K(fd_));
|
||||
} else {
|
||||
bool is_unaligned_write = 0 != file_size_ % ObTmpFileGlobal::PAGE_SIZE
|
||||
|| 0 != io_ctx.get_todo_size() % ObTmpFileGlobal::PAGE_SIZE;
|
||||
while (OB_SUCC(ret) && io_ctx.get_todo_size() > 0) {
|
||||
if (OB_FAIL(inner_write_(io_ctx))) {
|
||||
if (OB_ALLOCATE_TMP_FILE_PAGE_FAILED == ret) {
|
||||
@ -915,6 +1018,13 @@ int ObSharedNothingTmpFile::aio_write(ObTmpFileIOCtx &io_ctx)
|
||||
}
|
||||
}
|
||||
} // end while
|
||||
if (OB_SUCC(ret)) {
|
||||
write_req_cnt_++;
|
||||
if (is_unaligned_write) {
|
||||
unaligned_write_req_cnt_++;
|
||||
}
|
||||
last_modify_ts_ = ObTimeUtility::current_time();
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
@ -1594,6 +1704,7 @@ int ObSharedNothingTmpFile::truncate(const int64_t truncate_offset)
|
||||
LOG_WARN("fail to truncate data page", KR(ret), K(fd_), K(truncate_offset), KPC(this));
|
||||
} else {
|
||||
truncated_offset_ = truncate_offset;
|
||||
last_modify_ts_ = ObTimeUtility::current_time();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1816,6 +1927,36 @@ int64_t ObSharedNothingTmpFile::cal_wbp_begin_offset_() const
|
||||
return res;
|
||||
}
|
||||
|
||||
void ObSharedNothingTmpFile::set_read_stats_vars(const bool is_unaligned_read, const int64_t read_size)
|
||||
{
|
||||
common::TCRWLock::WLockGuard guard(meta_lock_);
|
||||
read_req_cnt_++;
|
||||
if (is_unaligned_read) {
|
||||
unaligned_read_req_cnt_++;
|
||||
}
|
||||
total_read_size_ += read_size;
|
||||
last_access_ts_ = ObTimeUtility::current_time();
|
||||
}
|
||||
|
||||
int ObSharedNothingTmpFile::copy_info_for_virtual_table(ObSNTmpFileInfo &tmp_file_info)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
common::TCRWLock::RLockGuardWithTimeout lock_guard(meta_lock_, 100 * 1000L, ret);
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(tmp_file_info.init(trace_id_, tenant_id_,
|
||||
dir_id_, fd_, file_size_,
|
||||
truncated_offset_, is_deleting_,
|
||||
cached_page_nums_, write_back_data_page_num_,
|
||||
flushed_data_page_num_, ref_cnt_,
|
||||
write_req_cnt_, unaligned_write_req_cnt_,
|
||||
read_req_cnt_, unaligned_read_req_cnt_,
|
||||
total_read_size_, last_access_ts_,
|
||||
last_modify_ts_, birth_ts_))) {
|
||||
LOG_WARN("fail to init tmp_file_info", KR(ret), KPC(this));
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
int ObSharedNothingTmpFile::remove_flush_node(const bool is_meta)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
@ -40,6 +40,79 @@ class ObTmpFileFlushManager;
|
||||
class ObTmpFileTreeFlushContext;
|
||||
class ObTmpFileDataFlushContext;
|
||||
|
||||
//for virtual table show
|
||||
class ObSNTmpFileInfo
|
||||
{
|
||||
public:
|
||||
ObSNTmpFileInfo() :
|
||||
trace_id_(),
|
||||
tenant_id_(OB_INVALID_TENANT_ID),
|
||||
dir_id_(ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID),
|
||||
fd_(ObTmpFileGlobal::INVALID_TMP_FILE_FD),
|
||||
file_size_(0),
|
||||
truncated_offset_(0),
|
||||
is_deleting_(false),
|
||||
cached_page_num_(0),
|
||||
write_back_data_page_num_(0),
|
||||
flushed_data_page_num_(0),
|
||||
ref_cnt_(0),
|
||||
write_req_cnt_(0),
|
||||
unaligned_write_req_cnt_(0),
|
||||
read_req_cnt_(0),
|
||||
unaligned_read_req_cnt_(0),
|
||||
total_read_size_(0),
|
||||
last_access_ts_(-1),
|
||||
last_modify_ts_(-1),
|
||||
birth_ts_(-1) {}
|
||||
int init(const ObCurTraceId::TraceId &trace_id,
|
||||
const uint64_t tenant_id,
|
||||
const int64_t dir_id,
|
||||
const int64_t fd,
|
||||
const int64_t file_size,
|
||||
const int64_t truncated_offset,
|
||||
const bool is_deleting,
|
||||
const int64_t cached_page_num,
|
||||
const int64_t write_back_data_page_num,
|
||||
const int64_t flushed_data_page_num,
|
||||
const int64_t ref_cnt,
|
||||
const int64_t write_req_cnt,
|
||||
const int64_t unaligned_write_req_cnt,
|
||||
const int64_t read_req_cnt,
|
||||
const int64_t unaligned_read_req_cnt,
|
||||
const int64_t total_read_size,
|
||||
const int64_t last_access_ts,
|
||||
const int64_t last_modify_ts,
|
||||
const int64_t birth_ts);
|
||||
void reset();
|
||||
public:
|
||||
common::ObCurTraceId::TraceId trace_id_;
|
||||
uint64_t tenant_id_;
|
||||
int64_t dir_id_;
|
||||
int64_t fd_;
|
||||
int64_t file_size_;
|
||||
int64_t truncated_offset_;
|
||||
bool is_deleting_;
|
||||
int64_t cached_page_num_;
|
||||
int64_t write_back_data_page_num_;
|
||||
int64_t flushed_data_page_num_;
|
||||
int64_t ref_cnt_;
|
||||
int64_t write_req_cnt_;
|
||||
int64_t unaligned_write_req_cnt_;
|
||||
int64_t read_req_cnt_;
|
||||
int64_t unaligned_read_req_cnt_;
|
||||
int64_t total_read_size_;
|
||||
int64_t last_access_ts_;
|
||||
int64_t last_modify_ts_;
|
||||
int64_t birth_ts_;
|
||||
|
||||
TO_STRING_KV(K(trace_id_), K(tenant_id_), K(dir_id_), K(fd_), K(file_size_),
|
||||
K(truncated_offset_), K(is_deleting_), K(cached_page_num_),
|
||||
K(write_back_data_page_num_), K(flushed_data_page_num_),
|
||||
K(ref_cnt_), K(write_req_cnt_), K(unaligned_write_req_cnt_),
|
||||
K(read_req_cnt_), K(unaligned_read_req_cnt_), K(total_read_size_),
|
||||
K(last_access_ts_), K(last_modify_ts_), K(birth_ts_));
|
||||
};
|
||||
|
||||
class ObSharedNothingTmpFile final
|
||||
{
|
||||
public:
|
||||
@ -143,7 +216,10 @@ public:
|
||||
KP(meta_flush_node_.get_next()),
|
||||
K(is_in_data_eviction_list_), K(is_in_meta_eviction_list_),
|
||||
KP(data_eviction_node_.get_next()),
|
||||
KP(meta_eviction_node_.get_next()));
|
||||
KP(meta_eviction_node_.get_next()), K(trace_id_),
|
||||
K(write_req_cnt_), K(unaligned_write_req_cnt_), K(read_req_cnt_),
|
||||
K(unaligned_read_req_cnt_), K(total_read_size_),
|
||||
K(last_access_ts_), K(last_modify_ts_), K(birth_ts_));
|
||||
// XXX Currently, K(tmp_file) is used to print the ObSharedNothingTmpFile structure without holding
|
||||
// the file lock. Before adding the print field, make sure it is thread-safe.
|
||||
|
||||
@ -209,6 +285,8 @@ public:
|
||||
void get_dirty_meta_page_num(int64_t &non_rightmost_dirty_page_num, int64_t &rightmost_dirty_page_num) const;
|
||||
void get_dirty_meta_page_num_with_lock(int64_t &non_rightmost_dirty_page_num, int64_t &rightmost_dirty_page_num);
|
||||
int64_t cal_wbp_begin_offset();
|
||||
void set_read_stats_vars(const bool is_unaligned_read, const int64_t read_size);
|
||||
int copy_info_for_virtual_table(ObSNTmpFileInfo &tmp_file_info);
|
||||
|
||||
private:
|
||||
int inner_read_truncated_part_(ObTmpFileIOCtx &io_ctx);
|
||||
@ -360,6 +438,17 @@ private:
|
||||
ObSpinLock multi_write_lock_; // handle conflicts between multiple writes
|
||||
SpinRWLock truncate_lock_; // handle conflicts between truncate and flushing
|
||||
InnerFlushContext inner_flush_ctx_; // file-level flush context
|
||||
/********for virtual table begin********/
|
||||
common::ObCurTraceId::TraceId trace_id_;
|
||||
int64_t write_req_cnt_;
|
||||
int64_t unaligned_write_req_cnt_;
|
||||
int64_t read_req_cnt_;
|
||||
int64_t unaligned_read_req_cnt_;
|
||||
int64_t total_read_size_;
|
||||
int64_t last_access_ts_;
|
||||
int64_t last_modify_ts_;
|
||||
int64_t birth_ts_;
|
||||
/********for virtual table end********/
|
||||
};
|
||||
|
||||
class ObTmpFileHandle final
|
||||
|
@ -546,8 +546,7 @@ ObTmpFileBlockManager::ObTmpFileBlockManager() :
|
||||
block_index_generator_(0),
|
||||
block_map_(),
|
||||
block_allocator_(),
|
||||
stat_lock_(),
|
||||
map_lock_()
|
||||
stat_lock_()
|
||||
{}
|
||||
|
||||
ObTmpFileBlockManager::~ObTmpFileBlockManager()
|
||||
@ -613,7 +612,6 @@ int ObTmpFileBlockManager::create_tmp_file_block(const int64_t begin_page_id, co
|
||||
} else if (OB_FAIL(handle.init(blk, this))) {
|
||||
LOG_WARN("fail to init tmp file block handle", KR(ret), K(block_index));
|
||||
} else {
|
||||
SharedLockGuard guard(map_lock_);
|
||||
if (OB_FAIL(block_map_.insert(ObTmpFileBlockKey(block_index), handle))) {
|
||||
LOG_WARN("fail to insert tmp file block into map", KR(ret), K(block_index));
|
||||
}
|
||||
@ -765,7 +763,6 @@ int ObTmpFileBlockManager::remove_tmp_file_block_(const int64_t block_index)
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ObTmpFileBlockManager has not been inited", KR(ret), K(tenant_id_));
|
||||
} else {
|
||||
SharedLockGuard guard(map_lock_);
|
||||
if (OB_FAIL(block_map_.erase(ObTmpFileBlockKey(block_index), handle))) {
|
||||
if (ret != OB_ENTRY_NOT_EXIST) {
|
||||
LOG_WARN("fail to erase tmp file block", KR(ret), K(block_index));
|
||||
@ -847,7 +844,6 @@ int ObTmpFileBlockManager::get_macro_block_count(int64_t ¯o_block_count)
|
||||
int ObTmpFileBlockManager::get_macro_block_list(common::ObIArray<blocksstable::MacroBlockId> ¯o_id_list)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ExclusiveLockGuard guard(map_lock_);
|
||||
CollectMacroBlockIdFunctor func(macro_id_list);
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
|
@ -212,7 +212,6 @@ private:
|
||||
ObTmpFileBlockMap block_map_;
|
||||
common::ObConcurrentFIFOAllocator block_allocator_;
|
||||
common::SpinRWLock stat_lock_; // to protect the consistency of used_page_num_ and physical_block_num_
|
||||
common::SpinRWLock map_lock_; // to protect the for_each operation of block_map_
|
||||
DISALLOW_COPY_AND_ASSIGN(ObTmpFileBlockManager);
|
||||
};
|
||||
|
||||
|
@ -33,6 +33,7 @@ ObTmpFileIOCtx::ObTmpFileIOCtx():
|
||||
read_offset_in_file_(-1),
|
||||
disable_page_cache_(false),
|
||||
disable_block_cache_(false),
|
||||
is_unaligned_read_(false),
|
||||
io_flag_(),
|
||||
io_timeout_ms_(DEFAULT_IO_WAIT_TIME_MS),
|
||||
io_handles_(),
|
||||
@ -111,6 +112,7 @@ void ObTmpFileIOCtx::reset()
|
||||
dir_id_ = ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID;
|
||||
disable_page_cache_ = false;
|
||||
disable_block_cache_ = false;
|
||||
is_unaligned_read_ = false;
|
||||
io_flag_.reset();
|
||||
io_timeout_ms_ = DEFAULT_IO_WAIT_TIME_MS;
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
OB_INLINE bool is_disable_block_cache() const { return disable_block_cache_; }
|
||||
OB_INLINE common::ObIOFlag get_io_flag() const { return io_flag_; }
|
||||
OB_INLINE int64_t get_io_timeout_ms() const { return io_timeout_ms_; }
|
||||
OB_INLINE void set_is_unaligned_read(const bool is_unaligned_read) { is_unaligned_read_ = is_unaligned_read; }
|
||||
OB_INLINE bool is_unaligned_read() { return is_unaligned_read_; }
|
||||
|
||||
TO_STRING_KV(K(is_inited_), K(is_read_),
|
||||
K(fd_), K(dir_id_), KP(buf_),
|
||||
@ -161,6 +163,7 @@ private:
|
||||
int64_t read_offset_in_file_;
|
||||
bool disable_page_cache_;
|
||||
bool disable_block_cache_; // only used in ut, to control whether read data from block cache
|
||||
bool is_unaligned_read_; //for statistics
|
||||
common::ObIOFlag io_flag_;
|
||||
int64_t io_timeout_ms_;
|
||||
common::ObSEArray<ObIOReadHandle, 1> io_handles_;
|
||||
|
@ -307,6 +307,9 @@ int ObTenantTmpFileManager::aio_read(const ObTmpFileIOInfo &io_info, ObTmpFileIO
|
||||
LOG_WARN("fail to init io handle", KR(ret), K(io_info));
|
||||
} else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) {
|
||||
LOG_WARN("fail to aio pread", KR(ret), K(io_info));
|
||||
} else {
|
||||
tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(),
|
||||
io_info.size_);
|
||||
}
|
||||
|
||||
LOG_DEBUG("aio_read a tmp file over", KR(ret), K(io_info), K(io_handle), KPC(tmp_file_handle.get()));
|
||||
@ -336,6 +339,9 @@ int ObTenantTmpFileManager::aio_pread(const ObTmpFileIOInfo &io_info,
|
||||
LOG_WARN("fail to init io handle", KR(ret), K(io_info));
|
||||
} else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) {
|
||||
LOG_WARN("fail to aio pread", KR(ret), K(io_info));
|
||||
} else {
|
||||
tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(),
|
||||
io_info.size_);
|
||||
}
|
||||
|
||||
LOG_DEBUG("aio_pread a tmp file over", KR(ret), K(io_info), K(offset), K(io_handle), KPC(tmp_file_handle.get()));
|
||||
@ -363,6 +369,9 @@ int ObTenantTmpFileManager::read(const ObTmpFileIOInfo &io_info, ObTmpFileIOHand
|
||||
LOG_WARN("fail to init io handle", KR(ret), K(io_info));
|
||||
} else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) {
|
||||
LOG_WARN("fail to aio pread", KR(ret), K(io_info));
|
||||
} else {
|
||||
tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(),
|
||||
io_info.size_);
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) || OB_ITER_END == ret) {
|
||||
@ -398,6 +407,9 @@ int ObTenantTmpFileManager::pread(const ObTmpFileIOInfo &io_info, const int64_t
|
||||
LOG_WARN("fail to init io handle", KR(ret), K(io_info));
|
||||
} else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) {
|
||||
LOG_WARN("fail to aio pread", KR(ret), K(io_info));
|
||||
} else {
|
||||
tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(),
|
||||
io_info.size_);
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) || OB_ITER_END == ret) {
|
||||
@ -480,7 +492,7 @@ int ObTenantTmpFileManager::get_tmp_file(const int64_t fd, ObTmpFileHandle &file
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (OB_FAIL(files_.get(ObTmpFileKey(fd), file_handle))) {
|
||||
if (OB_HASH_NOT_EXIST == ret) {
|
||||
if (OB_ENTRY_NOT_EXIST == ret) {
|
||||
LOG_WARN("tmp file does not exist", KR(ret), K(fd));
|
||||
} else {
|
||||
LOG_WARN("fail to get tmp file", KR(ret), K(fd));
|
||||
@ -538,5 +550,57 @@ int ObTenantTmpFileManager::get_macro_block_count(int64_t ¯o_block_count)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ObTenantTmpFileManager::CollectTmpFileKeyFunctor::operator()(
|
||||
const ObTmpFileKey &key, const ObTmpFileHandle &tmp_file_handle)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObSharedNothingTmpFile *tmp_file_ptr = NULL;
|
||||
|
||||
if (OB_ISNULL(tmp_file_handle.get())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get invalid tmp file pointer", KR(ret), K(key), KP(tmp_file_handle.get()));
|
||||
} else if (OB_FAIL(fds_.push_back(key.fd_))) {
|
||||
LOG_WARN("failed to push back", KR(ret), K(key));
|
||||
}
|
||||
return OB_SUCCESS == ret;
|
||||
}
|
||||
|
||||
int ObTenantTmpFileManager::get_tmp_file_fds(ObIArray<int64_t> &fd_arr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
CollectTmpFileKeyFunctor func(fd_arr);
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ObTenantTmpFileManager has not been inited", KR(ret), K(tenant_id_));
|
||||
} else if (OB_FAIL(files_.for_each(func))) {
|
||||
LOG_WARN("fail to collect tmp file fds", KR(ret));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTenantTmpFileManager::get_tmp_file_info(const int64_t fd, ObSNTmpFileInfo &tmp_file_info)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTmpFileHandle file_handle;
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ObTenantTmpFileManager has not been inited", KR(ret), K(tenant_id_));
|
||||
} else if (OB_FAIL(get_tmp_file(fd, file_handle))) {
|
||||
if (OB_ENTRY_NOT_EXIST == ret) {
|
||||
LOG_INFO("tmp file not exist", KR(ret), K(fd));
|
||||
} else {
|
||||
LOG_WARN("fail to get tmp file", KR(ret), K(fd));
|
||||
}
|
||||
} else if (OB_ISNULL(file_handle.get())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get invalid tmp file pointer", KR(ret), K(fd), KP(file_handle.get()));
|
||||
} else if (OB_FAIL(file_handle.get()->copy_info_for_virtual_table(tmp_file_info))) {
|
||||
LOG_WARN("failed to copy info for virtual table", KR(ret), K(fd), KPC(file_handle.get()));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // end namespace tmp_file
|
||||
} // end namespace oceanbase
|
||||
|
@ -83,6 +83,22 @@ public:
|
||||
OB_INLINE ObTmpFileBlockManager &get_tmp_file_block_manager() { return tmp_file_block_manager_; }
|
||||
OB_INLINE ObTmpFilePageCacheController &get_page_cache_controller() { return page_cache_controller_; }
|
||||
|
||||
public:
|
||||
//for virtual table to show
|
||||
int get_tmp_file_fds(ObIArray<int64_t> &fd_arr);
|
||||
int get_tmp_file_info(const int64_t fd, ObSNTmpFileInfo &tmp_file_info);
|
||||
private:
|
||||
class CollectTmpFileKeyFunctor final
|
||||
{
|
||||
public:
|
||||
CollectTmpFileKeyFunctor(ObIArray<int64_t> &fds)
|
||||
: fds_(fds) {}
|
||||
bool operator()(const ObTmpFileKey &key, const ObTmpFileHandle &tmp_file_handle);
|
||||
|
||||
private:
|
||||
ObIArray<int64_t> &fds_;
|
||||
};
|
||||
|
||||
private:
|
||||
static const int64_t REFRESH_CONFIG_INTERVAL = 5 * 60 * 1000 * 1000L; // 5min
|
||||
static const int64_t META_DEFAULT_LIMIT = 15 * 1024L * 1024L * 1024L;
|
||||
|
@ -351,6 +351,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys
|
||||
| def | oceanbase | DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TABLE_STAT_STALE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TASK_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TEMP_FILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TENANTS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TENANT_EVENT_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TRANSFER_PARTITION_TASKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
@ -888,6 +889,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys
|
||||
| def | oceanbase | __all_virtual_tablet_meta_table | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tablet_stat | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_task_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_temp_file | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_event_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_memory_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
@ -1882,6 +1884,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys
|
||||
| def | oceanbase | DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TABLE_STAT_STALE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TASK_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TEMP_FILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TENANTS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TENANT_EVENT_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | DBA_OB_TRANSFER_PARTITION_TASKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
@ -2419,6 +2422,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys
|
||||
| def | oceanbase | __all_virtual_table_mgr | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_table_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_task_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_temp_file | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_event_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
| def | oceanbase | __all_virtual_tenant_memory_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | |
|
||||
|
@ -6839,6 +6839,26 @@ POS bigint(0) unsigned NO
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN_COLS limit 1);
|
||||
cnt
|
||||
1
|
||||
desc oceanbase.DBA_OB_TEMP_FILES;
|
||||
Field Type Null Key Default Extra
|
||||
SVR_IP varchar(46) NO NULL
|
||||
SVR_PORT bigint(20) NO NULL
|
||||
FILE_ID bigint(20) NO NULL
|
||||
TRACE_ID varchar(64) NO NULL
|
||||
DIR_ID bigint(20) NO NULL
|
||||
BYTES bigint(20) NO NULL
|
||||
START_OFFSET bigint(20) NO NULL
|
||||
TOTAL_WRITES bigint(20) NO NULL
|
||||
UNALIGNED_WRITES bigint(20) NO NULL
|
||||
TOTAL_READS bigint(20) NO NULL
|
||||
UNALIGNED_READS bigint(20) NO NULL
|
||||
TOTAL_READ_BYTES bigint(20) NO NULL
|
||||
LAST_ACCESS_TIME timestamp(6) NO NULL
|
||||
LAST_MODIFY_TIME timestamp(6) NO NULL
|
||||
BIRTH_TIME timestamp(6) NO NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.DBA_OB_TEMP_FILES limit 1);
|
||||
cnt
|
||||
1
|
||||
select case cnt when 0 then NULL else 'UNEXPECTED ERROR: It is expected to be an empty set, which means that all GV$ and V$ view column names are defined consistently' end ERROR_INFO from (select /*+no_rewrite*/ count(*) cnt from
|
||||
(SELECT t.table_name,
|
||||
group_concat(c.column_name) as column_name_list
|
||||
|
@ -9682,6 +9682,47 @@ POS bigint(0) unsigned NO
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN_COLS limit 1);
|
||||
cnt
|
||||
1
|
||||
desc oceanbase.DBA_OB_TEMP_FILES;
|
||||
Field Type Null Key Default Extra
|
||||
SVR_IP varchar(46) NO NULL
|
||||
SVR_PORT bigint(20) NO NULL
|
||||
FILE_ID bigint(20) NO NULL
|
||||
TRACE_ID varchar(64) NO NULL
|
||||
DIR_ID bigint(20) NO NULL
|
||||
BYTES bigint(20) NO NULL
|
||||
START_OFFSET bigint(20) NO NULL
|
||||
TOTAL_WRITES bigint(20) NO NULL
|
||||
UNALIGNED_WRITES bigint(20) NO NULL
|
||||
TOTAL_READS bigint(20) NO NULL
|
||||
UNALIGNED_READS bigint(20) NO NULL
|
||||
TOTAL_READ_BYTES bigint(20) NO NULL
|
||||
LAST_ACCESS_TIME timestamp(6) NO NULL
|
||||
LAST_MODIFY_TIME timestamp(6) NO NULL
|
||||
BIRTH_TIME timestamp(6) NO NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.DBA_OB_TEMP_FILES limit 1);
|
||||
cnt
|
||||
1
|
||||
desc oceanbase.CDB_OB_TEMP_FILES;
|
||||
Field Type Null Key Default Extra
|
||||
TENANT_ID bigint(20) NO NULL
|
||||
SVR_IP varchar(46) NO NULL
|
||||
SVR_PORT bigint(20) NO NULL
|
||||
FILE_ID bigint(20) NO NULL
|
||||
TRACE_ID varchar(64) NO NULL
|
||||
DIR_ID bigint(20) NO NULL
|
||||
BYTES bigint(20) NO NULL
|
||||
START_OFFSET bigint(20) NO NULL
|
||||
TOTAL_WRITES bigint(20) NO NULL
|
||||
UNALIGNED_WRITES bigint(20) NO NULL
|
||||
TOTAL_READS bigint(20) NO NULL
|
||||
UNALIGNED_READS bigint(20) NO NULL
|
||||
TOTAL_READ_BYTES bigint(20) NO NULL
|
||||
LAST_ACCESS_TIME timestamp(6) NO NULL
|
||||
LAST_MODIFY_TIME timestamp(6) NO NULL
|
||||
BIRTH_TIME timestamp(6) NO NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.CDB_OB_TEMP_FILES limit 1);
|
||||
cnt
|
||||
1
|
||||
select case cnt when 0 then NULL else 'UNEXPECTED ERROR: It is expected to be an empty set, which means that all GV$ and V$ view column names are defined consistently' end ERROR_INFO from (select /*+no_rewrite*/ count(*) cnt from
|
||||
(SELECT t.table_name,
|
||||
group_concat(c.column_name) as column_name_list
|
||||
|
@ -5039,3 +5039,32 @@ IF(count(*) >= 0, 1, 0)
|
||||
"oceanbase.__all_virtual_nic_info runs in single server"
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
desc oceanbase.__all_virtual_temp_file;
|
||||
Field Type Null Key Default Extra
|
||||
tenant_id bigint(20) NO NULL
|
||||
svr_ip varchar(46) NO NULL
|
||||
svr_port bigint(20) NO NULL
|
||||
file_id bigint(20) NO NULL
|
||||
trace_id varchar(64) NO NULL
|
||||
dir_id bigint(20) NO NULL
|
||||
bytes bigint(20) NO NULL
|
||||
start_offset bigint(20) NO NULL
|
||||
is_deleting tinyint(4) NO NULL
|
||||
cached_page_num bigint(20) NO NULL
|
||||
write_back_page_num bigint(20) NO NULL
|
||||
flushed_page_num bigint(20) NO NULL
|
||||
ref_cnt bigint(20) NO NULL
|
||||
total_writes bigint(20) NO NULL
|
||||
unaligned_writes bigint(20) NO NULL
|
||||
total_reads bigint(20) NO NULL
|
||||
unaligned_reads bigint(20) NO NULL
|
||||
total_read_bytes bigint(20) NO NULL
|
||||
last_access_time timestamp(6) NO NULL
|
||||
last_modify_time timestamp(6) NO NULL
|
||||
birth_time timestamp(6) NO NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_temp_file;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
"oceanbase.__all_virtual_temp_file runs in single server"
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
|
@ -9750,3 +9750,32 @@ description varchar(2048) YES NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_spatial_reference_systems;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
desc oceanbase.__all_virtual_temp_file;
|
||||
Field Type Null Key Default Extra
|
||||
tenant_id bigint(20) NO NULL
|
||||
svr_ip varchar(46) NO NULL
|
||||
svr_port bigint(20) NO NULL
|
||||
file_id bigint(20) NO NULL
|
||||
trace_id varchar(64) NO NULL
|
||||
dir_id bigint(20) NO NULL
|
||||
bytes bigint(20) NO NULL
|
||||
start_offset bigint(20) NO NULL
|
||||
is_deleting tinyint(4) NO NULL
|
||||
cached_page_num bigint(20) NO NULL
|
||||
write_back_page_num bigint(20) NO NULL
|
||||
flushed_page_num bigint(20) NO NULL
|
||||
ref_cnt bigint(20) NO NULL
|
||||
total_writes bigint(20) NO NULL
|
||||
unaligned_writes bigint(20) NO NULL
|
||||
total_reads bigint(20) NO NULL
|
||||
unaligned_reads bigint(20) NO NULL
|
||||
total_read_bytes bigint(20) NO NULL
|
||||
last_access_time timestamp(6) NO NULL
|
||||
last_modify_time timestamp(6) NO NULL
|
||||
birth_time timestamp(6) NO NULL
|
||||
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_temp_file;
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
"oceanbase.__all_virtual_temp_file runs in single server"
|
||||
IF(count(*) >= 0, 1, 0)
|
||||
1
|
||||
|
@ -762,6 +762,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
|
||||
12487 __all_virtual_nic_info 2 201001 1
|
||||
12488 __all_virtual_scheduler_job_run_detail_v2 2 201001 1
|
||||
12490 __all_virtual_spatial_reference_systems 2 201001 1
|
||||
12505 __all_virtual_temp_file 2 201001 1
|
||||
20001 GV$OB_PLAN_CACHE_STAT 1 201001 1
|
||||
20002 GV$OB_PLAN_CACHE_PLAN_STAT 1 201001 1
|
||||
20003 SCHEMATA 1 201002 1
|
||||
@ -1222,6 +1223,8 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
|
||||
21603 INNODB_SYS_FIELDS 1 201002 1
|
||||
21604 INNODB_SYS_FOREIGN 1 201002 1
|
||||
21605 INNODB_SYS_FOREIGN_COLS 1 201002 1
|
||||
21622 DBA_OB_TEMP_FILES 1 201001 1
|
||||
21623 CDB_OB_TEMP_FILES 1 201001 1
|
||||
check sys table count and table_id range success
|
||||
check count and table_id range for virtual table success
|
||||
select * from information_schema.CHARACTER_SETS limit 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user