kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lid...@apache.org
Subject [10/50] [abbrv] kylin git commit: minor, ignore exceptions in diagnosis tool
Date Sat, 03 Sep 2016 06:37:17 GMT
minor, ignore exceptions in diagnosis tool


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

Branch: refs/heads/1.5.x-HBase1.x
Commit: 5a77f5e72aeda51c2e2b2c2eea77e591eb998c19
Parents: 03c6cf3
Author: lidongsjtu <lidong@apache.org>
Authored: Wed Aug 24 16:43:16 2016 +0800
Committer: lidongsjtu <lidong@apache.org>
Committed: Wed Aug 24 17:09:32 2016 +0800

----------------------------------------------------------------------
 .../apache/kylin/tool/CubeMetaExtractor.java    | 17 +++---
 .../org/apache/kylin/tool/DiagnosisInfoCLI.java | 56 +++++++++++++-------
 2 files changed, 48 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/5a77f5e7/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
index 5505c0a..f4fb308 100644
--- a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
@@ -97,14 +97,14 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
     private RealizationRegistry realizationRegistry;
     private BadQueryHistoryManager badQueryHistoryManager;
 
-    boolean includeSegments;
-    boolean includeJobs;
-    boolean includeSegmentDetails;
-    boolean onlyJobOutput;
+    private boolean includeSegments;
+    private boolean includeJobs;
+    private boolean includeSegmentDetails;
+    private boolean onlyJobOutput;
 
-    Set<String> requiredResources = Sets.newLinkedHashSet();
-    Set<String> optionalResources = Sets.newLinkedHashSet();
-    Set<CubeInstance> cubesToTrimAndSave = Sets.newLinkedHashSet();//these cubes needs
to be saved skipping segments
+    private Set<String> requiredResources = Sets.newLinkedHashSet();
+    private Set<String> optionalResources = Sets.newLinkedHashSet();
+    private Set<CubeInstance> cubesToTrimAndSave = Sets.newLinkedHashSet();//these
cubes needs to be saved skipping segments
 
     public CubeMetaExtractor() {
         super();
@@ -239,6 +239,9 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
     }
 
     private void retrieveResourcePath(IRealization realization) {
+        if (realization == null) {
+            return;
+        }
 
         logger.info("Deal with realization {} of type {}", realization.getName(), realization.getType());
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/5a77f5e7/tool/src/main/java/org/apache/kylin/tool/DiagnosisInfoCLI.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/DiagnosisInfoCLI.java b/tool/src/main/java/org/apache/kylin/tool/DiagnosisInfoCLI.java
index 7b5eeaf..e77ac3b 100644
--- a/tool/src/main/java/org/apache/kylin/tool/DiagnosisInfoCLI.java
+++ b/tool/src/main/java/org/apache/kylin/tool/DiagnosisInfoCLI.java
@@ -123,10 +123,15 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
         executorService.execute(new Runnable() {
             @Override
             public void run() {
-                String[] cubeMetaArgs = { "-destDir", new File(exportDir, "metadata").getAbsolutePath(),
"-project", projectNames, "-compress", "false", "-includeJobs", "false", "-submodule", "true"
};
-                CubeMetaExtractor cubeMetaExtractor = new CubeMetaExtractor();
-                logger.info("CubeMetaExtractor args: " + Arrays.toString(cubeMetaArgs));
-                cubeMetaExtractor.execute(cubeMetaArgs);
+                logger.info("Start to extract metadata.");
+                try {
+                    String[] cubeMetaArgs = { "-destDir", new File(exportDir, "metadata").getAbsolutePath(),
"-project", projectNames, "-compress", "false", "-includeJobs", "false", "-submodule", "true"
};
+                    CubeMetaExtractor cubeMetaExtractor = new CubeMetaExtractor();
+                    logger.info("CubeMetaExtractor args: " + Arrays.toString(cubeMetaArgs));
+                    cubeMetaExtractor.execute(cubeMetaArgs);
+                } catch (Exception e) {
+                    logger.error("Error in export metadata.", e);
+                }
             }
         });
 
@@ -135,9 +140,14 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
             executorService.execute(new Runnable() {
                 @Override
                 public void run() {
-                    String[] jobArgs = { "-destDir", new File(exportDir, "jobs").getAbsolutePath(),
"-period", Integer.toString(period), "-compress", "false", "-submodule", "true" };
-                    JobInstanceExtractor jobInstanceExtractor = new JobInstanceExtractor();
-                    jobInstanceExtractor.execute(jobArgs);
+                    logger.info("Start to extract jobs.");
+                    try {
+                        String[] jobArgs = { "-destDir", new File(exportDir, "jobs").getAbsolutePath(),
"-period", Integer.toString(period), "-compress", "false", "-submodule", "true" };
+                        JobInstanceExtractor jobInstanceExtractor = new JobInstanceExtractor();
+                        jobInstanceExtractor.execute(jobArgs);
+                    } catch (Exception e) {
+                        logger.error("Error in export jobs.", e);
+                    }
                 }
             });
         }
@@ -147,10 +157,15 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
             executorService.execute(new Runnable() {
                 @Override
                 public void run() {
-                    String[] hbaseArgs = { "-destDir", new File(exportDir, "hbase").getAbsolutePath(),
"-project", projectNames, "-compress", "false", "-submodule", "true" };
-                    HBaseUsageExtractor hBaseUsageExtractor = new HBaseUsageExtractor();
-                    logger.info("HBaseUsageExtractor args: " + Arrays.toString(hbaseArgs));
-                    hBaseUsageExtractor.execute(hbaseArgs);
+                    logger.info("Start to extract HBase usage.");
+                    try {
+                        String[] hbaseArgs = { "-destDir", new File(exportDir, "hbase").getAbsolutePath(),
"-project", projectNames, "-compress", "false", "-submodule", "true" };
+                        HBaseUsageExtractor hBaseUsageExtractor = new HBaseUsageExtractor();
+                        logger.info("HBaseUsageExtractor args: " + Arrays.toString(hbaseArgs));
+                        hBaseUsageExtractor.execute(hbaseArgs);
+                    } catch (Exception e) {
+                        logger.error("Error in export HBase usage.", e);
+                    }
                 }
             });
         }
@@ -175,7 +190,7 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
                             }
                         }
                     } catch (Exception e) {
-                        logger.warn("Error in export conf.", e);
+                        logger.error("Error in export conf.", e);
                     }
                 }
             });
@@ -191,8 +206,8 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
                         ClientEnvExtractor clientEnvExtractor = new ClientEnvExtractor();
                         logger.info("ClientEnvExtractor args: " + Arrays.toString(clientArgs));
                         clientEnvExtractor.execute(clientArgs);
-                    } catch (IOException e) {
-                        logger.warn("Error in export client info.", e);
+                    } catch (Exception e) {
+                        logger.error("Error in export client info.", e);
                     }
                 }
             });
@@ -202,10 +217,15 @@ public class DiagnosisInfoCLI extends AbstractInfoExtractor {
         executorService.execute(new Runnable() {
             @Override
             public void run() {
-                String[] logsArgs = { "-destDir", new File(exportDir, "logs").getAbsolutePath(),
"-logPeriod", Integer.toString(period), "-compress", "false", "-submodule", "true" };
-                KylinLogExtractor logExtractor = new KylinLogExtractor();
-                logger.info("KylinLogExtractor args: " + Arrays.toString(logsArgs));
-                logExtractor.execute(logsArgs);
+                logger.info("Start to extract logs.");
+                try {
+                    String[] logsArgs = { "-destDir", new File(exportDir, "logs").getAbsolutePath(),
"-logPeriod", Integer.toString(period), "-compress", "false", "-submodule", "true" };
+                    KylinLogExtractor logExtractor = new KylinLogExtractor();
+                    logger.info("KylinLogExtractor args: " + Arrays.toString(logsArgs));
+                    logExtractor.execute(logsArgs);
+                } catch (Exception e) {
+                    logger.error("Error in export logs.", e);
+                }
             }
         });
 


Mime
View raw message