Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f07045c1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f07045c1
编写于
12月 11, 2021
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update fst search frame
上级
a9a06841
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
20 deletion
+29
-20
source/libs/index/inc/index_fst.h
source/libs/index/inc/index_fst.h
+19
-18
source/libs/index/inc/index_fst_automation.h
source/libs/index/inc/index_fst_automation.h
+1
-1
source/libs/index/src/index_fst.c
source/libs/index/src/index_fst.c
+8
-0
source/libs/index/src/index_fst_automation.c
source/libs/index/src/index_fst_automation.c
+1
-1
未找到文件。
source/libs/index/inc/index_fst.h
浏览文件 @
f07045c1
...
@@ -26,10 +26,24 @@ extern "C" {
...
@@ -26,10 +26,24 @@ extern "C" {
#include "index_fst_counting_writer.h"
#include "index_fst_counting_writer.h"
#include "index_fst_automation.h"
#include "index_fst_automation.h"
#define OUTPUT_PREFIX(a, b) ((a) > (b) ? (b) : (a)
typedef
struct
Fst
Fst
;
typedef
struct
FstNode
FstNode
;
typedef
struct
FstNode
FstNode
;
#define OUTPUT_PREFIX(a, b) ((a) > (b) ? (b) : (a)
typedef
enum
{
Included
,
Excluded
,
Unbounded
}
FstBound
;
typedef
struct
FstBoundWithData
{
FstSlice
data
;
FstBound
type
;
}
FstBoundWithData
;
typedef
struct
FstStreamBuilder
{
Fst
*
fst
;
AutomationCtx
*
aut
;
FstBoundWithData
*
min
;
FstBoundWithData
*
max
;
}
FstStreamBuilder
,
FstStreamWithStateBuilder
;
typedef
struct
FstRange
{
typedef
struct
FstRange
{
uint64_t
start
;
uint64_t
start
;
...
@@ -39,16 +53,9 @@ typedef struct FstRange {
...
@@ -39,16 +53,9 @@ typedef struct FstRange {
typedef
enum
{
GE
,
GT
,
LE
,
LT
}
RangeType
;
typedef
enum
{
GE
,
GT
,
LE
,
LT
}
RangeType
;
typedef
enum
{
OneTransNext
,
OneTrans
,
AnyTrans
,
EmptyFinal
}
State
;
typedef
enum
{
OneTransNext
,
OneTrans
,
AnyTrans
,
EmptyFinal
}
State
;
typedef
enum
{
Ordered
,
OutOfOrdered
,
DuplicateKey
}
OrderType
;
typedef
enum
{
Ordered
,
OutOfOrdered
,
DuplicateKey
}
OrderType
;
typedef
enum
{
Included
,
Excluded
,
Unbounded
}
FstBound
;
typedef
struct
FstBoundWithData
{
FstSlice
data
;
FstBound
type
;
}
FstBoundWithData
;
FstBoundWithData
*
fstBoundStateCreate
(
FstBound
type
,
FstSlice
*
data
);
FstBoundWithData
*
fstBoundStateCreate
(
FstBound
type
,
FstSlice
*
data
);
bool
fstBoundWithDataExceededBy
(
FstBoundWithData
*
bound
,
FstSlice
*
slice
);
bool
fstBoundWithDataExceededBy
(
FstBoundWithData
*
bound
,
FstSlice
*
slice
);
bool
fstBoundWithDataIsEmpty
(
FstBoundWithData
*
bound
);
bool
fstBoundWithDataIsEmpty
(
FstBoundWithData
*
bound
);
...
@@ -60,8 +67,6 @@ typedef struct FstOutput {
...
@@ -60,8 +67,6 @@ typedef struct FstOutput {
Output
out
;
Output
out
;
}
FstOutput
;
}
FstOutput
;
/*
/*
*
*
* UnFinished node and helper function
* UnFinished node and helper function
...
@@ -275,6 +280,8 @@ FstNode* fstGetRoot(Fst *fst);
...
@@ -275,6 +280,8 @@ FstNode* fstGetRoot(Fst *fst);
FstType
fstGetType
(
Fst
*
fst
);
FstType
fstGetType
(
Fst
*
fst
);
CompiledAddr
fstGetRootAddr
(
Fst
*
fst
);
CompiledAddr
fstGetRootAddr
(
Fst
*
fst
);
Output
fstEmptyFinalOutput
(
Fst
*
fst
,
bool
*
null
);
Output
fstEmptyFinalOutput
(
Fst
*
fst
,
bool
*
null
);
FstStreamBuilder
*
fstSearch
(
Fst
*
fst
,
AutomationCtx
*
ctx
);
FstStreamWithStateBuilder
*
fstSearchWithState
(
Fst
*
fst
,
AutomationCtx
*
ctx
);
bool
fstVerify
(
Fst
*
fst
);
bool
fstVerify
(
Fst
*
fst
);
...
@@ -298,7 +305,7 @@ typedef struct StreamWithState {
...
@@ -298,7 +305,7 @@ typedef struct StreamWithState {
FstOutput
emptyOutput
;
FstOutput
emptyOutput
;
SArray
*
stack
;
// <StreamState>
SArray
*
stack
;
// <StreamState>
FstBoundWithData
*
endAt
;
FstBoundWithData
*
endAt
;
}
StreamWithState
;
}
StreamWithState
;
typedef
struct
StreamWithStateResult
{
typedef
struct
StreamWithStateResult
{
FstSlice
data
;
FstSlice
data
;
...
@@ -314,14 +321,8 @@ typedef void* (*StreamCallback)(void *);
...
@@ -314,14 +321,8 @@ typedef void* (*StreamCallback)(void *);
StreamWithState
*
streamWithStateCreate
(
Fst
*
fst
,
AutomationCtx
*
automation
,
FstBoundWithData
*
min
,
FstBoundWithData
*
max
)
;
StreamWithState
*
streamWithStateCreate
(
Fst
*
fst
,
AutomationCtx
*
automation
,
FstBoundWithData
*
min
,
FstBoundWithData
*
max
)
;
void
streamWithStateDestroy
(
StreamWithState
*
sws
);
void
streamWithStateDestroy
(
StreamWithState
*
sws
);
bool
streamWithStateSeekMin
(
StreamWithState
*
sws
,
FstBoundWithData
*
min
);
bool
streamWithStateSeekMin
(
StreamWithState
*
sws
,
FstBoundWithData
*
min
);
StreamWithStateResult
*
streamWithStateNextWith
(
StreamWithState
*
sws
,
StreamCallback
callback
);
typedef
struct
FstStreamBuilder
{
StreamWithStateResult
*
streamWithStateNextWith
(
StreamWithState
*
sws
,
StreamCallback
callback
);
Fst
*
fst
;
AutomationCtx
*
aut
;
FstBoundWithData
*
min
;
FstBoundWithData
*
max
;
}
FstStreamBuilder
;
FstStreamBuilder
*
fstStreamBuilderCreate
(
Fst
*
fst
,
AutomationCtx
*
aut
);
FstStreamBuilder
*
fstStreamBuilderCreate
(
Fst
*
fst
,
AutomationCtx
*
aut
);
// set up bound range
// set up bound range
...
...
source/libs/index/inc/index_fst_automation.h
浏览文件 @
f07045c1
...
@@ -50,7 +50,7 @@ typedef struct AutomationFunc {
...
@@ -50,7 +50,7 @@ typedef struct AutomationFunc {
}
AutomationFunc
;
}
AutomationFunc
;
AutomationCtx
*
automCtxCreate
(
void
*
data
,
AutomationType
type
);
AutomationCtx
*
automCtxCreate
(
void
*
data
,
AutomationType
type
);
void
autoCtxDestroy
(
AutomationCtx
*
ctx
);
void
auto
m
CtxDestroy
(
AutomationCtx
*
ctx
);
extern
AutomationFunc
automFuncs
[];
extern
AutomationFunc
automFuncs
[];
#ifdef __cplusplus
#ifdef __cplusplus
...
...
source/libs/index/src/index_fst.c
浏览文件 @
f07045c1
...
@@ -1090,6 +1090,12 @@ bool fstGet(Fst *fst, FstSlice *b, Output *out) {
...
@@ -1090,6 +1090,12 @@ bool fstGet(Fst *fst, FstSlice *b, Output *out) {
return
true
;
return
true
;
}
}
FstStreamBuilder
*
fstSearch
(
Fst
*
fst
,
AutomationCtx
*
ctx
)
{
return
fstStreamBuilderCreate
(
fst
,
ctx
);
}
FstStreamWithStateBuilder
*
fstSearchWithState
(
Fst
*
fst
,
AutomationCtx
*
ctx
)
{
return
fstStreamBuilderCreate
(
fst
,
ctx
);
}
FstNode
*
fstGetRoot
(
Fst
*
fst
)
{
FstNode
*
fstGetRoot
(
Fst
*
fst
)
{
if
(
fst
->
root
!=
NULL
)
{
if
(
fst
->
root
!=
NULL
)
{
...
@@ -1440,3 +1446,5 @@ FstStreamBuilder *fstStreamBuilderRange(FstStreamBuilder *b, FstSlice *val, Rang
...
@@ -1440,3 +1446,5 @@ FstStreamBuilder *fstStreamBuilderRange(FstStreamBuilder *b, FstSlice *val, Rang
source/libs/index/src/index_fst_automation.c
浏览文件 @
f07045c1
...
@@ -92,6 +92,6 @@ AutomationCtx* automCtxCreate(void *data, AutomationType type) {
...
@@ -92,6 +92,6 @@ AutomationCtx* automCtxCreate(void *data, AutomationType type) {
}
}
return
ctx
;
return
ctx
;
}
}
void
autoCtxDestroy
(
AutomationCtx
*
ctx
)
{
void
auto
m
CtxDestroy
(
AutomationCtx
*
ctx
)
{
free
(
ctx
);
free
(
ctx
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录