This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.4.x
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/2.4.x by this push:
     new 84c5449  KYLIN-3428 too large dict file cause OOM
84c5449 is described below

commit 84c5449dfe90028d23ae76847951d415711f54f9
Author: yangcao <[email protected]>
AuthorDate: Fri Jul 6 16:39:19 2018 +0800

    KYLIN-3428 too large dict file cause OOM
    
    Signed-off-by: shaofengshi <[email protected]>
---
 .../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;
             }

Reply via email to