You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2016/04/12 09:32:29 UTC

kylin git commit: KYLIN-1579 revise logging

Repository: kylin
Updated Branches:
  refs/heads/yang-m1 c17bb7366 -> d291e8473


KYLIN-1579 revise logging


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

Branch: refs/heads/yang-m1
Commit: d291e847388ab1c12c1a6c1b330eb8d5ba7fb0f4
Parents: c17bb73
Author: Hongbin Ma <ma...@apache.org>
Authored: Tue Apr 12 15:31:31 2016 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Tue Apr 12 15:31:31 2016 +0800

----------------------------------------------------------------------
 .../storage/hbase/cube/v2/CubeHBaseEndpointRPC.java | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/d291e847/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
index bfc240a..554a764 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeHBaseEndpointRPC.java
@@ -161,7 +161,6 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
             }
         }
 
-
         public long getTimeout() {
             return timeout;
         }
@@ -318,29 +317,34 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
                         builder.setBehavior(toggle);
                         builder.setStartTime(System.currentTimeMillis());
                         builder.setTimeout(epResultItr.getTimeout());
-
+                        String logHeader = "<sub-thread for GTScanRequest " + Integer.toHexString(System.identityHashCode(scanRequests.get(i))) + "> ";
 
                         Map<byte[], CubeVisitProtos.CubeVisitResponse> results;
                         try {
                             results = getResults(builder.build(), conn.getTable(cubeSeg.getStorageLocationIdentifier()), epRange.getFirst(), epRange.getSecond());
                         } catch (Throwable throwable) {
-                            throw new RuntimeException("<sub-thread for GTScanRequest " + Integer.toHexString(System.identityHashCode(scanRequests.get(i))) + "> " + "Error when visiting cubes by endpoint", throwable);
+                            throw new RuntimeException(logHeader + "Error when visiting cubes by endpoint", throwable);
                         }
 
+                        boolean abnormalFinish = false;
                         for (Map.Entry<byte[], CubeVisitProtos.CubeVisitResponse> result : results.entrySet()) {
                             totalScannedCount.addAndGet(result.getValue().getStats().getScannedRowCount());
-                            logger.info("<sub-thread for GTScanRequest " + Integer.toHexString(System.identityHashCode(scanRequests.get(i))) + "> " + getStatsString(result));
+                            logger.info(logHeader + getStatsString(result));
 
                             if (result.getValue().getStats().getNormalComplete() != 1) {
-                                throw new RuntimeException("The coprocessor thread stopped itself due to scan timeout.");
+                                abnormalFinish = true;
                             }
 
                             try {
                                 epResultItr.append(CompressionUtils.decompress(HBaseZeroCopyByteString.zeroCopyGetBytes(result.getValue().getCompressedRows())));
                             } catch (IOException | DataFormatException e) {
-                                throw new RuntimeException("Error when decompressing", e);
+                                throw new RuntimeException(logHeader + "Error when decompressing", e);
                             }
                         }
+
+                        if (abnormalFinish) {
+                            throw new RuntimeException(logHeader + "The coprocessor thread stopped itself due to scan timeout.");
+                        }
                     }
                 }
             });