Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A32BD200C36 for ; Thu, 23 Feb 2017 11:40:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A1F3A160B50; Thu, 23 Feb 2017 10:40:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C7565160B62 for ; Thu, 23 Feb 2017 11:40:45 +0100 (CET) Received: (qmail 111 invoked by uid 500); 23 Feb 2017 10:40:45 -0000 Mailing-List: contact commits-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list commits@kylin.apache.org Received: (qmail 99994 invoked by uid 99); 23 Feb 2017 10:40:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 10:40:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DC09ADFE1E; Thu, 23 Feb 2017 10:40:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: liyang@apache.org To: commits@kylin.apache.org Date: Thu, 23 Feb 2017 10:40:45 -0000 Message-Id: <3a4f8358adfb49f7951b8fc0110bb172@git.apache.org> In-Reply-To: <3346b90128e240cb944422173f963414@git.apache.org> References: <3346b90128e240cb944422173f963414@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] kylin git commit: KYLIN-2462 don't always using FK in place of PK dimension archived-at: Thu, 23 Feb 2017 10:40:46 -0000 KYLIN-2462 don't always using FK in place of PK dimension Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7eb0e054 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7eb0e054 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7eb0e054 Branch: refs/heads/KYLIN-2462 Commit: 7eb0e054cc44a73333084367a39afe1531461a46 Parents: fa18b11 Author: Li Yang Authored: Thu Feb 23 18:40:28 2017 +0800 Committer: Li Yang Committed: Thu Feb 23 18:40:28 2017 +0800 ---------------------------------------------------------------------- .../java/org/apache/kylin/common/util/SSHClient.java | 14 ++++++-------- .../java/org/apache/kylin/cube/model/CubeDesc.java | 13 ++----------- 2 files changed, 8 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/7eb0e054/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java ---------------------------------------------------------------------- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java b/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java index 9c83fbd..5e27d9d 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/SSHClient.java @@ -64,7 +64,7 @@ public class SSHClient { public void scpFileToRemote(String localFile, String remoteTargetDirectory) throws Exception { FileInputStream fis = null; try { - System.out.println("SCP file " + localFile + " to " + remoteTargetDirectory); + logger.info("SCP file " + localFile + " to " + remoteTargetDirectory); Session session = newJSchSession(); session.connect(); @@ -149,7 +149,7 @@ public class SSHClient { public void scpFileToLocal(String rfile, String lfile) throws Exception { FileOutputStream fos = null; try { - System.out.println("SCP remote file " + rfile + " to local " + lfile); + logger.info("SCP remote file " + rfile + " to local " + lfile); String prefix = null; if (new File(lfile).isDirectory()) { @@ -205,8 +205,6 @@ public class SSHClient { } } - //System.out.println("filesize="+filesize+", file="+file); - // send '\0' buf[0] = 0; out.write(buf, 0, 1); @@ -259,7 +257,7 @@ public class SSHClient { public SSHClientOutput execCommand(String command, int timeoutSeconds, Logger logAppender) throws Exception { try { - System.out.println("[" + username + "@" + hostname + "] Execute command: " + command); + logger.info("[" + username + "@" + hostname + "] Execute command: " + command); StringBuffer text = new StringBuffer(); int exitCode = -1; @@ -311,7 +309,7 @@ public class SSHClient { if (in.available() > 0) continue; exitCode = channel.getExitStatus(); - System.out.println("[" + username + "@" + hostname + "] Command exit-status: " + exitCode); + logger.info("[" + username + "@" + hostname + "] Command exit-status: " + exitCode); break; } @@ -364,10 +362,10 @@ public class SSHClient { sb.append((char) c); } while (c != '\n'); if (b == 1) { // error - System.out.print(sb.toString()); + logger.error(sb.toString()); } if (b == 2) { // fatal error - System.out.print(sb.toString()); + logger.error(sb.toString()); } } return b; http://git-wip-us.apache.org/repos/asf/kylin/blob/7eb0e054/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java ---------------------------------------------------------------------- diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java index 95e3343..c1469fe 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java @@ -529,7 +529,7 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware { this.errors.clear(); checkArgument(StringUtils.isNotBlank(name), "CubeDesc name is blank"); - checkArgument(StringUtils.isNotBlank(modelName), "CubeDesc(%s) has blank modelName", name); + checkArgument(StringUtils.isNotBlank(modelName), "CubeDesc (%s) has blank model name", name); // note CubeDesc.name == CubeInstance.name List ownerPrj = ProjectManager.getInstance(config).findProjects(RealizationType.CUBE, name); @@ -571,7 +571,7 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware { // check all dimension columns are presented on rowkey List dimCols = listDimensionColumnsExcludingDerived(true); - checkState(rowkey.getRowKeyColumns().length == dimCols.size(), "RowKey columns count (%d) doesn't match dimensions columns count (%d)", rowkey.getRowKeyColumns().length, dimCols.size()); + checkState(rowkey.getRowKeyColumns().length == dimCols.size(), "RowKey columns count (%s) doesn't match dimensions columns count (%s)", rowkey.getRowKeyColumns().length, dimCols.size()); initDictionaryDesc(); amendAllColumns(); @@ -857,15 +857,6 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware { private TblColRef initDimensionColRef(DimensionDesc dim, String colName) { TblColRef col = model.findColumn(dim.getTable(), colName); - - // always use FK instead PK, FK could be shared by more than one lookup tables - JoinDesc join = dim.getJoin(); - if (join != null) { - int idx = ArrayUtils.indexOf(join.getPrimaryKeyColumns(), col); - if (idx >= 0) { - col = join.getForeignKeyColumns()[idx]; - } - } return initDimensionColRef(col); }