Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
a12e8bad
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
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,体验更适合开发者的 AI 搜索 >>
提交
a12e8bad
编写于
10月 17, 2018
作者:
彭
彭勇升 pengys
提交者:
wu-sheng
10月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide new getEndpointInfo service in query protocol. (#1780)
上级
b367c36d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
72 addition
and
6 deletion
+72
-6
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
...kywalking/oap/server/core/query/MetadataQueryService.java
+31
-1
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/Endpoint.java
...che/skywalking/oap/server/core/query/entity/Endpoint.java
+1
-1
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/EndpointInfo.java
...skywalking/oap/server/core/query/entity/EndpointInfo.java
+33
-0
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
.../skywalking/oap/query/graphql/resolver/MetadataQuery.java
+4
-0
oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol
...in/query-graphql-plugin/src/main/resources/query-protocol
+1
-1
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
...torage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
+2
-3
未找到文件。
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
浏览文件 @
a12e8bad
...
@@ -21,7 +21,10 @@ package org.apache.skywalking.oap.server.core.query;
...
@@ -21,7 +21,10 @@ package org.apache.skywalking.oap.server.core.query;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.skywalking.apm.network.language.agent.SpanLayer
;
import
org.apache.skywalking.apm.network.language.agent.SpanLayer
;
import
org.apache.skywalking.oap.server.core.CoreModule
;
import
org.apache.skywalking.oap.server.core.cache.*
;
import
org.apache.skywalking.oap.server.core.query.entity.*
;
import
org.apache.skywalking.oap.server.core.query.entity.*
;
import
org.apache.skywalking.oap.server.core.register.EndpointInventory
;
import
org.apache.skywalking.oap.server.core.storage.StorageModule
;
import
org.apache.skywalking.oap.server.core.storage.StorageModule
;
import
org.apache.skywalking.oap.server.core.storage.query.IMetadataQueryDAO
;
import
org.apache.skywalking.oap.server.core.storage.query.IMetadataQueryDAO
;
import
org.apache.skywalking.oap.server.library.module.ModuleManager
;
import
org.apache.skywalking.oap.server.library.module.ModuleManager
;
...
@@ -33,18 +36,34 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
...
@@ -33,18 +36,34 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
private
final
ModuleManager
moduleManager
;
private
final
ModuleManager
moduleManager
;
private
IMetadataQueryDAO
metadataQueryDAO
;
private
IMetadataQueryDAO
metadataQueryDAO
;
private
ServiceInventoryCache
serviceInventoryCache
;
private
EndpointInventoryCache
endpointInventoryCache
;
public
MetadataQueryService
(
ModuleManager
moduleManager
)
{
public
MetadataQueryService
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
this
.
moduleManager
=
moduleManager
;
}
}
p
ublic
IMetadataQueryDAO
getMetadataQueryDAO
()
{
p
rivate
IMetadataQueryDAO
getMetadataQueryDAO
()
{
if
(
metadataQueryDAO
==
null
)
{
if
(
metadataQueryDAO
==
null
)
{
metadataQueryDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IMetadataQueryDAO
.
class
);
metadataQueryDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IMetadataQueryDAO
.
class
);
}
}
return
metadataQueryDAO
;
return
metadataQueryDAO
;
}
}
private
ServiceInventoryCache
getServiceInventoryCache
()
{
if
(
serviceInventoryCache
==
null
)
{
serviceInventoryCache
=
moduleManager
.
find
(
CoreModule
.
NAME
).
getService
(
ServiceInventoryCache
.
class
);
}
return
serviceInventoryCache
;
}
private
EndpointInventoryCache
getEndpointInventoryCache
()
{
if
(
endpointInventoryCache
==
null
)
{
endpointInventoryCache
=
moduleManager
.
find
(
CoreModule
.
NAME
).
getService
(
EndpointInventoryCache
.
class
);
}
return
endpointInventoryCache
;
}
public
ClusterBrief
getGlobalBrief
(
final
long
startTimestamp
,
final
long
endTimestamp
)
throws
IOException
{
public
ClusterBrief
getGlobalBrief
(
final
long
startTimestamp
,
final
long
endTimestamp
)
throws
IOException
{
ClusterBrief
clusterBrief
=
new
ClusterBrief
();
ClusterBrief
clusterBrief
=
new
ClusterBrief
();
clusterBrief
.
setNumOfService
(
getMetadataQueryDAO
().
numOfService
(
startTimestamp
,
endTimestamp
));
clusterBrief
.
setNumOfService
(
getMetadataQueryDAO
().
numOfService
(
startTimestamp
,
endTimestamp
));
...
@@ -77,4 +96,15 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
...
@@ -77,4 +96,15 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
public
Service
searchService
(
final
String
serviceCode
)
throws
IOException
{
public
Service
searchService
(
final
String
serviceCode
)
throws
IOException
{
return
getMetadataQueryDAO
().
searchService
(
serviceCode
);
return
getMetadataQueryDAO
().
searchService
(
serviceCode
);
}
}
public
EndpointInfo
getEndpointInfo
(
final
int
endpointId
)
throws
IOException
{
EndpointInventory
endpointInventory
=
getEndpointInventoryCache
().
get
(
endpointId
);
EndpointInfo
endpointInfo
=
new
EndpointInfo
();
endpointInfo
.
setId
(
endpointInventory
.
getSequence
());
endpointInfo
.
setName
(
endpointInventory
.
getName
());
endpointInfo
.
setServiceId
(
endpointInventory
.
getServiceId
());
endpointInfo
.
setServiceName
(
getServiceInventoryCache
().
get
(
endpointInventory
.
getServiceId
()).
getName
());
return
endpointInfo
;
}
}
}
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/Endpoint.java
浏览文件 @
a12e8bad
...
@@ -26,6 +26,6 @@ import lombok.*;
...
@@ -26,6 +26,6 @@ import lombok.*;
@Getter
@Getter
@Setter
@Setter
public
class
Endpoint
{
public
class
Endpoint
{
private
String
id
;
private
int
id
;
private
String
name
;
private
String
name
;
}
}
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/EndpointInfo.java
0 → 100644
浏览文件 @
a12e8bad
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.oap.server.core.query.entity
;
import
lombok.*
;
/**
* @author peng-yongsheng
*/
@Getter
@Setter
public
class
EndpointInfo
{
private
int
id
;
private
String
name
;
private
int
serviceId
;
private
String
serviceName
;
}
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
浏览文件 @
a12e8bad
...
@@ -85,4 +85,8 @@ public class MetadataQuery implements GraphQLQueryResolver {
...
@@ -85,4 +85,8 @@ public class MetadataQuery implements GraphQLQueryResolver {
final
int
limit
)
throws
IOException
{
final
int
limit
)
throws
IOException
{
return
getMetadataQueryService
().
searchEndpoint
(
keyword
,
serviceId
,
limit
);
return
getMetadataQueryService
().
searchEndpoint
(
keyword
,
serviceId
,
limit
);
}
}
public
EndpointInfo
getEndpointInfo
(
final
int
endpointId
)
throws
IOException
{
return
getMetadataQueryService
().
getEndpointInfo
(
endpointId
);
}
}
}
query-protocol
@
1122e97b
比较
3a83be79
...
1122e97b
Subproject commit
3a83be79a9c23aad6576ed2a4a04b82de6d7a829
Subproject commit
1122e97b5604ae96447bd58ecdb248d7e02952aa
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
浏览文件 @
a12e8bad
...
@@ -25,8 +25,7 @@ import org.apache.skywalking.oap.server.core.register.*;
...
@@ -25,8 +25,7 @@ import org.apache.skywalking.oap.server.core.register.*;
import
org.apache.skywalking.oap.server.core.source.DetectPoint
;
import
org.apache.skywalking.oap.server.core.source.DetectPoint
;
import
org.apache.skywalking.oap.server.core.storage.query.IMetadataQueryDAO
;
import
org.apache.skywalking.oap.server.core.storage.query.IMetadataQueryDAO
;
import
org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.oap.server.library.util.BooleanUtils
;
import
org.apache.skywalking.oap.server.library.util.*
;
import
org.apache.skywalking.oap.server.library.util.StringUtils
;
import
org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base.*
;
import
org.apache.skywalking.oap.server.storage.plugin.elasticsearch.base.*
;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.SearchResponse
;
...
@@ -158,7 +157,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
...
@@ -158,7 +157,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
Map
<
String
,
Object
>
sourceAsMap
=
searchHit
.
getSourceAsMap
();
Map
<
String
,
Object
>
sourceAsMap
=
searchHit
.
getSourceAsMap
();
Endpoint
endpoint
=
new
Endpoint
();
Endpoint
endpoint
=
new
Endpoint
();
endpoint
.
setId
(
String
.
valueOf
(
sourceAsMap
.
get
(
EndpointInventory
.
SEQUENCE
)
));
endpoint
.
setId
(
((
Number
)
sourceAsMap
.
get
(
EndpointInventory
.
SEQUENCE
)).
intValue
(
));
endpoint
.
setName
((
String
)
sourceAsMap
.
get
(
EndpointInventory
.
NAME
));
endpoint
.
setName
((
String
)
sourceAsMap
.
get
(
EndpointInventory
.
NAME
));
endpoints
.
add
(
endpoint
);
endpoints
.
add
(
endpoint
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录