Do not report ERROR when sample rate equals 100

This commit is contained in:
ZenoWang
2024-02-06 14:49:31 +00:00
committed by ob-robot
parent 1f1d5c08ae
commit c8ef409bf3
3710 changed files with 486984 additions and 3083329 deletions

View File

@ -15,7 +15,6 @@
#include "share/stat/ob_opt_column_stat.h"
#include "share/stat/ob_opt_table_stat.h"
#include "share/stat/ob_opt_system_stat.h"
#include "share/stat/ob_stat_define.h"
#include "share/stat/ob_opt_stat_gather_stat.h"
#include "lib/mysqlclient/ob_mysql_transaction.h"
@ -61,12 +60,6 @@ struct ObOptKeyInfo
struct ObOptKeyColumnStat
{
ObOptKeyColumnStat() : key_(NULL), stat_(NULL), only_histogram_stat_(false) {}
ObOptKeyColumnStat(const ObOptColumnStat::Key *key,
ObOptColumnStat *stat) :
key_(key),
stat_(stat),
only_histogram_stat_(false)
{}
const ObOptColumnStat::Key *key_;
ObOptColumnStat *stat_;
bool only_histogram_stat_;
@ -74,15 +67,6 @@ struct ObOptKeyColumnStat
KPC_(stat),
K(only_histogram_stat_));
};
enum ObOptStatCompressType
{
ZLIB_COMPRESS = 0,
ZSTD_1_3_8_COMPRESS = 1,
MAX_COMPRESS = 2
};
static const char *bitmap_compress_lib_name[ObOptStatCompressType::MAX_COMPRESS] = {"zlib_1.0", "zstd_1.3.8"};
/**
* SQL Service for fetching/updating table level statistics and column level statistics
*/
@ -98,12 +82,6 @@ public:
const ObOptTableStat::Key &key,
ObIArray<ObOptTableStat> &all_part_stats);
int batch_fetch_table_stats(sqlclient::ObISQLConnection *conn,
const uint64_t tenant_id,
const uint64_t table_id,
const ObIArray<int64_t> &part_ids,
ObIArray<ObOptTableStat*> &all_part_stats);
int fill_table_stat(sqlclient::ObMySQLResult &result, ObOptTableStat &stat);
int fill_column_stat(ObIAllocator &allocator,
@ -114,50 +92,46 @@ public:
int fetch_column_stat(const uint64_t tenant_id,
ObIAllocator &allocator,
ObIArray<ObOptKeyColumnStat> &key_col_stats,
bool is_accross_tenant_query = false,
sqlclient::ObISQLConnection *conn = NULL);
bool is_accross_tenant_query = false);
int update_table_stat(const uint64_t tenant_id,
sqlclient::ObISQLConnection *conn,
const ObOptTableStat *tab_stat,
const bool is_index_stat);
int update_table_stat(const uint64_t tenant_id,
sqlclient::ObISQLConnection *conn,
ObMySQLTransaction &trans,
const common::ObIArray<ObOptTableStat*> &table_stats,
const int64_t current_time,
const bool is_index_stat);
const bool is_index_stat,
const bool is_history_stat = false);
int update_column_stat(share::schema::ObSchemaGetterGuard *schema_guard,
const uint64_t exec_tenant_id,
ObIAllocator &allocator,
sqlclient::ObISQLConnection *conn,
ObMySQLTransaction &trans,
const common::ObIArray<ObOptColumnStat*> &column_stats,
const int64_t current_time,
bool only_update_col_stat = false,
bool is_history_stat = false,
const ObObjPrintParams &print_params = ObObjPrintParams());
int delete_table_stat(const uint64_t exec_tenant_id,
const uint64_t table_id,
const ObIArray<int64_t> &part_ids,
const bool cascade_column,
int64_t degree,
int64_t &affected_rows);
int delete_column_stat(const uint64_t exec_tenant_id,
const uint64_t table_id,
const ObIArray<uint64_t> &column_ids,
const ObIArray<int64_t> &partition_ids,
const bool only_histogram /*=false*/,
const int64_t degree);
const bool only_histogram /*=false*/);
static int get_decompressed_llc_bitmap(ObIAllocator &allocator,
const char *bitmap_compress_name,
const char *comp_buf,
int64_t comp_size,
char *&bitmap_buf,
int64_t &bitmap_size);
static int get_compressed_llc_bitmap(ObIAllocator &allocator,
const char *bitmap_compress_name,
const char *bitmap_buf,
int64_t bitmap_size,
char *&comp_buf,
@ -196,20 +170,16 @@ public:
int update_opt_stat_gather_stat(const ObOptStatGatherStat &gather_stat);
int update_opt_stat_task_stat(const ObOptStatTaskInfo &task_info);
int update_system_stats(const uint64_t tenant_id,
const ObOptSystemStat *system_stat);
int fetch_system_stat(const uint64_t tenant_id,
const ObOptSystemStat::Key &key,
ObOptSystemStat &stat);
int delete_system_stats(const uint64_t tenant_id);
private:
int get_table_stat_sql(const uint64_t tenant_id,
const ObOptTableStat &stat,
const int64_t current_time,
const bool is_index,
ObSqlString &sql_string);
int get_table_stat_history_sql(const uint64_t tenant_id,
const ObOptTableStat &stat,
const int64_t saving_time,
ObSqlString &sql_string);
int get_column_stat_sql(const uint64_t tenant_id,
ObIAllocator &allocator,
const ObOptColumnStat &stat,
@ -218,6 +188,14 @@ private:
ObObjMeta max_meta,
ObSqlString &sql_string,
const ObObjPrintParams &print_params);
int get_column_stat_history_sql(const uint64_t tenant_id,
ObIAllocator &allocator,
const ObOptColumnStat &stat,
const int64_t saving_time,
ObObjMeta min_meta,
ObObjMeta max_meta,
ObSqlString &sql_string,
const ObObjPrintParams &print_params);
int get_histogram_stat_sql(const uint64_t tenant_id,
const ObOptColumnStat &stat,
common::ObIAllocator &allocator,
@ -225,6 +203,14 @@ private:
ObObjMeta endpoint_meta,
ObSqlString &sql_string,
const ObObjPrintParams &print_params);
int get_histogram_stat_history_sql(const uint64_t tenant_id,
const ObOptColumnStat &stat,
ObIAllocator &allocator,
const ObHistBucket &bucket,
const int64_t saving_time,
ObObjMeta endpoint_meta,
ObSqlString &sql_string,
const ObObjPrintParams &print_params);
int generate_in_list(const ObIArray<uint64_t> &list,
ObSqlString &sql_string);
@ -234,6 +220,7 @@ private:
ObIAllocator &allocator,
const ObIArray<ObOptColumnStat*> &column_stats,
const int64_t current_time,
bool is_history_stat,
ObSqlString &column_stats_sql,
const ObObjPrintParams &print_params);
@ -246,6 +233,7 @@ private:
ObIAllocator &allocator,
const ObIArray<ObOptColumnStat*> &column_stats,
const int64_t current_time,
bool is_history_stat,
ObSqlString &insert_histogram_sql,
bool &need_histogram,
const ObObjPrintParams &print_params);
@ -285,12 +273,7 @@ private:
int get_gather_stat_task_value(const ObOptStatTaskInfo &task_info,
ObSqlString &values_str);
int get_system_stat_sql(const uint64_t tenant_id,
const ObOptSystemStat &stat,
const int64_t current_time,
ObSqlString &sql_string);
int fill_system_stat(sqlclient::ObMySQLResult &result, ObOptSystemStat &stat);
static const char *bitmap_compress_lib_name;
bool inited_;
ObMySQLProxy *mysql_proxy_;