feat: hbaseapi support ttl & maxversions
This commit is contained in:
@ -3886,12 +3886,6 @@ int ObBackupDatabaseResolver::resolve(const ParseNode& parse_tree)
|
||||
if (OB_UNLIKELY(T_BACKUP_DATABASE != parse_tree.type_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("type is not T_BACKUP_DATABASE", "type", get_type_name(parse_tree.type_));
|
||||
} else if (OB_UNLIKELY(NULL == parse_tree.children_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("children should not be null", K(ret));
|
||||
} else if (OB_UNLIKELY(1 != parse_tree.num_child_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("children num not match", K(ret), "num_child", parse_tree.num_child_);
|
||||
} else if (OB_ISNULL(session_info_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("session info should not be null", K(ret));
|
||||
@ -3911,6 +3905,36 @@ int ObBackupDatabaseResolver::resolve(const ParseNode& parse_tree)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObTableTTLResolver::resolve(const ParseNode& parse_tree)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_UNLIKELY(T_TABLE_TTL != parse_tree.type_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("type is not T_TABLE_TTL", "type", get_type_name(parse_tree.type_));
|
||||
} else if (OB_UNLIKELY(NULL == parse_tree.children_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("children should not be null", K(ret));
|
||||
} else if (OB_UNLIKELY(1 != parse_tree.num_child_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("children num not match", K(ret), "num_child", parse_tree.num_child_);
|
||||
} else if (OB_ISNULL(session_info_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("session info should not be null", K(ret));
|
||||
} else {
|
||||
ObTableTTLStmt* stmt = create_stmt<ObTableTTLStmt>();
|
||||
const int64_t type = parse_tree.children_[0]->value_;
|
||||
if (NULL == stmt) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_ERROR("create ObArchiveLogStmt failed");
|
||||
} else if (OB_FAIL(stmt->set_param(type))) {
|
||||
LOG_WARN("Failed to set param", K(ret), K(type));
|
||||
} else {
|
||||
stmt_ = stmt;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObBackupManageResolver::resolve(const ParseNode& parse_tree)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -193,6 +193,7 @@ private:
|
||||
|
||||
DEF_SIMPLE_CMD_RESOLVER(ObEnableSqlThrottleResolver);
|
||||
DEF_SIMPLE_CMD_RESOLVER(ObDisableSqlThrottleResolver);
|
||||
DEF_SIMPLE_CMD_RESOLVER(ObTableTTLResolver);
|
||||
|
||||
#undef DEF_SIMPLE_CMD_RESOLVER
|
||||
|
||||
|
||||
@ -1175,6 +1175,39 @@ private:
|
||||
int64_t copy_id_;
|
||||
};
|
||||
|
||||
class ObTableTTLStmt : public ObSystemCmdStmt {
|
||||
public:
|
||||
ObTableTTLStmt()
|
||||
: ObSystemCmdStmt(stmt::T_TABLE_TTL),
|
||||
type_(obrpc::ObTTLRequestArg::TTL_INVALID_TYPE)
|
||||
{}
|
||||
virtual ~ObTableTTLStmt()
|
||||
{}
|
||||
|
||||
obrpc::ObTTLRequestArg::TTLRequestType get_type() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
int set_param(const int64_t type)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
|
||||
if (type < 0 || type >= obrpc::ObTTLRequestArg::TTL_MOVE_TYPE) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
COMMON_LOG(WARN, "invalid args", K(type));
|
||||
} else {
|
||||
type_ = static_cast<obrpc::ObTTLRequestArg::TTLRequestType>(type);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
TO_STRING_KV(N_STMT_TYPE, ((int)stmt_type_), K_(tenant_id), K_(type));
|
||||
|
||||
private:
|
||||
uint64_t tenant_id_;
|
||||
obrpc::ObTTLRequestArg::TTLRequestType type_;
|
||||
};
|
||||
|
||||
class ObBackupSetEncryptionStmt : public ObSystemCmdStmt {
|
||||
public:
|
||||
ObBackupSetEncryptionStmt();
|
||||
|
||||
Reference in New Issue
Block a user