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 2017/07/25 09:44:50 UTC
[03/24] kylin git commit: minor, fix NoSuchMethodException in
org.apache.kylin.rest.service.CubeService#getHTableInfo
minor, fix NoSuchMethodException in org.apache.kylin.rest.service.CubeService#getHTableInfo
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e58951f3
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e58951f3
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e58951f3
Branch: refs/heads/2.1.x
Commit: e58951f326adcb946c628b6f2bffd6000f18a280
Parents: 21d25b9
Author: Hongbin Ma <ma...@apache.org>
Authored: Wed Jul 5 13:14:14 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Jul 5 13:23:28 2017 +0800
----------------------------------------------------------------------
.../org/apache/kylin/rest/service/CubeService.java | 14 ++++++++------
.../org/apache/kylin/rest/service/HBaseInfoUtil.java | 5 ++---
2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/e58951f3/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
index aa42cb0..4820ccd 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
@@ -81,7 +81,8 @@ public class CubeService extends BasicService {
private static final Logger logger = LoggerFactory.getLogger(CubeService.class);
- public static final char[] VALID_CUBENAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_".toCharArray();
+ public static final char[] VALID_CUBENAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"
+ .toCharArray();
private WeakHashMap<String, HBaseResponse> htableInfoCache = new WeakHashMap<>();
@@ -101,7 +102,8 @@ public class CubeService extends BasicService {
private AclUtil aclUtil;
@PostFilter(Constant.ACCESS_POST_FILTER_READ)
- public List<CubeInstance> listAllCubes(final String cubeName, final String projectName, final String modelName, boolean exactMatch) {
+ public List<CubeInstance> listAllCubes(final String cubeName, final String projectName, final String modelName,
+ boolean exactMatch) {
List<CubeInstance> cubeInstances = null;
ProjectInstance project = (null != projectName) ? getProjectManager().getProject(projectName) : null;
@@ -128,8 +130,8 @@ public class CubeService extends BasicService {
List<CubeInstance> filterCubes = new ArrayList<CubeInstance>();
for (CubeInstance cubeInstance : filterModelCubes) {
boolean isCubeMatch = (null == cubeName)
- || (!exactMatch && cubeInstance.getName().toLowerCase().contains(cubeName.toLowerCase())) ||
- (exactMatch && cubeInstance.getName().toLowerCase().equals(cubeName.toLowerCase()));
+ || (!exactMatch && cubeInstance.getName().toLowerCase().contains(cubeName.toLowerCase()))
+ || (exactMatch && cubeInstance.getName().toLowerCase().equals(cubeName.toLowerCase()));
if (isCubeMatch) {
filterCubes.add(cubeInstance);
@@ -428,8 +430,8 @@ public class CubeService extends BasicService {
try {
// use reflection to isolate NoClassDef errors when HBase is not available
hr = (HBaseResponse) Class.forName("org.apache.kylin.rest.service.HBaseInfoUtil")//
- .getMethod("getHBaseInfo", new Class[] { String.class, String.class })//
- .invoke(null, new Object[] { tableName, this.getConfig().getStorageUrl() });
+ .getMethod("getHBaseInfo", new Class[] { String.class, KylinConfig.class })//
+ .invoke(null, tableName, this.getConfig());
} catch (Throwable e) {
throw new IOException(e);
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/e58951f3/server-base/src/main/java/org/apache/kylin/rest/service/HBaseInfoUtil.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/HBaseInfoUtil.java b/server-base/src/main/java/org/apache/kylin/rest/service/HBaseInfoUtil.java
index 3f0b2b5..5dd9a0b 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/HBaseInfoUtil.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/HBaseInfoUtil.java
@@ -27,10 +27,9 @@ import org.apache.kylin.rest.response.HBaseResponse;
import org.apache.kylin.storage.hbase.HBaseConnection;
import org.apache.kylin.storage.hbase.util.HBaseRegionSizeCalculator;
-/**
- * Created by xiefan on 17-5-5.
- */
public class HBaseInfoUtil {
+
+ @SuppressWarnings("unused") // used by reflection
public static HBaseResponse getHBaseInfo(String tableName, KylinConfig config) throws IOException {
if (!config.getStorageUrl().getScheme().equals("hbase"))
return null;