Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
2c4284ca
O
oceanbase
项目概览
知世而放
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2c4284ca
编写于
11月 03, 2022
作者:
S
saltonz
提交者:
wangzelin.wzl
11月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bugfix] enable integer type improvement
上级
b12a45fe
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
131 addition
and
129 deletion
+131
-129
src/share/schema/ob_table_schema.cpp
src/share/schema/ob_table_schema.cpp
+0
-5
src/storage/blocksstable/encoding/ob_column_equal_decoder.cpp
...storage/blocksstable/encoding/ob_column_equal_decoder.cpp
+7
-6
src/storage/blocksstable/encoding/ob_column_equal_decoder.h
src/storage/blocksstable/encoding/ob_column_equal_decoder.h
+5
-4
src/storage/blocksstable/encoding/ob_const_decoder.cpp
src/storage/blocksstable/encoding/ob_const_decoder.cpp
+1
-1
src/storage/blocksstable/encoding/ob_const_decoder.h
src/storage/blocksstable/encoding/ob_const_decoder.h
+4
-4
src/storage/blocksstable/encoding/ob_dict_decoder.cpp
src/storage/blocksstable/encoding/ob_dict_decoder.cpp
+12
-11
src/storage/blocksstable/encoding/ob_dict_decoder.h
src/storage/blocksstable/encoding/ob_dict_decoder.h
+5
-5
src/storage/blocksstable/encoding/ob_encoding_bitset.h
src/storage/blocksstable/encoding/ob_encoding_bitset.h
+18
-14
src/storage/blocksstable/encoding/ob_hex_string_decoder.h
src/storage/blocksstable/encoding/ob_hex_string_decoder.h
+3
-3
src/storage/blocksstable/encoding/ob_integer_base_diff_decoder.h
...rage/blocksstable/encoding/ob_integer_base_diff_decoder.h
+5
-5
src/storage/blocksstable/encoding/ob_inter_column_substring_decoder.cpp
...ocksstable/encoding/ob_inter_column_substring_decoder.cpp
+1
-1
src/storage/blocksstable/encoding/ob_inter_column_substring_decoder.h
...blocksstable/encoding/ob_inter_column_substring_decoder.h
+3
-3
src/storage/blocksstable/encoding/ob_micro_block_decoder.cpp
src/storage/blocksstable/encoding/ob_micro_block_decoder.cpp
+30
-32
src/storage/blocksstable/encoding/ob_micro_block_decoder.h
src/storage/blocksstable/encoding/ob_micro_block_decoder.h
+11
-12
src/storage/blocksstable/encoding/ob_raw_decoder.cpp
src/storage/blocksstable/encoding/ob_raw_decoder.cpp
+10
-8
src/storage/blocksstable/encoding/ob_raw_decoder.h
src/storage/blocksstable/encoding/ob_raw_decoder.h
+4
-4
src/storage/blocksstable/encoding/ob_rle_decoder.cpp
src/storage/blocksstable/encoding/ob_rle_decoder.cpp
+1
-1
src/storage/blocksstable/encoding/ob_rle_decoder.h
src/storage/blocksstable/encoding/ob_rle_decoder.h
+4
-4
src/storage/blocksstable/encoding/ob_string_diff_decoder.h
src/storage/blocksstable/encoding/ob_string_diff_decoder.h
+3
-3
src/storage/blocksstable/encoding/ob_string_prefix_decoder.h
src/storage/blocksstable/encoding/ob_string_prefix_decoder.h
+3
-3
src/storage/blocksstable/ob_sstable_printer.cpp
src/storage/blocksstable/ob_sstable_printer.cpp
+1
-0
未找到文件。
src/share/schema/ob_table_schema.cpp
浏览文件 @
2c4284ca
...
...
@@ -3826,11 +3826,6 @@ int ObTableSchema::check_alter_column_type(const ObColumnSchemaV2 &src_column,
||
(
src_meta
.
is_varbinary
()
&&
dst_meta
.
is_blob
())
||
(
src_meta
.
is_text
()
&&
(
dst_meta
.
is_text
()
||
dst_meta
.
is_varchar
()))
||
(
src_meta
.
is_blob
()
&&
(
dst_meta
.
is_blob
()
||
dst_meta
.
is_varbinary
()))))
{
if
(
src_meta
.
is_integer_type
()
&&
dst_meta
.
is_integer_type
())
{
ret
=
OB_NOT_SUPPORTED
;
LOG_WARN
(
"Type increment of integer type is not supported"
,
K
(
ret
),
K
(
src_meta
),
K
(
dst_meta
));
LOG_USER_ERROR
(
OB_NOT_SUPPORTED
,
"Type increment of integer type is"
);
}
// online, do nothing
}
else
{
is_offline
=
true
;
...
...
src/storage/blocksstable/encoding/ob_column_equal_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -53,7 +53,8 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
if
(
!
has_exc
(
ctx
))
{
ref
=
-
1
;
}
else
{
const
ObObjTypeClass
tc
=
ob_obj_type_class
(
ctx
.
obj_meta_
.
get_type
());
const
ObObjType
store_type
=
ctx
.
col_header_
->
get_store_obj_type
();
const
ObObjTypeClass
tc
=
ob_obj_type_class
(
store_type
);
switch
(
get_store_class_map
()[
tc
])
{
case
ObUIntSC
:
case
ObIntSC
:
{
...
...
@@ -61,7 +62,7 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
meta_header_
->
payload_
,
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObColumnEqualMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
store_type
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
),
K
(
ctx
));
}
break
;
...
...
@@ -71,7 +72,7 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
meta_header_
->
payload_
,
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObColumnEqualMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
store_type
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
),
K
(
ctx
));
}
break
;
...
...
@@ -83,7 +84,7 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
meta_header_
->
payload_
,
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObColumnEqualMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
store_type
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
),
K
(
ctx
));
}
break
;
...
...
@@ -93,7 +94,7 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
meta_header_
->
payload_
,
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObColumnEqualMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
store_type
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
),
K
(
ctx
));
}
break
;
...
...
@@ -103,7 +104,7 @@ int ObColumnEqualDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const int
meta_header_
->
payload_
,
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObColumnEqualMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
store_type
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
),
K
(
ctx
));
}
break
;
...
...
src/storage/blocksstable/encoding/ob_column_equal_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -34,9 +34,10 @@ public:
ObColumnEqualDecoder
();
virtual
~
ObColumnEqualDecoder
();
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
);
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
);
void
reset
();
OB_INLINE
void
reuse
();
virtual
int
decode
(
ObColumnDecoderCtx
&
ctx
,
common
::
ObObj
&
cell
,
const
int64_t
row_id
,
...
...
@@ -58,12 +59,12 @@ private:
const
ObColumnEqualMetaHeader
*
meta_header_
;
};
OB_INLINE
int
ObColumnEqualDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObColumnEqualDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
)
{
UNUSEDx
(
obj_meta
,
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
,
column_header
);
int
ret
=
common
::
OB_SUCCESS
;
// performance critical, don't check params
if
(
inited_
)
{
...
...
src/storage/blocksstable/encoding/ob_const_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -178,7 +178,7 @@ int ObConstDecoder::batch_decode(
}
else
if
(
OB_FAIL
(
extract_ref_and_null_count
(
row_ids
,
row_cap
,
datums
,
unused_null_cnt
)))
{
LOG_WARN
(
"Failed to extract refs"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
dict_decoder_
.
batch_decode_dict
(
ctx
.
obj_meta_
.
get
_type
(),
ctx
.
col_header_
->
get_store_obj
_type
(),
cell_datas
,
row_cap
,
ctx
.
col_header_
->
length_
-
meta_header_
->
offset_
,
...
...
src/storage/blocksstable/encoding/ob_const_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -36,7 +36,7 @@ public:
}
virtual
~
ObConstDecoder
()
{}
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
);
...
...
@@ -127,12 +127,12 @@ private:
ObDictDecoder
dict_decoder_
;
};
OB_INLINE
int
ObConstDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObConstDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta_data
)
{
UNUSEDx
(
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
);
// performance critical, don't check params
int
ret
=
common
::
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
is_inited
()))
{
...
...
@@ -143,7 +143,7 @@ OB_INLINE int ObConstDecoder::init(const common::ObObjMeta &obj_meta,
meta_header_
=
reinterpret_cast
<
const
ObConstMetaHeader
*>
(
meta_data
);
const
char
*
dict_data
=
meta_data
+
meta_header_
->
offset_
;
if
(
meta_header_
->
count_
>
0
)
{
if
(
OB_FAIL
(
dict_decoder_
.
init
(
obj_meta
,
dict_data
)))
{
if
(
OB_FAIL
(
dict_decoder_
.
init
(
column_header
.
get_store_obj_type
()
,
dict_data
)))
{
STORAGE_LOG
(
WARN
,
"failed to init dict decoder"
,
K
(
ret
),
KP
(
dict_data
));
meta_header_
=
NULL
;
}
...
...
src/storage/blocksstable/encoding/ob_dict_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -189,17 +189,16 @@ bool init_dict_cmp_ref_funcs()
bool
dict_cmp_ref_funcs_inited
=
init_dict_cmp_ref_funcs
();
int
ObDictDecoder
::
init
(
const
ObObjMeta
&
obj_meta
,
const
char
*
meta_header
)
int
ObDictDecoder
::
init
(
const
common
::
ObObjType
&
store_obj_type
,
const
char
*
meta_header
)
{
UNUSEDx
(
obj_meta
);
int
ret
=
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
is_inited
()))
{
ret
=
OB_INIT_TWICE
;
LOG_WARN
(
"init twice"
,
K
(
ret
));
}
else
{
store_class_
=
get_store_class_map
()[
ob_obj_type_class
(
obj_meta
.
get_type
()
)];
if
(
ObIntTC
==
ob_obj_type_class
(
obj_meta
.
get_type
()
))
{
int64_t
type_store_size
=
get_type_size_map
()[
obj_meta
.
get_type
()
];
store_class_
=
get_store_class_map
()[
ob_obj_type_class
(
store_obj_type
)];
if
(
ObIntTC
==
ob_obj_type_class
(
store_obj_type
))
{
int64_t
type_store_size
=
get_type_size_map
()[
store_obj_type
];
integer_mask_
=
~
INTEGER_MASK_TABLE
[
type_store_size
];
}
else
{
integer_mask_
=
0
;
...
...
@@ -402,7 +401,8 @@ int ObDictDecoder::batch_decode(
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"Not init"
,
K
(
ret
));
}
else
if
(
fast_decode_valid
(
ctx
))
{
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ctx
.
obj_meta_
.
get_type_class
()];
const
ObObjType
store_obj_type
=
ctx
.
col_header_
->
get_store_obj_type
();
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ob_obj_type_class
(
store_obj_type
)];
const
char
*
ref_data
=
reinterpret_cast
<
char
*>
(
const_cast
<
ObDictMetaHeader
*>
(
meta_header_
))
+
ctx
.
col_header_
->
length_
;
...
...
@@ -410,9 +410,9 @@ int ObDictDecoder::batch_decode(
if
(
meta_header_
->
is_fix_length_dict
())
{
// Only need store_len for UIntSC/IntSC
const
int64_t
store_size
=
meta_header_
->
data_size_
;
const
ObObjDatumMapType
map_type
=
ObDatum
::
get_obj_datum_map_type
(
ctx
.
obj_meta_
.
get_type
()
);
const
ObObjDatumMapType
map_type
=
ObDatum
::
get_obj_datum_map_type
(
store_obj_type
);
bool
read_as_signed_data
=
ObIntSC
==
store_class
&&
store_size
==
get_type_size_map
()[
ctx
.
obj_meta_
.
get_type
()
];
&&
store_size
==
get_type_size_map
()[
store_obj_type
];
const
int64_t
func_entry_store_size_idx
=
(
store_class
==
ObIntSC
||
store_class
==
ObUIntSC
)
?
store_size
:
0
;
dict_fix_batch_decode_func
decode_func
=
dict_fix_batch_decode_funcs
...
...
@@ -423,7 +423,7 @@ int ObDictDecoder::batch_decode(
[
get_store_class_tag_map
()[
store_class
]];
decode_func
(
ref_data
,
base_data
,
store_size
,
meta_header_
->
count_
,
row_ids
,
row_cap
,
datums
);
LOG_DEBUG
(
"[batch_decode] Run fix dict fast batch decode"
,
K
(
ret
),
K
(
store_class
),
K
(
store_size
),
K
(
map_type
),
K
(
ctx
.
obj_meta_
.
get_type
()
),
K
(
ret
),
K
(
store_class
),
K
(
store_size
),
K
(
map_type
),
K
(
store_obj_type
),
K
(
read_as_signed_data
),
K
(
func_entry_store_size_idx
));
}
else
{
dict_var_batch_decode_func
decode_func
=
dict_var_batch_decode_funcs
...
...
@@ -456,7 +456,7 @@ int ObDictDecoder::batch_decode(
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
batch_decode_dict
(
ctx
.
obj_meta_
.
get
_type
(),
ctx
.
col_header_
->
get_store_obj
_type
(),
cell_datas
,
row_cap
,
ctx
.
col_header_
->
length_
,
...
...
@@ -542,7 +542,8 @@ int ObDictDecoder::batch_decode_dict(
bool
ObDictDecoder
::
fast_decode_valid
(
const
ObColumnDecoderCtx
&
ctx
)
const
{
bool
valid
=
false
;
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ctx
.
obj_meta_
.
get_type_class
()];
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ob_obj_type_class
(
ctx
.
col_header_
->
get_store_obj_type
())];
if
(
meta_header_
->
is_fix_length_dict
())
{
valid
=
!
ctx
.
is_bit_packing
()
&&
meta_header_
->
row_ref_size_
<=
2
...
...
src/storage/blocksstable/encoding/ob_dict_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -60,11 +60,11 @@ public:
{}
virtual
~
ObDictDecoder
()
{}
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
int
init
(
const
common
::
ObObj
Meta
&
obj_meta
,
const
char
*
meta_header
);
int
init
(
const
common
::
ObObj
Type
&
store_obj_type
,
const
char
*
meta_header
);
virtual
int
decode
(
ObColumnDecoderCtx
&
ctx
,
common
::
ObObj
&
cell
,
const
int64_t
row_id
,
const
ObBitStream
&
bs
,
const
char
*
data
,
const
int64_t
len
)
const
override
;
...
...
@@ -201,7 +201,7 @@ private:
const
char
*
var_data_
;
};
OB_INLINE
int
ObDictDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObDictDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
...
...
@@ -213,10 +213,10 @@ OB_INLINE int ObDictDecoder::init(const common::ObObjMeta &obj_meta,
ret
=
common
::
OB_INIT_TWICE
;
STORAGE_LOG
(
WARN
,
"init twice"
,
K
(
ret
));
}
else
{
const
common
::
ObObjTypeClass
type_class
=
ob_obj_type_class
(
obj_meta
.
get
_type
());
const
common
::
ObObjTypeClass
type_class
=
ob_obj_type_class
(
column_header
.
get_store_obj
_type
());
store_class_
=
get_store_class_map
()[
type_class
];
if
(
common
::
ObIntTC
==
type_class
)
{
int64_t
type_store_size
=
get_type_size_map
()[
obj_meta
.
get
_type
()];
int64_t
type_store_size
=
get_type_size_map
()[
column_header
.
get_store_obj
_type
()];
integer_mask_
=
~
INTEGER_MASK_TABLE
[
type_store_size
];
}
else
{
integer_mask_
=
0
;
...
...
src/storage/blocksstable/encoding/ob_encoding_bitset.h
浏览文件 @
2c4284ca
...
...
@@ -553,17 +553,17 @@ class ObBitMapMetaReader
public:
static
int
read
(
const
char
*
buf
,
const
int64_t
row_count
,
const
bool
bit_packing
,
const
int64_t
row_id
,
const
int64_t
len
,
int64_t
&
ref
,
common
::
ObObj
&
cell
,
const
common
::
ObObj
Meta
type
);
int64_t
&
ref
,
common
::
ObObj
&
cell
,
const
common
::
ObObj
Type
type
);
OB_INLINE
static
int
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
);
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
);
};
template
<
ObObjTypeStoreClass
StoreClass
>
int
ObBitMapMetaReader
<
StoreClass
>::
read
(
const
char
*
buf
,
const
int64_t
row_count
,
const
bool
bit_packing
,
const
int64_t
row_id
,
const
int64_t
len
,
int64_t
&
ref
,
common
::
ObObj
&
cell
,
const
common
::
ObObj
Meta
type
)
int64_t
&
ref
,
common
::
ObObj
&
cell
,
const
common
::
ObObj
Type
type
)
{
int
ret
=
common
::
OB_SUCCESS
;
if
(
OB_ISNULL
(
buf
)
...
...
@@ -592,8 +592,8 @@ int ObBitMapMetaReader<StoreClass>::read(const char *buf, const int64_t row_coun
}
// read data
uint64_t
integer_mask
=
0
;
if
(
common
::
ObIntTC
==
ob_obj_type_class
(
type
.
get_type
()
))
{
integer_mask
=
~
INTEGER_MASK_TABLE
[
get_type_size_map
()[
type
.
get_type
()
]];
if
(
common
::
ObIntTC
==
ob_obj_type_class
(
type
))
{
integer_mask
=
~
INTEGER_MASK_TABLE
[
get_type_size_map
()[
type
]];
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
STORED_NOT_EXT
!=
ext_val
)
{
...
...
@@ -610,7 +610,7 @@ int ObBitMapMetaReader<StoreClass>::read(const char *buf, const int64_t row_coun
template
<
ObObjTypeStoreClass
StoreClass
>
OB_INLINE
int
ObBitMapMetaReader
<
StoreClass
>::
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
)
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
)
{
UNUSED
(
type
);
int
ret
=
common
::
OB_SUCCESS
;
...
...
@@ -637,7 +637,7 @@ OB_INLINE int ObBitMapMetaReader<StoreClass>::read_exc_cell(const char *buf,
template
<
>
OB_INLINE
int
ObBitMapMetaReader
<
ObNumberSC
>::
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
)
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
)
{
int
ret
=
common
::
OB_SUCCESS
;
UNUSEDx
(
bit_packing
,
integer_mask
,
type
);
...
...
@@ -664,7 +664,7 @@ OB_INLINE int ObBitMapMetaReader<ObNumberSC>::read_exc_cell(const char *buf,
template
<
>
OB_INLINE
int
ObBitMapMetaReader
<
ObStringSC
>::
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
)
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
)
{
int
ret
=
common
::
OB_SUCCESS
;
UNUSEDx
(
bit_packing
,
integer_mask
,
type
);
...
...
@@ -698,7 +698,7 @@ OB_INLINE int ObBitMapMetaReader<ObStringSC>::read_exc_cell(const char *buf,
template
<
>
OB_INLINE
int
ObBitMapMetaReader
<
ObOTimestampSC
>::
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
)
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
)
{
int
ret
=
common
::
OB_SUCCESS
;
UNUSEDx
(
bit_packing
,
integer_mask
);
...
...
@@ -719,12 +719,14 @@ OB_INLINE int ObBitMapMetaReader<ObOTimestampSC>::read_exc_cell(const char *buf,
if
(
OB_SUCC
(
ret
))
{
ObStorageDatum
tmp_datum
;
// TODO: remove
ObObjMeta
tmp_obj_meta
;
tmp_obj_meta
.
set_type
(
type
);
ObObjDatumMapType
datum_type
=
ObDatum
::
get_obj_datum_map_type
(
type
.
get_type
()
);
ObObjDatumMapType
datum_type
=
ObDatum
::
get_obj_datum_map_type
(
type
);
const
uint32_t
size
=
ObDatum
::
get_reserved_size
(
datum_type
);
MEMCPY
(
const_cast
<
char
*>
(
tmp_datum
.
ptr_
),
buf
+
meta
->
data_offset_
+
offset
,
size
);
tmp_datum
.
len_
=
size
;
if
(
OB_FAIL
(
tmp_datum
.
to_obj
(
cell
,
t
ype
)))
{
if
(
OB_FAIL
(
tmp_datum
.
to_obj
(
cell
,
t
mp_obj_meta
)))
{
STORAGE_LOG
(
WARN
,
"Failed to read datum"
,
K
(
ret
));
}
}
...
...
@@ -734,7 +736,7 @@ OB_INLINE int ObBitMapMetaReader<ObOTimestampSC>::read_exc_cell(const char *buf,
template
<
>
OB_INLINE
int
ObBitMapMetaReader
<
ObIntervalSC
>::
read_exc_cell
(
const
char
*
buf
,
const
ObBitMapMetaHeader
*
meta
,
const
bool
bit_packing
,
const
int64_t
ref
,
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Meta
type
)
const
int64_t
len
,
common
::
ObObj
&
cell
,
const
uint64_t
integer_mask
,
const
common
::
ObObj
Type
type
)
{
int
ret
=
common
::
OB_SUCCESS
;
UNUSEDx
(
bit_packing
,
integer_mask
);
...
...
@@ -755,12 +757,14 @@ OB_INLINE int ObBitMapMetaReader<ObIntervalSC>::read_exc_cell(const char *buf,
if
(
OB_SUCC
(
ret
))
{
ObStorageDatum
tmp_datum
;
// TODO: remove
ObObjMeta
tmp_obj_meta
;
tmp_obj_meta
.
set_type
(
type
);
ObObjDatumMapType
datum_type
=
ObDatum
::
get_obj_datum_map_type
(
type
.
get_type
()
);
ObObjDatumMapType
datum_type
=
ObDatum
::
get_obj_datum_map_type
(
type
);
const
uint32_t
size
=
ObDatum
::
get_reserved_size
(
datum_type
);
MEMCPY
(
const_cast
<
char
*>
(
tmp_datum
.
ptr_
),
buf
+
meta
->
data_offset_
+
offset
,
size
);
tmp_datum
.
len_
=
size
;
if
(
OB_FAIL
(
tmp_datum
.
to_obj
(
cell
,
t
ype
)))
{
if
(
OB_FAIL
(
tmp_datum
.
to_obj
(
cell
,
t
mp_obj_meta
)))
{
STORAGE_LOG
(
WARN
,
"Failed to read datum"
,
K
(
ret
));
}
}
...
...
src/storage/blocksstable/encoding/ob_hex_string_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -34,7 +34,7 @@ public:
ObHexStringDecoder
();
~
ObHexStringDecoder
();
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -69,13 +69,13 @@ private:
const
ObHexStringHeader
*
header_
;
};
OB_INLINE
int
ObHexStringDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObHexStringDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
// performance critical, don't check params, already checked upper layer
UNUSEDx
(
obj_meta
,
micro_block_header
);
UNUSEDx
(
micro_block_header
);
int
ret
=
common
::
OB_SUCCESS
;
if
(
is_inited
())
{
ret
=
common
::
OB_INIT_TWICE
;
...
...
src/storage/blocksstable/encoding/ob_integer_base_diff_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -35,7 +35,7 @@ public:
{}
virtual
~
ObIntegerBaseDiffDecoder
()
{}
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_metan
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -126,7 +126,7 @@ private:
uint64_t
base_
;
};
OB_INLINE
int
ObIntegerBaseDiffDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObIntegerBaseDiffDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
...
...
@@ -137,11 +137,11 @@ OB_INLINE int ObIntegerBaseDiffDecoder::init(const common::ObObjMeta &obj_meta,
ret
=
common
::
OB_INIT_TWICE
;
STORAGE_LOG
(
WARN
,
"init twice"
,
K
(
ret
));
}
else
{
const
int64_t
store_size
=
get_type_size_map
()[
obj_meta
.
get
_type
()];
ObObjTypeStoreClass
sc
=
get_store_class_map
()[
ob_obj_type_class
(
obj_meta
.
get
_type
())];
const
int64_t
store_size
=
get_type_size_map
()[
column_header
.
get_store_obj
_type
()];
ObObjTypeStoreClass
sc
=
get_store_class_map
()[
ob_obj_type_class
(
column_header
.
get_store_obj
_type
())];
if
(
ObIntSC
!=
sc
&&
ObUIntSC
!=
sc
)
{
ret
=
common
::
OB_INNER_STAT_ERROR
;
STORAGE_LOG
(
WARN
,
"not supported store class"
,
K
(
ret
),
K
(
obj_meta
),
K
(
sc
));
STORAGE_LOG
(
WARN
,
"not supported store class"
,
K
(
ret
),
K
(
column_header
),
K
(
sc
));
}
else
{
meta
+=
column_header
.
offset_
;
header_
=
reinterpret_cast
<
const
ObIntegerBaseDiffHeader
*>
(
meta
);
...
...
src/storage/blocksstable/encoding/ob_inter_column_substring_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -55,7 +55,7 @@ int ObInterColSubStrDecoder::decode(ObColumnDecoderCtx &ctx, ObObj &cell, const
ctx
.
micro_block_header_
->
row_count_
,
ctx
.
is_bit_packing
(),
row_id
,
ctx
.
col_header_
->
length_
-
sizeof
(
ObInterColSubStrMetaHeader
),
ref
,
cell
,
ctx
.
obj_meta_
)))
{
ref
,
cell
,
ctx
.
col_header_
->
get_store_obj_type
()
)))
{
LOG_WARN
(
"meta_reader_ read failed"
,
K
(
ret
),
K
(
row_id
));
}
}
...
...
src/storage/blocksstable/encoding/ob_inter_column_substring_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -34,7 +34,7 @@ public:
ObInterColSubStrDecoder
();
virtual
~
ObInterColSubStrDecoder
();
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -61,13 +61,13 @@ private:
const
ObInterColSubStrMetaHeader
*
meta_header_
;
};
OB_INLINE
int
ObInterColSubStrDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObInterColSubStrDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
int
ret
=
common
::
OB_SUCCESS
;
UNUSEDx
(
obj_meta
,
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
,
column_header
);
// performance critical, don't check params, already checked upper layer
if
(
OB_UNLIKELY
(
is_inited
()))
{
ret
=
common
::
OB_INIT_TWICE
;
...
...
src/storage/blocksstable/encoding/ob_micro_block_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -541,7 +541,7 @@ int ObIEncodeBlockReader::add_decoder(const int64_t store_idx, const ObObjMeta &
}
else
{
const
ObIColumnDecoder
*
decoder
=
nullptr
;
const
ObIColumnDecoder
*
ref_decoder
=
nullptr
;
if
(
OB_FAIL
(
acquire
(
obj_meta
,
store_idx
,
decoder
)))
{
if
(
OB_FAIL
(
acquire
(
store_idx
,
decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
obj_meta
),
K
(
store_idx
));
}
else
{
dest
.
decoder_
=
decoder
;
...
...
@@ -557,7 +557,7 @@ int ObIEncodeBlockReader::add_decoder(const int64_t store_idx, const ObObjMeta &
}
}
if
(
OB_SUCC
(
ret
)
&&
ref_col_idx
>=
0
)
{
if
(
OB_FAIL
(
acquire
(
obj_meta
,
ref_col_idx
,
ref_decoder
)))
{
if
(
OB_FAIL
(
acquire
(
ref_col_idx
,
ref_decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
obj_meta
),
K
(
ref_col_idx
));
}
else
{
dest
.
ctx_
->
ref_decoder_
=
ref_decoder
;
...
...
@@ -573,15 +573,14 @@ int ObIEncodeBlockReader::add_decoder(const int64_t store_idx, const ObObjMeta &
// called before inited
// performance critical, do not check parameters
int
ObIEncodeBlockReader
::
acquire
(
const
ObObjMeta
&
obj_meta
,
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
)
int
ObIEncodeBlockReader
::
acquire
(
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
)
{
int
ret
=
OB_SUCCESS
;
if
(
NULL
!=
cached_decocer_
&&
store_idx
<
cached_decocer_
->
count_
)
{
decoder
=
&
cached_decocer_
->
at
(
store_idx
);
}
else
{
if
(
OB_FAIL
(
ObIEncodeBlockReader
::
acquire_funcs_
[
col_header_
[
store_idx
].
type_
](
*
allocator_
,
obj_meta
,
*
header_
,
col_header_
[
store_idx
],
meta_data_
,
decoder
)))
{
*
allocator_
,
*
header_
,
col_header_
[
store_idx
],
meta_data_
,
decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
store_idx
),
K
(
col_header_
[
store_idx
]));
}
else
{
need_release_decoders_
[
need_release_decoder_cnt_
++
]
=
decoder
;
...
...
@@ -604,7 +603,6 @@ int ObIEncodeBlockReader::setup_row(const uint64_t row_id, int64_t &row_len, con
template
<
class
Decoder
>
int
ObIEncodeBlockReader
::
acquire_decoder
(
ObDecoderAllocator
&
allocator
,
const
ObObjMeta
&
obj_meta
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
...
...
@@ -614,7 +612,10 @@ int ObIEncodeBlockReader::acquire_decoder(ObDecoderAllocator &allocator,
Decoder
*
d
=
nullptr
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_UNLIKELY
(
!
col_header
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"Invalid column header"
,
K
(
ret
),
K
(
header
),
K
(
col_header
));
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -886,15 +887,17 @@ ObMicroBlockDecoder::~ObMicroBlockDecoder()
template
<
typename
Allocator
>
int
ObMicroBlockDecoder
::
acquire
(
Allocator
&
allocator
,
const
ObObjMeta
&
obj_meta
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
)
Allocator
&
allocator
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
)
{
int
ret
=
OB_SUCCESS
;
decoder
=
NULL
;
if
(
!
obj_meta
.
is_valid
(
))
{
if
(
OB_UNLIKELY
(
!
col_header
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid
obj_meta"
,
K
(
ret
),
K
(
obj_meta
));
LOG_WARN
(
"invalid
column header"
,
K
(
ret
),
K
(
col_header
));
}
else
{
switch
(
col_header
.
type_
)
{
...
...
@@ -902,7 +905,7 @@ int ObMicroBlockDecoder::acquire(
ObRawDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init raw decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -914,7 +917,7 @@ int ObMicroBlockDecoder::acquire(
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
{
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init dict decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -927,7 +930,7 @@ int ObMicroBlockDecoder::acquire(
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
{
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init integer base diff decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -939,7 +942,7 @@ int ObMicroBlockDecoder::acquire(
ObStringDiffDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init string diff decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -950,7 +953,7 @@ int ObMicroBlockDecoder::acquire(
ObHexStringDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init hex packing decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -961,7 +964,7 @@ int ObMicroBlockDecoder::acquire(
ObRLEDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init rle decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -972,7 +975,7 @@ int ObMicroBlockDecoder::acquire(
ObConstDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init const decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -983,7 +986,7 @@ int ObMicroBlockDecoder::acquire(
ObStringPrefixDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init string prefix decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -994,7 +997,7 @@ int ObMicroBlockDecoder::acquire(
ObColumnEqualDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init column equal decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -1005,7 +1008,7 @@ int ObMicroBlockDecoder::acquire(
ObInterColSubStrDecoder
*
d
=
NULL
;
if
(
OB_FAIL
(
allocator
.
alloc
(
d
)))
{
LOG_WARN
(
"alloc failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
d
->
init
(
obj_meta
,
header
,
col_header
,
meta_data
)))
{
}
else
if
(
OB_FAIL
(
d
->
init
(
header
,
col_header
,
meta_data
)))
{
LOG_WARN
(
"init column substr decoder failed"
,
K
(
ret
));
}
else
{
decoder
=
d
;
...
...
@@ -1026,17 +1029,13 @@ int ObMicroBlockDecoder::acquire(
// called before inited
// performance critical, do not check parameters
int
ObMicroBlockDecoder
::
acquire
(
const
ObObjMeta
&
obj_meta
,
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
)
int
ObMicroBlockDecoder
::
acquire
(
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
)
{
int
ret
=
OB_SUCCESS
;
if
(
NULL
!=
cached_decoder_
&&
store_idx
<
cached_decoder_
->
count_
)
{
decoder
=
&
cached_decoder_
->
at
(
store_idx
);
}
else
{
if
(
OB_FAIL
(
acquire
(
*
allocator_
,
obj_meta
,
*
header_
,
col_header_
[
store_idx
],
meta_data_
,
decoder
)))
{
if
(
OB_FAIL
(
acquire
(
*
allocator_
,
*
header_
,
col_header_
[
store_idx
],
meta_data_
,
decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
store_idx
),
"column_header"
,
col_header_
[
store_idx
]);
}
else
if
(
OB_FAIL
(
need_release_decoders_
.
push_back
(
decoder
)))
{
...
...
@@ -1140,7 +1139,7 @@ int ObMicroBlockDecoder::add_decoder(const int64_t store_idx, const ObObjMeta &o
dest
.
ctx_
=
&
none_exist_column_decoder_ctx_
;
}
else
{
const
ObIColumnDecoder
*
decoder
=
NULL
;
if
(
OB_FAIL
(
acquire
(
obj_meta
,
store_idx
,
decoder
)))
{
if
(
OB_FAIL
(
acquire
(
store_idx
,
decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
obj_meta
),
K
(
store_idx
));
}
else
{
dest
.
decoder_
=
decoder
;
...
...
@@ -1157,7 +1156,7 @@ int ObMicroBlockDecoder::add_decoder(const int64_t store_idx, const ObObjMeta &o
}
if
(
OB_SUCC
(
ret
)
&&
ref_col_idx
>=
0
)
{
if
(
OB_FAIL
(
acquire
(
obj_meta
,
ref_col_idx
,
decoder
)))
{
if
(
OB_FAIL
(
acquire
(
ref_col_idx
,
decoder
)))
{
LOG_WARN
(
"acquire decoder failed"
,
K
(
ret
),
K
(
obj_meta
),
K
(
ref_col_idx
));
}
else
{
dest
.
ctx_
->
ref_decoder_
=
decoder
;
...
...
@@ -1751,8 +1750,7 @@ int ObMicroBlockDecoder::cache_decoders(
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
h
->
count_
;
++
i
)
{
const
ObIColumnDecoder
*
d
=
nullptr
;
int64_t
ref_col_idx
=
-
1
;
ObObjMeta
obj_meta
=
full_schema_cols
.
at
(
i
).
col_type_
;
if
(
OB_FAIL
(
acquire
(
allocator
,
obj_meta
,
*
header
,
col_header
[
i
],
meta_data
,
d
)))
{
if
(
OB_FAIL
(
acquire
(
allocator
,
*
header
,
col_header
[
i
],
meta_data
,
d
)))
{
LOG_WARN
(
"acquire allocator failed"
,
K
(
ret
),
"micro_block_header"
,
*
header
,
"col_header"
,
col_header
[
i
]);
}
else
if
(
OB_FAIL
(
d
->
get_ref_col_idx
(
ref_col_idx
)))
{
...
...
src/storage/blocksstable/encoding/ob_micro_block_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -75,7 +75,6 @@ public:
class
ObIEncodeBlockReader
{
typedef
int
(
*
decode_acquire_func
)(
ObDecoderAllocator
&
allocator
,
const
ObObjMeta
&
obj_meta
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
...
...
@@ -98,8 +97,7 @@ protected:
int
add_decoder
(
const
int64_t
store_idx
,
const
common
::
ObObjMeta
&
obj_meta
,
ObColumnDecoder
&
dest
);
void
free_decoders
();
void
release
(
const
ObIColumnDecoder
*
decoder
);
int
acquire
(
const
common
::
ObObjMeta
&
obj_meta
,
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
);
int
acquire
(
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
);
int
setup_row
(
const
uint64_t
row_id
,
int64_t
&
row_len
,
const
char
*&
row_data
);
protected:
static
const
int64_t
DEFAULT_DECODER_CNT
=
16
;
...
...
@@ -134,11 +132,10 @@ protected:
static
ObColumnDecoderCtx
none_exist_column_decoder_ctx_
;
template
<
class
Decoder
>
static
int
acquire_decoder
(
ObDecoderAllocator
&
allocator
,
const
ObObjMeta
&
obj_meta
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
);
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
);
static
decode_acquire_func
acquire_funcs_
[
ObColumnHeader
::
MAX_TYPE
];
};
...
...
@@ -316,11 +313,13 @@ private:
const
char
*&
meta_data
,
const
char
*
block
,
const
int64_t
block_size
);
template
<
typename
Allocator
>
static
int
acquire
(
Allocator
&
allocator
,
const
common
::
ObObjMeta
&
obj_meta
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
);
int
acquire
(
const
common
::
ObObjMeta
&
obj_meta
,
int64_t
store_idx
,
static
int
acquire
(
Allocator
&
allocator
,
const
ObMicroBlockHeader
&
header
,
const
ObColumnHeader
&
col_header
,
const
char
*
meta_data
,
const
ObIColumnDecoder
*&
decoder
);
int
acquire
(
const
int64_t
store_idx
,
const
ObIColumnDecoder
*&
decoder
);
void
release
(
const
ObIColumnDecoder
*
decoder
);
private:
...
...
src/storage/blocksstable/encoding/ob_raw_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -355,14 +355,15 @@ int ObRawDecoder::batch_decode(
LOG_WARN
(
"Raw decoder not inited"
,
K
(
ret
));
}
else
if
(
fast_decode_valid
(
ctx
))
{
// Optimized decode for byte-packing data
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ctx
.
obj_meta_
.
get_type_class
()];
const
ObObjType
store_type
=
ctx
.
col_header_
->
get_store_obj_type
();
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ob_obj_type_class
(
store_type
)];
if
(
ctx
.
is_fix_length
())
{
const
ObObjDatumMapType
map_type
=
ObDatum
::
get_obj_datum_map_type
(
ctx
.
obj_meta_
.
get_type
()
);
const
ObObjDatumMapType
map_type
=
ObDatum
::
get_obj_datum_map_type
(
store_type
);
// Only need store_len for UIntSC/IntSC
uint32_t
store_len
=
ctx
.
col_header_
->
length_
>
8
?
0
:
ctx
.
col_header_
->
length_
;
raw_fix_batch_decode_func
decode_func
=
raw_fix_batch_decode_funcs
[
ObIntSC
==
store_class
&&
ctx
.
col_header_
->
length_
==
get_type_size_map
()[
ctx
.
obj_meta_
.
get_type
()
]]
&&
ctx
.
col_header_
->
length_
==
get_type_size_map
()[
store_type
]]
[
get_value_len_tag_map
()[
store_len
]]
[
get_value_len_tag_map
()[
get_datum_store_len
(
map_type
)]]
[
get_store_class_tag_map
()[
store_class
]];
...
...
@@ -396,7 +397,8 @@ bool ObRawDecoder::fast_decode_valid(const ObColumnDecoderCtx &ctx) const
bool
valid
=
false
;
const
ObColumnHeader
*
col_header
=
ctx
.
col_header_
;
const
ObMicroBlockHeader
*
block_header
=
ctx
.
micro_block_header_
;
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ctx
.
obj_meta_
.
get_type_class
()];
const
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
ob_obj_type_class
(
ctx
.
col_header_
->
get_store_obj_type
())];
if
(
col_header
->
is_fix_length
())
{
valid
=
!
col_header
->
is_bit_packing
()
&&
!
col_header
->
has_extend_value
()
...
...
@@ -452,7 +454,7 @@ int ObRawDecoder::batch_decode_general(
uint32_t
datum_len
=
0
;
uint64_t
value
=
0
;
if
(
OB_FAIL
(
get_uint_data_datum_len
(
ObDatum
::
get_obj_datum_map_type
(
ctx
.
obj_meta_
.
get
_type
()),
ObDatum
::
get_obj_datum_map_type
(
ctx
.
col_header_
->
get_store_obj
_type
()),
datum_len
)))
{
LOG_WARN
(
"Failed to get datum len for int data"
,
K
(
ret
));
}
...
...
@@ -498,7 +500,7 @@ int ObRawDecoder::batch_decode_general(
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
batch_load_data_to_datum
(
ctx
.
obj_meta_
.
get
_type
(),
ctx
.
col_header_
->
get_store_obj
_type
(),
cell_datas
,
row_cap
,
integer_mask_
,
...
...
@@ -612,7 +614,7 @@ bool ObRawDecoder::fast_filter_valid(
}
}
if
(
valid
)
{
switch
(
ctx
.
obj_meta_
.
get_type_class
(
))
{
switch
(
ob_obj_type_class
(
ctx
.
col_header_
->
get_store_obj_type
()
))
{
case
ObIntTC
:
case
ObDateTimeTC
:
case
ObDateTC
:
...
...
@@ -730,7 +732,7 @@ int ObRawDecoder::fast_comparison_operator(
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"Filter pushdown operator: Invalid argument"
,
K
(
ret
),
K
(
col_ctx
),
K
(
fix_len_tag
));
}
else
{
const
int64_t
type_store_size
=
get_type_size_map
()[
col_ctx
.
obj_meta_
.
get
_type
()];
const
int64_t
type_store_size
=
get_type_size_map
()[
col_ctx
.
col_header_
->
get_store_obj
_type
()];
const
uint64_t
node_value
=
filter
.
get_objs
().
at
(
0
).
v_
.
uint64_
;
const
sql
::
ObWhiteFilterOperatorType
&
op_type
=
filter
.
get_op_type
();
bool
exceed_stored_value_range
=
~
INTEGER_MASK_TABLE
[
col_ctx
.
col_header_
->
length_
]
...
...
src/storage/blocksstable/encoding/ob_raw_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -60,7 +60,7 @@ public:
:
store_class_
(
ObExtendSC
),
integer_mask_
(
0
),
meta_data_
(
nullptr
),
is_out_row_column_
(
false
)
{}
virtual
~
ObRawDecoder
()
{}
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -308,18 +308,18 @@ int ObRawDecoder::batch_locate_cell_data(
return
ret
;
}
OB_INLINE
int
ObRawDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObRawDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
UNUSED
(
micro_block_header
);
UNUSED
x
(
micro_block_header
);
int
ret
=
common
::
OB_SUCCESS
;
if
(
is_inited
())
{
ret
=
common
::
OB_INIT_TWICE
;
STORAGE_LOG
(
WARN
,
"init twice"
,
K
(
ret
));
}
else
{
const
ObObjType
store_type
=
column_header
.
is_out_row
()
?
ObVarcharType
:
obj_meta
.
get
_type
();
const
ObObjType
store_type
=
column_header
.
is_out_row
()
?
ObVarcharType
:
column_header
.
get_store_obj
_type
();
const
common
::
ObObjTypeClass
type_class
=
ob_obj_type_class
(
store_type
);
store_class_
=
get_store_class_map
()[
type_class
];
if
(
common
::
ObIntTC
==
type_class
)
{
...
...
src/storage/blocksstable/encoding/ob_rle_decoder.cpp
浏览文件 @
2c4284ca
...
...
@@ -91,7 +91,7 @@ int ObRLEDecoder::batch_decode(
}
else
if
(
OB_FAIL
(
extract_ref_and_null_count
(
row_ids
,
row_cap
,
datums
,
unused_null_cnt
)))
{
LOG_WARN
(
"Failed to extract refs"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
dict_decoder_
.
batch_decode_dict
(
ctx
.
obj_meta_
.
get
_type
(),
ctx
.
col_header_
->
get_store_obj
_type
(),
cell_datas
,
row_cap
,
ctx
.
col_header_
->
length_
-
meta_header_
->
offset_
,
...
...
src/storage/blocksstable/encoding/ob_rle_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -38,7 +38,7 @@ public:
}
virtual
~
ObRLEDecoder
()
{}
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
);
...
...
@@ -134,12 +134,12 @@ private:
ObDictDecoder
dict_decoder_
;
};
OB_INLINE
int
ObRLEDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObRLEDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
block_data
)
{
UNUSEDx
(
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
);
// performance critical, don't check params
int
ret
=
common
::
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
is_inited
()))
{
...
...
@@ -151,7 +151,7 @@ OB_INLINE int ObRLEDecoder::init(const common::ObObjMeta &obj_meta,
const
char
*
dict_meta_header
=
block_data
+
column_header
.
offset_
+
meta_header_
->
offset_
;
if
(
OB_FAIL
(
dict_decoder_
.
init
(
obj_meta
,
dict_meta_header
)))
{
if
(
OB_FAIL
(
dict_decoder_
.
init
(
column_header
.
get_store_obj_type
()
,
dict_meta_header
)))
{
STORAGE_LOG
(
WARN
,
"failed to init dict decoder"
,
K
(
ret
),
KP
(
dict_meta_header
));
meta_header_
=
NULL
;
}
else
{
...
...
src/storage/blocksstable/encoding/ob_string_diff_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -34,7 +34,7 @@ public:
ObStringDiffDecoder
();
virtual
~
ObStringDiffDecoder
();
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_metan
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -61,12 +61,12 @@ private:
const
ObStringDiffHeader
*
header_
;
};
OB_INLINE
int
ObStringDiffDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObStringDiffDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
UNUSEDx
(
obj_meta
,
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
,
column_header
);
// performance critical, don't check params, already checked upper layer
int
ret
=
common
::
OB_SUCCESS
;
if
(
is_inited
())
{
...
...
src/storage/blocksstable/encoding/ob_string_prefix_decoder.h
浏览文件 @
2c4284ca
...
...
@@ -35,7 +35,7 @@ public:
{}
virtual
~
ObStringPrefixDecoder
();
OB_INLINE
int
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
);
...
...
@@ -67,12 +67,12 @@ private:
const
char
*
meta_data_
;
};
OB_INLINE
int
ObStringPrefixDecoder
::
init
(
const
common
::
ObObjMeta
&
obj_meta
,
OB_INLINE
int
ObStringPrefixDecoder
::
init
(
const
ObMicroBlockHeader
&
micro_block_header
,
const
ObColumnHeader
&
column_header
,
const
char
*
meta
)
{
UNUSEDx
(
obj_meta
,
micro_block_header
,
column_header
);
UNUSEDx
(
micro_block_header
,
column_header
);
// performance critical, don't check params, already checked upper layer
int
ret
=
common
::
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
is_inited
()))
{
...
...
src/storage/blocksstable/ob_sstable_printer.cpp
浏览文件 @
2c4284ca
...
...
@@ -530,6 +530,7 @@ void ObSSTablePrinter::print_encoding_column_header(const ObColumnHeader *col_he
print_line
(
"is bit packing"
,
col_header
->
is_bit_packing
());
print_line
(
"is last var field"
,
col_header
->
is_last_var_field
());
print_line
(
"extend value index"
,
col_header
->
extend_value_index_
);
print_line
(
"store object type"
,
col_header
->
obj_type_
);
print_line
(
"offset"
,
col_header
->
offset_
);
print_line
(
"length"
,
col_header
->
length_
);
print_end_line
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录