Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
293981f2
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
293981f2
编写于
12月 06, 2016
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move NetUtils for refaction.
上级
5e594483
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
15 deletion
+17
-15
skywalking-commons/skywalking-registry/src/main/java/com/a/eye/skywalking/registry/assist/NetUtils.java
...n/java/com/a/eye/skywalking/registry/assist/NetUtils.java
+1
-6
skywalking-storage-center/data/file/2016_12_06_16_55_18_667_1000
...ing-storage-center/data/file/2016_12_06_16_55_18_667_1000
+1
-0
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java
...rage/src/main/java/com/a/eye/skywalking/storage/Main.java
+2
-2
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/boot/ElasticBootstrap.java
...a/com/a/eye/skywalking/storage/boot/ElasticBootstrap.java
+8
-1
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/data/index/IndexOperatorFactory.java
...e/skywalking/storage/data/index/IndexOperatorFactory.java
+3
-2
skywalking-storage-center/skywalking-storage/src/test/java/StorageThread.java
...enter/skywalking-storage/src/test/java/StorageThread.java
+1
-3
skywalking-storage-center/skywalking-storage/src/test/java/com/a/eye/skywalking/storage/data/index/IndexOperatorTest.java
.../eye/skywalking/storage/data/index/IndexOperatorTest.java
+1
-1
未找到文件。
skywalking-
storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/util
/NetUtils.java
→
skywalking-
commons/skywalking-registry/src/main/java/com/a/eye/skywalking/registry/assist
/NetUtils.java
浏览文件 @
293981f2
package
com.a.eye.skywalking.
storage.util
;
package
com.a.eye.skywalking.
registry.assist
;
import
com.a.eye.skywalking.logging.api.ILog
;
import
com.a.eye.skywalking.logging.api.LogManager
;
import
com.a.eye.skywalking.storage.config.Config
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
...
...
@@ -71,8 +70,4 @@ public class NetUtils {
// 不能是0.0.0.0 也不能是127.0.0.1 并且还得符合IP的正则
return
(
name
!=
null
&&
!
ANYHOST
.
equals
(
name
)
&&
!
LOCALHOST
.
equals
(
name
)
&&
IP_PATTERN
.
matcher
(
name
).
matches
());
}
public
static
int
getIndexServerPort
(){
return
Config
.
Server
.
PORT
+
1000
;
}
}
skywalking-storage-center/data/file/2016_12_06_16_55_18_667_1000
0 → 100644
浏览文件 @
293981f2
JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1JappR1
\ No newline at end of file
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/Main.java
浏览文件 @
293981f2
...
...
@@ -16,7 +16,7 @@ import com.a.eye.skywalking.storage.data.file.DataFilesManager;
import
com.a.eye.skywalking.storage.data.index.IndexOperatorFactory
;
import
com.a.eye.skywalking.storage.listener.SearchListener
;
import
com.a.eye.skywalking.storage.listener.StorageListener
;
import
com.a.eye.skywalking.
storage.util
.NetUtils
;
import
com.a.eye.skywalking.
registry.assist
.NetUtils
;
import
java.io.IOException
;
import
java.util.Map
;
...
...
@@ -43,7 +43,7 @@ public class Main {
initConfig
();
HealthCollector
.
init
(
SERVER_REPORTER_NAME
);
new
ElasticBootstrap
().
boot
(
NetUtils
.
getIndexServerPort
()
);
new
ElasticBootstrap
().
boot
();
IndexOperatorFactory
.
initOperatorPool
();
DataFilesManager
.
init
();
...
...
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/boot/ElasticBootstrap.java
浏览文件 @
293981f2
...
...
@@ -2,6 +2,7 @@ package com.a.eye.skywalking.storage.boot;
import
com.a.eye.skywalking.logging.api.ILog
;
import
com.a.eye.skywalking.logging.api.LogManager
;
import
com.a.eye.skywalking.storage.config.Config
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -22,7 +23,8 @@ public class ElasticBootstrap {
this
.
elasticHome
=
fetchElasticHome
();
}
public
void
boot
(
int
port
)
throws
IOException
{
public
void
boot
()
throws
IOException
{
int
port
=
getIndexServerPort
();
ElasticConfigModifier
modifier
=
new
ElasticConfigModifier
(
elasticHome
);
modifier
.
replaceConfig
(
port
);
...
...
@@ -48,4 +50,9 @@ public class ElasticBootstrap {
public
String
fetchElasticHome
()
{
return
System
.
getProperty
(
DATA_INDEX_HOME
,
DEVELOP_RUNTIME_ELASTIC_HOME
);
}
public
static
int
getIndexServerPort
(){
return
Config
.
Server
.
PORT
+
1000
;
}
}
skywalking-storage-center/skywalking-storage/src/main/java/com/a/eye/skywalking/storage/data/index/IndexOperatorFactory.java
浏览文件 @
293981f2
package
com.a.eye.skywalking.storage.data.index
;
import
com.a.eye.skywalking.storage.boot.ElasticBootstrap
;
import
com.a.eye.skywalking.storage.config.Config
;
import
com.a.eye.skywalking.storage.data.exception.BorrowIndexOperatorFromPoolFailedException
;
import
com.a.eye.skywalking.storage.data.exception.IndexOperatorInitializeFailedException
;
import
com.a.eye.skywalking.
storage.util
.NetUtils
;
import
com.a.eye.skywalking.
registry.assist
.NetUtils
;
import
org.apache.commons.pool2.impl.GenericObjectPoolConfig
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.transport.InetSocketTransportAddress
;
...
...
@@ -18,7 +19,7 @@ public class IndexOperatorFactory {
public
static
IndexOperator
createIndexOperator
()
{
try
{
return
new
IndexOperator
(
new
PreBuiltTransportClient
(
Settings
.
EMPTY
).
addTransportAddress
(
new
InetSocketTransportAddress
(
InetAddress
.
getLoopbackAddress
(),
NetUtils
.
getIndexServerPort
()
new
InetSocketTransportAddress
(
InetAddress
.
getLoopbackAddress
(),
ElasticBootstrap
.
getIndexServerPort
()
)));
}
catch
(
Exception
e
)
{
throw
new
IndexOperatorInitializeFailedException
(
"Failed to initialize operator."
,
e
);
...
...
skywalking-storage-center/skywalking-storage/src/test/java/StorageThread.java
浏览文件 @
293981f2
import
com.a.eye.skywalking.network.Client
;
import
com.a.eye.skywalking.network.grpc.AckSpan
;
import
com.a.eye.skywalking.network.grpc.RequestSpan
;
import
com.a.eye.skywalking.network.grpc.SendResult
;
import
com.a.eye.skywalking.network.grpc.TraceId
;
import
com.a.eye.skywalking.network.grpc.client.SpanStorageClient
;
import
com.a.eye.skywalking.network.listener.client.StorageClientListener
;
import
com.a.eye.skywalking.
storage.util
.NetUtils
;
import
com.a.eye.skywalking.
registry.assist
.NetUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.locks.LockSupport
;
public
class
StorageThread
extends
Thread
{
...
...
skywalking-storage-center/skywalking-storage/src/test/java/com/a/eye/skywalking/storage/data/index/IndexOperatorTest.java
浏览文件 @
293981f2
...
...
@@ -4,7 +4,7 @@ import com.a.eye.skywalking.network.grpc.RequestSpan;
import
com.a.eye.skywalking.network.grpc.TraceId
;
import
com.a.eye.skywalking.storage.data.file.DataFileNameDesc
;
import
com.a.eye.skywalking.storage.data.spandata.RequestSpanData
;
import
com.a.eye.skywalking.
storage.util
.NetUtils
;
import
com.a.eye.skywalking.
registry.assist
.NetUtils
;
import
org.elasticsearch.client.transport.TransportClient
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.transport.InetSocketTransportAddress
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录