patch 4.0
This commit is contained in:
@ -14,10 +14,13 @@
|
||||
#define OCEANBASE_ENGINE_OB_OPERATOR_FACTORY_H_
|
||||
|
||||
#include "lib/allocator/ob_allocator.h"
|
||||
#include "share/ob_cluster_version.h"
|
||||
#include "sql/engine/ob_phy_operator_type.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
|
||||
class ObOpSpec;
|
||||
class ObOperator;
|
||||
@ -26,22 +29,25 @@ class ObExecContext;
|
||||
class ObStaticEngineCG;
|
||||
class ObLogicalOperator;
|
||||
|
||||
struct ObOperatorFactory {
|
||||
struct ObOperatorFactory
|
||||
{
|
||||
public:
|
||||
// allocate operator specification
|
||||
static int alloc_op_spec(
|
||||
common::ObIAllocator& alloc, const ObPhyOperatorType type, const int64_t child_cnt, ObOpSpec*& spec);
|
||||
static int alloc_op_spec(common::ObIAllocator &alloc, const ObPhyOperatorType type,
|
||||
const int64_t child_cnt, ObOpSpec *&spec);
|
||||
|
||||
// allocate operator
|
||||
static int alloc_operator(common::ObIAllocator& alloc, ObExecContext& exec_ctx, const ObOpSpec& spec,
|
||||
ObOpInput* input, const int64_t child_cnt, ObOperator*& op);
|
||||
static int alloc_operator(common::ObIAllocator &alloc,
|
||||
ObExecContext &exec_ctx, const ObOpSpec &spec, ObOpInput *input,
|
||||
const int64_t child_cnt, ObOperator *&op);
|
||||
|
||||
// allocate operator input
|
||||
static int alloc_op_input(
|
||||
common::ObIAllocator& alloc, ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput*& input);
|
||||
static int alloc_op_input(common::ObIAllocator &alloc, ObExecContext &exec_ctx,
|
||||
const ObOpSpec &spec, ObOpInput *&input);
|
||||
|
||||
// generate operator specification
|
||||
static int generate_spec(ObStaticEngineCG& cg, ObLogicalOperator& log_op, ObOpSpec& spec, const bool in_root_job);
|
||||
static int generate_spec(ObStaticEngineCG &cg, ObLogicalOperator &log_op, ObOpSpec &spec,
|
||||
const bool in_root_job);
|
||||
|
||||
static inline bool is_registered(const ObPhyOperatorType type)
|
||||
{
|
||||
@ -53,18 +59,28 @@ public:
|
||||
return type >= 0 && type < PHY_END && NULL != G_ALL_ALLOC_FUNS_[type].input_func_;
|
||||
}
|
||||
|
||||
struct AllocFun {
|
||||
static inline bool is_vectorized(const ObPhyOperatorType type)
|
||||
{
|
||||
// consider upgrade case: disable vectorize if high version observer support
|
||||
// vectorization, while low version observer does NOT
|
||||
return type >= 0 && type < PHY_END && G_VECTORIZED_OP_ARRAY_[type] &&
|
||||
(G_OB_VERSION_ARRAY_[type] <= GET_MIN_CLUSTER_VERSION());
|
||||
}
|
||||
|
||||
struct AllocFun
|
||||
{
|
||||
__typeof__(&ObOperatorFactory::alloc_op_spec) spec_func_;
|
||||
__typeof__(&ObOperatorFactory::alloc_operator) op_func_;
|
||||
__typeof__(&ObOperatorFactory::alloc_op_input) input_func_;
|
||||
__typeof__(&ObOperatorFactory::generate_spec) gen_spec_func_;
|
||||
};
|
||||
|
||||
private:
|
||||
static AllocFun* G_ALL_ALLOC_FUNS_;
|
||||
static AllocFun *G_ALL_ALLOC_FUNS_;
|
||||
static bool *G_VECTORIZED_OP_ARRAY_;
|
||||
static uint64_t *G_OB_VERSION_ARRAY_;
|
||||
};
|
||||
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
|
||||
#endif // OCEANBASE_ENGINE_OB_OPERATOR_FACTORY_H_
|
||||
#endif // OCEANBASE_ENGINE_OB_OPERATOR_FACTORY_H_
|
||||
|
||||
Reference in New Issue
Block a user