Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
f56d98dc
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f56d98dc
编写于
3月 30, 2020
作者:
D
Daming
提交者:
GitHub
3月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BugFix]Escape '/' on InfluxDB query (#4589)
* Escape '/' on InfluxDB * fix checkstyle
上级
4474907f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
5 deletion
+5
-5
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/InfluxMetadataQueryDAO.java
...storage/plugin/influxdb/query/InfluxMetadataQueryDAO.java
+4
-4
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java
.../oap/server/storage/plugin/influxdb/query/TraceQuery.java
+1
-1
未找到文件。
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/InfluxMetadataQueryDAO.java
浏览文件 @
f56d98dc
...
@@ -46,6 +46,8 @@ import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.select;
...
@@ -46,6 +46,8 @@ import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.select;
*/
*/
public
class
InfluxMetadataQueryDAO
extends
H2MetadataQueryDAO
{
public
class
InfluxMetadataQueryDAO
extends
H2MetadataQueryDAO
{
private
InfluxClient
client
;
private
InfluxClient
client
;
// 'name' is InfluxDB keyword, so escapes it
private
static
final
String
ENDPOINT_NAME
=
'\"'
+
EndpointTraffic
.
NAME
+
'\"'
;
public
InfluxMetadataQueryDAO
(
final
InfluxClient
client
,
final
JDBCHikariCPClient
h2Client
,
public
InfluxMetadataQueryDAO
(
final
InfluxClient
client
,
final
JDBCHikariCPClient
h2Client
,
final
int
metadataQueryMaxSize
)
{
final
int
metadataQueryMaxSize
)
{
...
@@ -75,17 +77,15 @@ public class InfluxMetadataQueryDAO extends H2MetadataQueryDAO {
...
@@ -75,17 +77,15 @@ public class InfluxMetadataQueryDAO extends H2MetadataQueryDAO {
public
List
<
Endpoint
>
searchEndpoint
(
final
String
keyword
,
public
List
<
Endpoint
>
searchEndpoint
(
final
String
keyword
,
final
int
serviceId
,
final
int
serviceId
,
final
int
limit
)
throws
IOException
{
final
int
limit
)
throws
IOException
{
final
String
endpointName
=
'\"'
+
EndpointTraffic
.
NAME
+
'\"'
;
WhereQueryImpl
<
SelectQueryImpl
>
endpointQuery
=
select
()
WhereQueryImpl
<
SelectQueryImpl
>
endpointQuery
=
select
()
.
column
(
EndpointTraffic
.
SERVICE_ID
)
.
column
(
EndpointTraffic
.
SERVICE_ID
)
.
column
(
endpointName
)
.
column
(
ENDPOINT_NAME
)
.
column
(
EndpointTraffic
.
DETECT_POINT
)
.
column
(
EndpointTraffic
.
DETECT_POINT
)
.
from
(
client
.
getDatabase
(),
EndpointTraffic
.
INDEX_NAME
)
.
from
(
client
.
getDatabase
(),
EndpointTraffic
.
INDEX_NAME
)
.
where
();
.
where
();
endpointQuery
.
where
(
eq
(
MetricsDAO
.
TAG_ENDPOINT_OWNER_SERVICE
,
String
.
valueOf
(
serviceId
)));
endpointQuery
.
where
(
eq
(
MetricsDAO
.
TAG_ENDPOINT_OWNER_SERVICE
,
String
.
valueOf
(
serviceId
)));
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
if
(!
Strings
.
isNullOrEmpty
(
keyword
))
{
endpointQuery
.
where
(
contains
(
MetricsDAO
.
TAG_ENDPOINT_NAME
,
keyword
.
replaceAll
(
"/"
,
"
///
/"
)));
endpointQuery
.
where
(
contains
(
MetricsDAO
.
TAG_ENDPOINT_NAME
,
keyword
.
replaceAll
(
"/"
,
"
\\\\
/"
)));
}
}
endpointQuery
.
limit
(
limit
);
endpointQuery
.
limit
(
limit
);
...
...
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TraceQuery.java
浏览文件 @
f56d98dc
...
@@ -98,7 +98,7 @@ public class TraceQuery implements ITraceQueryDAO {
...
@@ -98,7 +98,7 @@ public class TraceQuery implements ITraceQueryDAO {
recallQuery
.
and
(
lte
(
SegmentRecord
.
LATENCY
,
maxDuration
));
recallQuery
.
and
(
lte
(
SegmentRecord
.
LATENCY
,
maxDuration
));
}
}
if
(!
Strings
.
isNullOrEmpty
(
endpointName
))
{
if
(!
Strings
.
isNullOrEmpty
(
endpointName
))
{
recallQuery
.
and
(
contains
(
SegmentRecord
.
ENDPOINT_NAME
,
endpointName
));
recallQuery
.
and
(
contains
(
SegmentRecord
.
ENDPOINT_NAME
,
endpointName
.
replaceAll
(
"/"
,
"\\\\/"
)
));
}
}
if
(
serviceId
!=
0
)
{
if
(
serviceId
!=
0
)
{
recallQuery
.
and
(
eq
(
RecordDAO
.
TAG_SERVICE_ID
,
String
.
valueOf
(
serviceId
)));
recallQuery
.
and
(
eq
(
RecordDAO
.
TAG_SERVICE_ID
,
String
.
valueOf
(
serviceId
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录