You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/07/06 13:33:09 UTC
[kylin] branch master updated: KYLIN-3428 too large dict file cause
OOM
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new 59354ac KYLIN-3428 too large dict file cause OOM
59354ac is described below
commit 59354acced7fdb35e0325fb7a8ea2e8c862f658c
Author: yangcao <yc...@aliyun.com>
AuthorDate: Fri Jul 6 16:39:19 2018 +0800
KYLIN-3428 too large dict file cause OOM
Signed-off-by: shaofengshi <sh...@apache.org>
---
.../apache/kylin/common/persistence/FileResourceStore.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/core-common/src/main/java/org/apache/kylin/common/persistence/FileResourceStore.java b/core-common/src/main/java/org/apache/kylin/common/persistence/FileResourceStore.java
index 7c6c506..7f03b2d 100644
--- a/core-common/src/main/java/org/apache/kylin/common/persistence/FileResourceStore.java
+++ b/core-common/src/main/java/org/apache/kylin/common/persistence/FileResourceStore.java
@@ -19,7 +19,6 @@
package org.apache.kylin.common.persistence;
import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -128,17 +127,10 @@ public class FileResourceStore extends ResourceStore {
File f = file(resPath);
if (f.exists() && f.isFile()) {
- if (f.length() == 0) {
- logger.warn("Zero length file: " + f.getAbsolutePath());
- }
+ logger.info("file length = " + f.length() + " , " + f.getAbsolutePath());
FileInputStream resource = new FileInputStream(f);
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
- IOUtils.copy(resource, baos);
- IOUtils.closeQuietly(resource);
- byte[] data = baos.toByteArray();
-
- return new RawResource(new ByteArrayInputStream(data), f.lastModified());
+ return new RawResource(resource, f.lastModified());
} else {
return null;
}