You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/11/11 08:56:11 UTC
incubator-kylin git commit: minor log to troubleshoot
DefaultSchedulerTest.testSucceedAndFailed()
Repository: incubator-kylin
Updated Branches:
refs/heads/2.x-staging 64e774e83 -> 36d6907d7
minor log to troubleshoot DefaultSchedulerTest.testSucceedAndFailed()
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/36d6907d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/36d6907d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/36d6907d
Branch: refs/heads/2.x-staging
Commit: 36d6907d7c899f9d65e87ab347998cf740d529f3
Parents: 64e774e
Author: Li, Yang <ya...@ebay.com>
Authored: Wed Nov 11 15:56:02 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Wed Nov 11 15:56:02 2015 +0800
----------------------------------------------------------------------
.../kylin/common/persistence/FileResourceStore.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/36d6907d/core-common/src/main/java/org/apache/kylin/common/persistence/FileResourceStore.java
----------------------------------------------------------------------
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 fef0a14..e74a9b2 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
@@ -30,11 +30,15 @@ import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.kylin.common.KylinConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.collect.Lists;
public class FileResourceStore extends ResourceStore {
+ private static final Logger logger = LoggerFactory.getLogger(FileResourceStore.class);
+
File root;
public FileResourceStore(KylinConfig kylinConfig) {
@@ -93,10 +97,14 @@ public class FileResourceStore extends ResourceStore {
@Override
protected InputStream getResourceImpl(String resPath) throws IOException {
File f = file(resPath);
- if (f.exists() && f.isFile())
- return new FileInputStream(file(resPath));
- else
+ if (f.exists() && f.isFile()) {
+ if (f.length() == 0) {
+ logger.warn("Zero length file: " + f.getAbsolutePath());
+ }
+ return new FileInputStream(f);
+ } else {
return null;
+ }
}
@Override