Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
89d79012
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,发现更多精彩内容 >>
提交
89d79012
编写于
5月 04, 2018
作者:
彭
彭勇升 pengys
提交者:
wu-sheng
5月 04, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1162 (#1163)
Delete buffer directory when collector restart.
上级
5f302288
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
10 deletion
+35
-10
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
...plication/component/ApplicationComponentSpanListener.java
+1
-1
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleConfig.java
...nt/parser/provider/AnalysisSegmentParserModuleConfig.java
+9
-0
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/BufferFileConfig.java
...ysis/segment/parser/provider/buffer/BufferFileConfig.java
+3
-0
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferManager.java
.../segment/parser/provider/buffer/SegmentBufferManager.java
+21
-9
apm-collector/apm-collector-boot/src/main/resources/application.yml
...tor/apm-collector-boot/src/main/resources/application.yml
+1
-0
未找到文件。
apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java
浏览文件 @
89d79012
...
...
@@ -43,7 +43,7 @@ public class ApplicationComponentSpanListener implements EntrySpanListener, Exit
}
@Override
public
boolean
containsPoint
(
Point
point
)
{
return
Point
.
Entry
.
equals
(
point
)
||
Point
.
Exit
.
equals
(
point
)
||
Point
.
First
.
equals
(
point
)
;
return
Point
.
Entry
.
equals
(
point
)
||
Point
.
Exit
.
equals
(
point
);
}
@Override
...
...
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleConfig.java
浏览文件 @
89d79012
...
...
@@ -28,6 +28,7 @@ public class AnalysisSegmentParserModuleConfig extends ModuleConfig {
private
String
bufferFilePath
;
private
String
bufferOffsetMaxFileSize
;
private
String
bufferSegmentMaxFileSize
;
private
boolean
bufferFileCleanWhenRestart
;
public
String
getBufferFilePath
()
{
return
bufferFilePath
;
...
...
@@ -52,4 +53,12 @@ public class AnalysisSegmentParserModuleConfig extends ModuleConfig {
public
void
setBufferSegmentMaxFileSize
(
String
bufferSegmentMaxFileSize
)
{
this
.
bufferSegmentMaxFileSize
=
bufferSegmentMaxFileSize
;
}
public
boolean
isBufferFileCleanWhenRestart
()
{
return
bufferFileCleanWhenRestart
;
}
public
void
setBufferFileCleanWhenRestart
(
boolean
bufferFileCleanWhenRestart
)
{
this
.
bufferFileCleanWhenRestart
=
bufferFileCleanWhenRestart
;
}
}
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/BufferFileConfig.java
浏览文件 @
89d79012
...
...
@@ -28,6 +28,7 @@ public class BufferFileConfig {
static
int
BUFFER_OFFSET_MAX_FILE_SIZE
=
10
*
1024
*
1024
;
static
int
BUFFER_SEGMENT_MAX_FILE_SIZE
=
10
*
1024
*
1024
;
static
String
BUFFER_PATH
=
"../buffer/"
;
static
boolean
BUFFER_FILE_CLEAN_WHEN_RESTART
=
false
;
public
static
class
Parser
{
...
...
@@ -77,6 +78,8 @@ public class BufferFileConfig {
}
else
{
BUFFER_SEGMENT_MAX_FILE_SIZE
=
1024
*
1024
;
}
BUFFER_FILE_CLEAN_WHEN_RESTART
=
config
.
isBufferFileCleanWhenRestart
();
}
}
}
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferManager.java
浏览文件 @
89d79012
...
...
@@ -18,16 +18,11 @@
package
org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.*
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.core.util.StringUtils
;
import
org.apache.skywalking.apm.collector.core.util.TimeBucketUtils
;
import
org.apache.skywalking.apm.collector.core.util.*
;
import
org.apache.skywalking.apm.network.proto.UpstreamSegment
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.*
;
/**
* @author peng-yongsheng
...
...
@@ -46,6 +41,9 @@ public enum SegmentBufferManager {
OffsetManager
.
INSTANCE
.
initialize
();
if
(
new
File
(
BufferFileConfig
.
BUFFER_PATH
).
mkdirs
())
{
newDataFile
();
}
else
if
(
BufferFileConfig
.
BUFFER_FILE_CLEAN_WHEN_RESTART
)
{
deleteFiles
();
newDataFile
();
}
else
{
String
writeFileName
=
OffsetManager
.
INSTANCE
.
getWriteFileName
();
if
(
StringUtils
.
isNotEmpty
(
writeFileName
))
{
...
...
@@ -84,7 +82,11 @@ public enum SegmentBufferManager {
String
timeBucket
=
String
.
valueOf
(
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
System
.
currentTimeMillis
()));
String
writeFileName
=
DATA_FILE_PREFIX
+
"_"
+
timeBucket
+
"."
+
Const
.
FILE_SUFFIX
;
File
dataFile
=
new
File
(
BufferFileConfig
.
BUFFER_PATH
+
writeFileName
);
dataFile
.
createNewFile
();
boolean
created
=
dataFile
.
createNewFile
();
if
(!
created
)
{
logger
.
info
(
"The file named {} already exists."
,
writeFileName
);
}
OffsetManager
.
INSTANCE
.
setWriteOffset
(
writeFileName
,
0
);
try
{
if
(
outputStream
!=
null
)
{
...
...
@@ -97,6 +99,16 @@ public enum SegmentBufferManager {
}
}
private
void
deleteFiles
()
{
File
bufferDirectory
=
new
File
(
BufferFileConfig
.
BUFFER_PATH
);
boolean
delete
=
bufferDirectory
.
delete
();
if
(
delete
)
{
logger
.
info
(
"Buffer directory is successfully deleted"
);
}
else
{
logger
.
info
(
"Buffer directory is not deleted"
);
}
}
public
synchronized
void
flush
()
{
}
}
apm-collector/apm-collector-boot/src/main/resources/application.yml
浏览文件 @
89d79012
...
...
@@ -54,6 +54,7 @@ analysis_segment_parser:
bufferFilePath
:
../buffer/
bufferOffsetMaxFileSize
:
10M
bufferSegmentMaxFileSize
:
500M
bufferFileCleanWhenRestart
:
true
ui
:
jetty
:
host
:
localhost
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录