kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billy...@apache.org
Subject kylin git commit: KYLIN-2980, Remove getKey/Value setKey/Value from Kylin's Pair.
Date Mon, 05 Feb 2018 14:55:53 GMT
Repository: kylin
Updated Branches:
  refs/heads/master d31a00988 -> 5bc5e659d


KYLIN-2980, Remove getKey/Value setKey/Value from Kylin's Pair.

Signed-off-by: Billy Liu <billyliu@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5bc5e659
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5bc5e659
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5bc5e659

Branch: refs/heads/master
Commit: 5bc5e659dc6513e560ca14f4de696af2f79fac67
Parents: d31a009
Author: tttMelody <245915794@qq.com>
Authored: Tue Nov 7 21:38:15 2017 +0800
Committer: Billy Liu <billyliu@apache.org>
Committed: Mon Feb 5 22:55:36 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/common/util/Pair.java     | 16 ----------------
 .../org/apache/kylin/metrics/MetricsManager.java    | 14 +++++++-------
 .../tool/metrics/systemcube/CubeDescCreator.java    |  8 ++++----
 3 files changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/5bc5e659/core-common/src/main/java/org/apache/kylin/common/util/Pair.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/util/Pair.java b/core-common/src/main/java/org/apache/kylin/common/util/Pair.java
index 8ea009a..aa85855 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/Pair.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/Pair.java
@@ -79,14 +79,6 @@ public class Pair<T1, T2> implements Serializable {
         this.first = a;
     }
 
-    public T1 getKey() {
-        return getFirst();
-    }
-
-    public void setKey(T1 a) {
-        setFirst(a);
-    }
-
     /**
      * Return the second element stored in the pair.
      * @return T2
@@ -103,14 +95,6 @@ public class Pair<T1, T2> implements Serializable {
         this.second = b;
     }
 
-    public T2 getValue() {
-        return getSecond();
-    }
-
-    public void setValue(T2 b) {
-        setSecond(b);
-    }
-
     @Override
     @SuppressWarnings("rawtypes")
     public boolean equals(Object other) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/5bc5e659/core-metrics/src/main/java/org/apache/kylin/metrics/MetricsManager.java
----------------------------------------------------------------------
diff --git a/core-metrics/src/main/java/org/apache/kylin/metrics/MetricsManager.java b/core-metrics/src/main/java/org/apache/kylin/metrics/MetricsManager.java
index ce28bf6..e7f042e 100644
--- a/core-metrics/src/main/java/org/apache/kylin/metrics/MetricsManager.java
+++ b/core-metrics/src/main/java/org/apache/kylin/metrics/MetricsManager.java
@@ -94,14 +94,14 @@ public class MetricsManager {
             sourceReporterBindProps.put(activeReservoir, values);
             for (Pair<String, Properties> entry : sourceReporterBindProperties.get(activeReservoir))
{
                 try {
-                    Class clz = Class.forName(entry.getKey());
+                    Class clz = Class.forName(entry.getFirst());
                     if (ActiveReservoirReporter.class.isAssignableFrom(clz)) {
-                        values.add(new Pair(clz, entry.getValue()));
+                        values.add(new Pair(clz, entry.getSecond()));
                     } else {
                         logger.warn("The class " + clz + " is not a sub class of " + ActiveReservoir.class);
                     }
                 } catch (ClassNotFoundException e) {
-                    logger.warn("Cannot find class " + entry.getKey());
+                    logger.warn("Cannot find class " + entry.getFirst());
                 }
             }
         }
@@ -119,12 +119,12 @@ public class MetricsManager {
                         .get(activeReservoir);
                 for (Pair<Class<? extends ActiveReservoirReporter>, Properties>
subEntry : reportProps) {
                     try {
-                        Method method = subEntry.getKey().getMethod(METHOD_FOR_REGISTRY,
ActiveReservoir.class);
-                        ((ReporterBuilder) method.invoke(null, activeReservoir)).setConfig(subEntry.getValue()).build()
+                        Method method = subEntry.getFirst().getMethod(METHOD_FOR_REGISTRY,
ActiveReservoir.class);
+                        ((ReporterBuilder) method.invoke(null, activeReservoir)).setConfig(subEntry.getSecond()).build()
                                 .start();
                     } catch (Exception e) {
-                        logger.warn("Cannot initialize ActiveReservoirReporter: Builder class
- " + subEntry.getKey()
-                                + ", Properties - " + subEntry.getValue());
+                        logger.warn("Cannot initialize ActiveReservoirReporter: Builder class
- " + subEntry.getFirst()
+                                + ", Properties - " + subEntry.getSecond());
                     }
                 }
                 Metrics.register(registerName, activeReservoir);

http://git-wip-us.apache.org/repos/asf/kylin/blob/5bc5e659/tool/src/main/java/org/apache/kylin/tool/metrics/systemcube/CubeDescCreator.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/metrics/systemcube/CubeDescCreator.java
b/tool/src/main/java/org/apache/kylin/tool/metrics/systemcube/CubeDescCreator.java
index 666d23a..9eb5ab2 100644
--- a/tool/src/main/java/org/apache/kylin/tool/metrics/systemcube/CubeDescCreator.java
+++ b/tool/src/main/java/org/apache/kylin/tool/metrics/systemcube/CubeDescCreator.java
@@ -75,7 +75,7 @@ public class CubeDescCreator {
         List<Pair<String, String>> measureTypeList = HiveTableCreator.getHiveColumnsForMetricsQuery();
         Map<String, String> measureTypeMap = Maps.newHashMapWithExpectedSize(measureTypeList.size());
         for (Pair<String, String> entry : measureTypeList) {
-            measureTypeMap.put(entry.getKey(), entry.getValue());
+            measureTypeMap.put(entry.getFirst(), entry.getSecond());
         }
         measureDescList.add(getMeasureCount());
         measureDescList.add(getMeasureMin(QueryPropertyEnum.TIME_COST.toString(),
@@ -157,7 +157,7 @@ public class CubeDescCreator {
         List<Pair<String, String>> measureTypeList = HiveTableCreator.getHiveColumnsForMetricsQueryCube();
         Map<String, String> measureTypeMap = Maps.newHashMapWithExpectedSize(measureTypeList.size());
         for (Pair<String, String> entry : measureTypeList) {
-            measureTypeMap.put(entry.getKey(), entry.getValue());
+            measureTypeMap.put(entry.getFirst(), entry.getSecond());
         }
         measureDescList.add(getMeasureCount());
         for (String measure : measures) {
@@ -242,7 +242,7 @@ public class CubeDescCreator {
         List<Pair<String, String>> measureTypeList = HiveTableCreator.getHiveColumnsForMetricsQueryRPC();
         Map<String, String> measureTypeMap = Maps.newHashMapWithExpectedSize(measureTypeList.size());
         for (Pair<String, String> entry : measureTypeList) {
-            measureTypeMap.put(entry.getKey(), entry.getValue());
+            measureTypeMap.put(entry.getFirst(), entry.getSecond());
         }
         measureDescList.add(getMeasureCount());
         for (String measure : measures) {
@@ -319,7 +319,7 @@ public class CubeDescCreator {
         List<Pair<String, String>> measureTypeList = HiveTableCreator.getHiveColumnsForMetricsJob();
         Map<String, String> measureTypeMap = Maps.newHashMapWithExpectedSize(measureTypeList.size());
         for (Pair<String, String> entry : measureTypeList) {
-            measureTypeMap.put(entry.getKey(), entry.getValue());
+            measureTypeMap.put(entry.getFirst(), entry.getSecond());
         }
         measureDescList.add(getMeasureCount());
         for (String measure : measures) {


Mime
View raw message