From f5319f7ce3f14bd67f3a2ead2561903692be4653 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Sat, 30 Jan 2016 17:05:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=EF=BC=8C=E5=8F=AF=E8=83=BD=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reciever/buffer/DataBufferThreadContainer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/skywalking-server/src/main/java/com/ai/cloud/skywalking/reciever/buffer/DataBufferThreadContainer.java b/skywalking-server/src/main/java/com/ai/cloud/skywalking/reciever/buffer/DataBufferThreadContainer.java index 34f988dda..8e25666d2 100644 --- a/skywalking-server/src/main/java/com/ai/cloud/skywalking/reciever/buffer/DataBufferThreadContainer.java +++ b/skywalking-server/src/main/java/com/ai/cloud/skywalking/reciever/buffer/DataBufferThreadContainer.java @@ -1,6 +1,7 @@ package com.ai.cloud.skywalking.reciever.buffer; import com.ai.cloud.skywalking.reciever.conf.Config; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.comparator.NameFileComparator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -31,6 +32,10 @@ public class DataBufferThreadContainer { public static void init() { logger.info("Add EOF flags to the unprocessed data file last time."); File parentDir = new File(Config.Buffer.DATA_BUFFER_FILE_PARENT_DIRECTORY); + // 判断数据缓存文件是否存在,如果不存在,则创建 + if (!parentDir.exists()) { + parentDir.mkdirs(); + } NameFileComparator sizeComparator = new NameFileComparator(); File[] dataFileList = sizeComparator.sort(parentDir.listFiles()); logger.info("Pending file number :" + dataFileList.length);