OceanBase Plugin Development Kit
OceanBase Plugin Development Kit
载入中...
搜索中...
未找到
ObPlugin

OceanBase Plugin Interface 更多...

宏定义

#define OBP_LOG(level, fmt, args...)
 logging macro
 
#define OBP_LOG_TRACE(fmt, args...)
 
#define OBP_LOG_INFO(fmt, args...)
 
#define OBP_LOG_WARN(fmt, args...)
 

类型定义

typedef ObPluginDatum ObPluginAllocatorPtr
 < The allocator paramter
 
typedef ObPluginDatum ObPluginCharsetInfoPtr
 

枚举

enum  ObPluginLogLevel {
  OBP_LOG_LEVEL_TRACE ,
  OBP_LOG_LEVEL_INFO ,
  OBP_LOG_LEVEL_WARN
}
 Log Level 更多...
 

函数

OBP_PUBLIC_API void * obp_malloc (int64_t size)
 malloc interface with alignment
 
OBP_PUBLIC_API void * obp_malloc_align (int64_t alignment, int64_t size)
 free memory
 
OBP_PUBLIC_API void obp_free (void *ptr)
 
OBP_PUBLIC_API void * obp_allocate (ObPluginAllocatorPtr allocator, int64_t size)
 allocate memory with the specific allocator
 
OBP_PUBLIC_API void * obp_allocate_align (ObPluginAllocatorPtr allocator, int64_t alignment, int64_t size)
 free memory
 
OBP_PUBLIC_API void obp_deallocate (ObPluginAllocatorPtr allocator, void *ptr)
 
OBP_PUBLIC_API int obp_charset_is_utf8mb4 (ObPluginCharsetInfoPtr cs)
 Test whether this is utf8 charset
 
OBP_PUBLIC_API const char * obp_charset_csname (ObPluginCharsetInfoPtr cs)
 
OBP_PUBLIC_API int obp_charset_ctype (ObPluginCharsetInfoPtr cs, int *ctype, const unsigned char *str, const unsigned char *end)
 Get the ctype of the char
 
OBP_PUBLIC_API size_t obp_charset_numchars (ObPluginCharsetInfoPtr cs, const char *str, const char *end)
 Count the char number in the string
 
OBP_PUBLIC_API int obp_log_enabled (int32_t level)
 test if we should output the log with specific level
 
OBP_PUBLIC_API void obp_log_format (int32_t level, const char *filename, int32_t lineno, const char *location_string, int64_t location_string_size, const char *function, const char *format,...) __attribute__((format(printf
 logging
 

变量

enum OBP_PUBLIC_API ObPluginCharType
 
const int OBP_SUCCESS = 0
 this is the adaptor errno of oceanbase errno
 
const int OBP_INVALID_ARGUMENT = -4002
 
const int OBP_INIT_TWICE = -4005
 
const int OBP_NOT_INIT = -4006
 
const int OBP_NOT_SUPPORTED = -4007
 
const int OBP_ITER_END = -4008
 
const int OBP_ALLOCATE_MEMORY_FAILED = -4013
 
const int OBP_PLUGIN_ERROR = -11078
 

详细描述

OceanBase Plugin Interface

宏定义说明

◆ OBP_LOG

#define OBP_LOG ( level,
fmt,
args... )
值:
do { \
if (OBP_SUCCESS == obp_log_enabled(level)) { \
(void)obp_log_format(level, \
__FILE__, \
__LINE__, \
__FILE__ ":" OBP_STRINGIZE(__LINE__), \
sizeof(__FILE__ ":" OBP_STRINGIZE(__LINE__)), \
__FUNCTION__, \
fmt, \
##args); \
} \
} while (0)
OBP_PUBLIC_API int obp_log_enabled(int32_t level)
test if we should output the log with specific level
const int OBP_SUCCESS
this is the adaptor errno of oceanbase errno
OBP_PUBLIC_API void obp_log_format(int32_t level, const char *filename, int32_t lineno, const char *location_string, int64_t location_string_size, const char *function, const char *format,...) __attribute__((format(printf
logging
#define OBP_STRINGIZE(str)

logging macro

在文件 ob_plugin_log.h61 行定义.

◆ OBP_LOG_INFO

#define OBP_LOG_INFO ( fmt,
args... )
值:
#define OBP_LOG(level, fmt, args...)
logging macro
@ OBP_LOG_LEVEL_INFO

在文件 ob_plugin_log.h76 行定义.

◆ OBP_LOG_TRACE

#define OBP_LOG_TRACE ( fmt,
args... )
值:
@ OBP_LOG_LEVEL_TRACE

在文件 ob_plugin_log.h75 行定义.

◆ OBP_LOG_WARN

#define OBP_LOG_WARN ( fmt,
args... )
值:
@ OBP_LOG_LEVEL_WARN

在文件 ob_plugin_log.h77 行定义.

类型定义说明

◆ ObPluginAllocatorPtr

< The allocator paramter

malloc interface without label

在文件 ob_plugin_allocator.h27 行定义.

◆ ObPluginCharsetInfoPtr

枚举类型说明

◆ ObPluginLogLevel

Log Level

枚举值
OBP_LOG_LEVEL_TRACE 
OBP_LOG_LEVEL_INFO 
OBP_LOG_LEVEL_WARN 

在文件 ob_plugin_log.h30 行定义.

函数说明

◆ obp_allocate()

OBP_PUBLIC_API void * obp_allocate ( ObPluginAllocatorPtr allocator,
int64_t size )

allocate memory with the specific allocator

you can get allocator from specific plugin interface, such as FTParser

注解
A valid allocator always has a memory label allocate memory with alignment parameter

◆ obp_allocate_align()

OBP_PUBLIC_API void * obp_allocate_align ( ObPluginAllocatorPtr allocator,
int64_t alignment,
int64_t size )

free memory

◆ obp_charset_csname()

OBP_PUBLIC_API const char * obp_charset_csname ( ObPluginCharsetInfoPtr cs)

◆ obp_charset_ctype()

OBP_PUBLIC_API int obp_charset_ctype ( ObPluginCharsetInfoPtr cs,
int * ctype,
const unsigned char * str,
const unsigned char * end )

Get the ctype of the char

参数
[in]csThe charset
[out]ctypeThe char type. Refer to ObPluginCharType for details.
[in]strThe beginning of the string.
[in]endThe end of the string(not inclusive).
返回
The byte number of the char(> 0) or error.

◆ obp_charset_is_utf8mb4()

OBP_PUBLIC_API int obp_charset_is_utf8mb4 ( ObPluginCharsetInfoPtr cs)

Test whether this is utf8 charset

◆ obp_charset_numchars()

OBP_PUBLIC_API size_t obp_charset_numchars ( ObPluginCharsetInfoPtr cs,
const char * str,
const char * end )

Count the char number in the string

参数
[in]csThe charset
[in]strThe beginning of the string.
[in]endThe end of the string(not inclusive).

◆ obp_deallocate()

OBP_PUBLIC_API void obp_deallocate ( ObPluginAllocatorPtr allocator,
void * ptr )

◆ obp_free()

OBP_PUBLIC_API void obp_free ( void * ptr)

◆ obp_log_enabled()

OBP_PUBLIC_API int obp_log_enabled ( int32_t level)

test if we should output the log with specific level

注解
you shouldn't call this routine
返回
  • OBP_SUCCESS enabled
  • others not enabled

◆ obp_log_format()

OBP_PUBLIC_API void obp_log_format ( int32_t level,
const char * filename,
int32_t lineno,
const char * location_string,
int64_t location_string_size,
const char * function,
const char * format,
... )

logging

注解
you should use OBP_LOG_xxx instead

◆ obp_malloc()

OBP_PUBLIC_API void * obp_malloc ( int64_t size)

malloc interface with alignment

◆ obp_malloc_align()

OBP_PUBLIC_API void * obp_malloc_align ( int64_t alignment,
int64_t size )

free memory

变量说明

◆ OBP_ALLOCATE_MEMORY_FAILED

const int OBP_ALLOCATE_MEMORY_FAILED = -4013

在文件 ob_plugin_errno.h34 行定义.

◆ OBP_INIT_TWICE

const int OBP_INIT_TWICE = -4005

在文件 ob_plugin_errno.h30 行定义.

◆ OBP_INVALID_ARGUMENT

const int OBP_INVALID_ARGUMENT = -4002

在文件 ob_plugin_errno.h29 行定义.

◆ OBP_ITER_END

const int OBP_ITER_END = -4008

在文件 ob_plugin_errno.h33 行定义.

◆ OBP_NOT_INIT

const int OBP_NOT_INIT = -4006

在文件 ob_plugin_errno.h31 行定义.

◆ OBP_NOT_SUPPORTED

const int OBP_NOT_SUPPORTED = -4007

在文件 ob_plugin_errno.h32 行定义.

◆ OBP_PLUGIN_ERROR

const int OBP_PLUGIN_ERROR = -11078

在文件 ob_plugin_errno.h35 行定义.

◆ OBP_SUCCESS

const int OBP_SUCCESS = 0

this is the adaptor errno of oceanbase errno

在文件 ob_plugin_errno.h28 行定义.

◆ ObPluginCharType

enum OBP_PUBLIC_API ObPluginCharType

在文件 ob_plugin_charset_info.h26 行定义.