Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
d688c1b5
I
Iotdb
项目概览
apache
/
Iotdb
12 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d688c1b5
编写于
12月 19, 2019
作者:
J
Jiang Tian
提交者:
Jialin Qiao
12月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
divide queryId generation into data query and non-data query (#666)
上级
679c8fb2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
19 deletion
+21
-19
server/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java
...g/apache/iotdb/db/query/control/QueryResourceManager.java
+4
-2
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
.../main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+5
-5
server/src/test/java/org/apache/iotdb/db/integration/IoTDBSequenceDataQueryIT.java
...apache/iotdb/db/integration/IoTDBSequenceDataQueryIT.java
+3
-3
server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
.../org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
+4
-4
server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
...test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+1
-1
session/src/test/java/org/apache/iotdb/session/utils/EnvironmentUtils.java
...java/org/apache/iotdb/session/utils/EnvironmentUtils.java
+2
-2
spark-iotdb-connector/src/test/scala/org/apache/iotdb/spark/db/EnvironmentUtils.java
...est/scala/org/apache/iotdb/spark/db/EnvironmentUtils.java
+2
-2
未找到文件。
server/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java
浏览文件 @
d688c1b5
...
...
@@ -64,9 +64,11 @@ public class QueryResourceManager {
* Register a new query. When a query request is created firstly, this method must
* be invoked.
*/
public
long
assignQueryId
()
{
public
long
assignQueryId
(
boolean
isDataQuery
)
{
long
queryId
=
queryIdAtom
.
incrementAndGet
();
filePathsManager
.
addQueryId
(
queryId
);
if
(
isDataQuery
)
{
filePathsManager
.
addQueryId
(
queryId
);
}
return
queryId
;
}
...
...
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
浏览文件 @
d688c1b5
...
...
@@ -639,7 +639,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
}
// else default ignoreTimeStamp is false
resp
.
setOperationType
(
plan
.
getOperatorType
().
toString
());
// generate the queryId for the operation
long
queryId
=
generateQueryId
();
long
queryId
=
generateQueryId
(
true
);
// put it into the corresponding Set
statementId2QueryId
.
computeIfAbsent
(
statementId
,
k
->
new
HashSet
<>()).
add
(
queryId
);
...
...
@@ -905,7 +905,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
status
=
executePlan
(
plan
);
TSExecuteStatementResp
resp
=
getTSExecuteStatementResp
(
status
);
long
queryId
=
generateQueryId
();
long
queryId
=
generateQueryId
(
false
);
resp
.
setQueryId
(
queryId
);
return
resp
;
}
...
...
@@ -1039,7 +1039,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
plan
=
(
InsertPlan
)
queryId2Plan
.
get
(
req
.
getQueryId
());
queryId
=
req
.
getQueryId
();
}
else
{
queryId
=
generateQueryId
();
queryId
=
generateQueryId
(
false
);
plan
=
new
InsertPlan
();
queryId2Plan
.
put
(
queryId
,
plan
);
}
...
...
@@ -1313,8 +1313,8 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
:
getStatus
(
TSStatusCode
.
EXECUTE_STATEMENT_ERROR
);
}
private
long
generateQueryId
()
{
return
QueryResourceManager
.
getInstance
().
assignQueryId
();
private
long
generateQueryId
(
boolean
isDataQuery
)
{
return
QueryResourceManager
.
getInstance
().
assignQueryId
(
isDataQuery
);
}
}
server/src/test/java/org/apache/iotdb/db/integration/IoTDBSequenceDataQueryIT.java
浏览文件 @
d688c1b5
...
...
@@ -175,7 +175,7 @@ public class IoTDBSequenceDataQueryIT {
queryExpression
.
addSelectedPath
(
new
Path
(
Constant
.
d1s1
));
queryExpression
.
setExpression
(
null
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
@@ -200,7 +200,7 @@ public class IoTDBSequenceDataQueryIT {
GlobalTimeExpression
globalTimeExpression
=
new
GlobalTimeExpression
(
TimeFilter
.
gtEq
(
800L
));
queryExpression
.
setExpression
(
globalTimeExpression
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
@@ -236,7 +236,7 @@ public class IoTDBSequenceDataQueryIT {
ValueFilter
.
gtEq
(
14
));
queryExpression
.
setExpression
(
singleSeriesExpression
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
server/src/test/java/org/apache/iotdb/db/integration/IoTDBSeriesReaderIT.java
浏览文件 @
d688c1b5
...
...
@@ -246,7 +246,7 @@ public class IoTDBSeriesReaderIT {
queryExpression
.
addSelectedPath
(
new
Path
(
Constant
.
d1s1
));
queryExpression
.
setExpression
(
null
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
@@ -274,7 +274,7 @@ public class IoTDBSeriesReaderIT {
ValueFilter
.
gtEq
(
20
));
queryExpression
.
setExpression
(
singleSeriesExpression
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
@@ -302,7 +302,7 @@ public class IoTDBSeriesReaderIT {
SingleSeriesExpression
expression
=
new
SingleSeriesExpression
(
path
,
TimeFilter
.
gt
(
22987L
));
queryExpression
.
setExpression
(
expression
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
@@ -331,7 +331,7 @@ public class IoTDBSeriesReaderIT {
ValueFilter
.
lt
(
111
));
queryExpression
.
setExpression
(
singleSeriesExpression
);
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
QueryDataSet
queryDataSet
=
engineExecutor
.
query
(
queryExpression
,
TEST_QUERY_CONTEXT
);
...
...
server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
浏览文件 @
d688c1b5
...
...
@@ -164,7 +164,7 @@ public class EnvironmentUtils {
MultiFileLogNodeManager
.
getInstance
().
start
();
FlushManager
.
getInstance
().
start
();
MergeManager
.
getINSTANCE
().
start
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
}
...
...
session/src/test/java/org/apache/iotdb/session/utils/EnvironmentUtils.java
浏览文件 @
d688c1b5
...
...
@@ -58,7 +58,7 @@ public class EnvironmentUtils {
private
static
IoTDBConfig
config
=
IoTDBDescriptor
.
getInstance
().
getConfig
();
private
static
DirectoryManager
directoryManager
=
DirectoryManager
.
getInstance
();
private
static
long
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
private
static
long
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
private
static
QueryContext
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
private
static
long
oldTsFileThreshold
=
config
.
getTsFileSizeThreshold
();
...
...
@@ -160,7 +160,7 @@ public class EnvironmentUtils {
StorageEngine
.
getInstance
().
reset
();
MultiFileLogNodeManager
.
getInstance
().
start
();
FlushManager
.
getInstance
().
start
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
}
...
...
spark-iotdb-connector/src/test/scala/org/apache/iotdb/spark/db/EnvironmentUtils.java
浏览文件 @
d688c1b5
...
...
@@ -93,7 +93,7 @@ public class EnvironmentUtils {
private
static
IoTDBConfig
config
=
IoTDBDescriptor
.
getInstance
().
getConfig
();
private
static
DirectoryManager
directoryManager
=
DirectoryManager
.
getInstance
();
public
static
long
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
public
static
long
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
public
static
QueryContext
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
private
static
long
oldTsFileThreshold
=
config
.
getTsFileSizeThreshold
();
...
...
@@ -195,7 +195,7 @@ public class EnvironmentUtils {
StorageEngine
.
getInstance
().
reset
();
MultiFileLogNodeManager
.
getInstance
().
start
();
FlushManager
.
getInstance
().
start
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
();
TEST_QUERY_JOB_ID
=
QueryResourceManager
.
getInstance
().
assignQueryId
(
true
);
TEST_QUERY_CONTEXT
=
new
QueryContext
(
TEST_QUERY_JOB_ID
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录