Repository: incubator-kylin
Updated Branches:
  refs/heads/KYLIN-1126 [created] ad3622e12


KYLIN-942 append more server stats in endpoint response


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

Branch: refs/heads/KYLIN-1126
Commit: 9ac673a2ec946f1e9d232b6e32bffb5a43fd702b
Parents: cae8a65
Author: honma <ho...@ebay.com>
Authored: Wed Nov 4 16:51:02 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Wed Nov 4 16:51:02 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/common/util/BasicTest.java |  13 +-
 .../hbase/cube/v1/CubeSegmentTupleIterator.java |   1 -
 .../hbase/cube/v2/CubeHBaseEndpointRPC.java     |   3 +-
 .../coprocessor/endpoint/CubeVisitService.java  |  16 +-
 .../endpoint/generated/CubeVisitProtos.java     | 457 ++++++++++++++++++-
 .../endpoint/protobuf/CubeVisit.proto           |   4 +
 6 files changed, 477 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/core-common/src/test/java/org/apache/kylin/common/util/BasicTest.java
----------------------------------------------------------------------
diff --git 
a/core-common/src/test/java/org/apache/kylin/common/util/BasicTest.java 
b/core-common/src/test/java/org/apache/kylin/common/util/BasicTest.java
index c60f007..259f977 100644
--- a/core-common/src/test/java/org/apache/kylin/common/util/BasicTest.java
+++ b/core-common/src/test/java/org/apache/kylin/common/util/BasicTest.java
@@ -19,6 +19,7 @@
 package org.apache.kylin.common.util;
 
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
 import java.nio.ByteBuffer;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -34,6 +35,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.TreeMultiset;
+import com.sun.management.OperatingSystemMXBean;
 
 /**
 * <p/>
@@ -72,10 +74,13 @@ public class BasicTest {
     }
 
     @Test
-    public void testxx() {
-        B b= new B();
-        b.foo();;
-      
+    public void testxx() throws InterruptedException {
+        while (true) {
+            OperatingSystemMXBean operatingSystemMXBean = 
(OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+            System.out.println(operatingSystemMXBean.getSystemCpuLoad());
+            
System.out.println(operatingSystemMXBean.getFreePhysicalMemorySize());
+            Thread.sleep(1000);
+        }
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeSegmentTupleIterator.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeSegmentTupleIterator.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeSegmentTupleIterator.java
index 034ffac..22f7017 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeSegmentTupleIterator.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v1/CubeSegmentTupleIterator.java
@@ -254,7 +254,6 @@ public class CubeSegmentTupleIterator implements 
ITupleIterator {
         flushScanCountDelta();
 
         if (logger.isDebugEnabled() && scan != null) {
-            logger.debug("Scan " + scan.toString());
             byte[] metricsBytes = 
scan.getAttribute(Scan.SCAN_ATTRIBUTES_METRICS_DATA);
             if (metricsBytes != null) {
                 ScanMetrics scanMetrics = 
ProtobufUtil.toScanMetrics(metricsBytes);

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/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 6ad30e2..a8894a1 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
@@ -227,10 +227,11 @@ public class CubeHBaseEndpointRPC extends CubeHBaseRPC {
     private String getStatsString(CubeVisitProtos.CubeVisitResponse result, 
int shardIndex) {
         StringBuilder sb = new StringBuilder();
         Stats stats = result.getStats();
-        sb.append("Shard " + shardIndex + ": ");
+        sb.append("Shard " + shardIndex + " on host: " + stats.getHostname());
         sb.append("Total scanned row: " + stats.getScannedRowCount() + ". ");
         sb.append("Total filtered/aggred row: " + 
stats.getAggregatedRowCount() + ". ");
         sb.append("Time elapsed in EP: " + (stats.getServiceEndTime() - 
stats.getServiceStartTime()) + "(ms). ");
+        sb.append("Server CPU usage: " + stats.getSystemCpuLoad() + ", server 
physical mem left: " + stats.getFreePhysicalMemorySize() + ", server swap mem 
left:" + stats.getFreeSwapSpaceSize());
         return sb.toString();
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
index f474139..31d1901 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/CubeVisitService.java
@@ -20,6 +20,8 @@ package 
org.apache.kylin.storage.hbase.cube.v2.coprocessor.endpoint;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.util.List;
 
@@ -56,6 +58,7 @@ import com.google.protobuf.HBaseZeroCopyByteString;
 import com.google.protobuf.RpcCallback;
 import com.google.protobuf.RpcController;
 import com.google.protobuf.Service;
+import com.sun.management.OperatingSystemMXBean;
 
 @SuppressWarnings("unused")
 //used in hbase endpoint
@@ -165,6 +168,12 @@ public class CubeVisitService extends 
CubeVisitProtos.CubeVisitService implement
                 outputStream.write(buffer.array(), buffer.arrayOffset() - 
buffer.position(), buffer.remaining());
                 finalRowCount++;
             }
+
+            OperatingSystemMXBean operatingSystemMXBean = 
(OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+            double systemCpuLoad = operatingSystemMXBean.getSystemCpuLoad();
+            double freePhysicalMemorySize = 
operatingSystemMXBean.getFreePhysicalMemorySize();
+            double freeSwapSpaceSize = 
operatingSystemMXBean.getFreeSwapSpaceSize();
+
             //outputStream.close() is not necessary
             byte[] allRows = outputStream.toByteArray();
             CubeVisitProtos.CubeVisitResponse.Builder responseBuilder = 
CubeVisitProtos.CubeVisitResponse.newBuilder();
@@ -174,7 +183,12 @@ public class CubeVisitService extends 
CubeVisitProtos.CubeVisitService implement
                             
setAggregatedRowCount(finalScanner.getScannedRowCount() - finalRowCount).//
                             
setScannedRowCount(finalScanner.getScannedRowCount()).//
                             setServiceStartTime(serviceStartTime).//
-                            
setServiceEndTime(System.currentTimeMillis()).build()).//
+                            setServiceEndTime(System.currentTimeMillis()).//
+                            setSystemCpuLoad(systemCpuLoad).//
+                            
setFreePhysicalMemorySize(freePhysicalMemorySize).//
+                            setFreeSwapSpaceSize(freeSwapSpaceSize).//
+                            
setHostname(InetAddress.getLocalHost().getHostName()).//
+                            build()).//
                     build());
 
         } catch (IOException ioe) {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/generated/CubeVisitProtos.java
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/generated/CubeVisitProtos.java
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/generated/CubeVisitProtos.java
index 0923484..4e69dcc 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/generated/CubeVisitProtos.java
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/generated/CubeVisitProtos.java
@@ -1776,6 +1776,51 @@ public final class CubeVisitProtos {
        * <code>optional int32 aggregatedRowCount = 4;</code>
        */
       int getAggregatedRowCount();
+
+      // optional double systemCpuLoad = 5;
+      /**
+       * <code>optional double systemCpuLoad = 5;</code>
+       */
+      boolean hasSystemCpuLoad();
+      /**
+       * <code>optional double systemCpuLoad = 5;</code>
+       */
+      double getSystemCpuLoad();
+
+      // optional double freePhysicalMemorySize = 6;
+      /**
+       * <code>optional double freePhysicalMemorySize = 6;</code>
+       */
+      boolean hasFreePhysicalMemorySize();
+      /**
+       * <code>optional double freePhysicalMemorySize = 6;</code>
+       */
+      double getFreePhysicalMemorySize();
+
+      // optional double freeSwapSpaceSize = 7;
+      /**
+       * <code>optional double freeSwapSpaceSize = 7;</code>
+       */
+      boolean hasFreeSwapSpaceSize();
+      /**
+       * <code>optional double freeSwapSpaceSize = 7;</code>
+       */
+      double getFreeSwapSpaceSize();
+
+      // optional string hostname = 8;
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      boolean hasHostname();
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      java.lang.String getHostname();
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      com.google.protobuf.ByteString
+          getHostnameBytes();
     }
     /**
      * Protobuf type {@code CubeVisitResponse.Stats}
@@ -1848,6 +1893,26 @@ public final class CubeVisitProtos {
                 aggregatedRowCount_ = input.readInt32();
                 break;
               }
+              case 41: {
+                bitField0_ |= 0x00000010;
+                systemCpuLoad_ = input.readDouble();
+                break;
+              }
+              case 49: {
+                bitField0_ |= 0x00000020;
+                freePhysicalMemorySize_ = input.readDouble();
+                break;
+              }
+              case 57: {
+                bitField0_ |= 0x00000040;
+                freeSwapSpaceSize_ = input.readDouble();
+                break;
+              }
+              case 66: {
+                bitField0_ |= 0x00000080;
+                hostname_ = input.readBytes();
+                break;
+              }
             }
           }
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -1952,11 +2017,106 @@ public final class CubeVisitProtos {
         return aggregatedRowCount_;
       }
 
+      // optional double systemCpuLoad = 5;
+      public static final int SYSTEMCPULOAD_FIELD_NUMBER = 5;
+      private double systemCpuLoad_;
+      /**
+       * <code>optional double systemCpuLoad = 5;</code>
+       */
+      public boolean hasSystemCpuLoad() {
+        return ((bitField0_ & 0x00000010) == 0x00000010);
+      }
+      /**
+       * <code>optional double systemCpuLoad = 5;</code>
+       */
+      public double getSystemCpuLoad() {
+        return systemCpuLoad_;
+      }
+
+      // optional double freePhysicalMemorySize = 6;
+      public static final int FREEPHYSICALMEMORYSIZE_FIELD_NUMBER = 6;
+      private double freePhysicalMemorySize_;
+      /**
+       * <code>optional double freePhysicalMemorySize = 6;</code>
+       */
+      public boolean hasFreePhysicalMemorySize() {
+        return ((bitField0_ & 0x00000020) == 0x00000020);
+      }
+      /**
+       * <code>optional double freePhysicalMemorySize = 6;</code>
+       */
+      public double getFreePhysicalMemorySize() {
+        return freePhysicalMemorySize_;
+      }
+
+      // optional double freeSwapSpaceSize = 7;
+      public static final int FREESWAPSPACESIZE_FIELD_NUMBER = 7;
+      private double freeSwapSpaceSize_;
+      /**
+       * <code>optional double freeSwapSpaceSize = 7;</code>
+       */
+      public boolean hasFreeSwapSpaceSize() {
+        return ((bitField0_ & 0x00000040) == 0x00000040);
+      }
+      /**
+       * <code>optional double freeSwapSpaceSize = 7;</code>
+       */
+      public double getFreeSwapSpaceSize() {
+        return freeSwapSpaceSize_;
+      }
+
+      // optional string hostname = 8;
+      public static final int HOSTNAME_FIELD_NUMBER = 8;
+      private java.lang.Object hostname_;
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      public boolean hasHostname() {
+        return ((bitField0_ & 0x00000080) == 0x00000080);
+      }
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      public java.lang.String getHostname() {
+        java.lang.Object ref = hostname_;
+        if (ref instanceof java.lang.String) {
+          return (java.lang.String) ref;
+        } else {
+          com.google.protobuf.ByteString bs = 
+              (com.google.protobuf.ByteString) ref;
+          java.lang.String s = bs.toStringUtf8();
+          if (bs.isValidUtf8()) {
+            hostname_ = s;
+          }
+          return s;
+        }
+      }
+      /**
+       * <code>optional string hostname = 8;</code>
+       */
+      public com.google.protobuf.ByteString
+          getHostnameBytes() {
+        java.lang.Object ref = hostname_;
+        if (ref instanceof java.lang.String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (java.lang.String) ref);
+          hostname_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+
       private void initFields() {
         serviceStartTime_ = 0L;
         serviceEndTime_ = 0L;
         scannedRowCount_ = 0;
         aggregatedRowCount_ = 0;
+        systemCpuLoad_ = 0D;
+        freePhysicalMemorySize_ = 0D;
+        freeSwapSpaceSize_ = 0D;
+        hostname_ = "";
       }
       private byte memoizedIsInitialized = -1;
       public final boolean isInitialized() {
@@ -1982,6 +2142,18 @@ public final class CubeVisitProtos {
         if (((bitField0_ & 0x00000008) == 0x00000008)) {
           output.writeInt32(4, aggregatedRowCount_);
         }
+        if (((bitField0_ & 0x00000010) == 0x00000010)) {
+          output.writeDouble(5, systemCpuLoad_);
+        }
+        if (((bitField0_ & 0x00000020) == 0x00000020)) {
+          output.writeDouble(6, freePhysicalMemorySize_);
+        }
+        if (((bitField0_ & 0x00000040) == 0x00000040)) {
+          output.writeDouble(7, freeSwapSpaceSize_);
+        }
+        if (((bitField0_ & 0x00000080) == 0x00000080)) {
+          output.writeBytes(8, getHostnameBytes());
+        }
         getUnknownFields().writeTo(output);
       }
 
@@ -2007,6 +2179,22 @@ public final class CubeVisitProtos {
           size += com.google.protobuf.CodedOutputStream
             .computeInt32Size(4, aggregatedRowCount_);
         }
+        if (((bitField0_ & 0x00000010) == 0x00000010)) {
+          size += com.google.protobuf.CodedOutputStream
+            .computeDoubleSize(5, systemCpuLoad_);
+        }
+        if (((bitField0_ & 0x00000020) == 0x00000020)) {
+          size += com.google.protobuf.CodedOutputStream
+            .computeDoubleSize(6, freePhysicalMemorySize_);
+        }
+        if (((bitField0_ & 0x00000040) == 0x00000040)) {
+          size += com.google.protobuf.CodedOutputStream
+            .computeDoubleSize(7, freeSwapSpaceSize_);
+        }
+        if (((bitField0_ & 0x00000080) == 0x00000080)) {
+          size += com.google.protobuf.CodedOutputStream
+            .computeBytesSize(8, getHostnameBytes());
+        }
         size += getUnknownFields().getSerializedSize();
         memoizedSerializedSize = size;
         return size;
@@ -2050,6 +2238,23 @@ public final class CubeVisitProtos {
           result = result && (getAggregatedRowCount()
               == other.getAggregatedRowCount());
         }
+        result = result && (hasSystemCpuLoad() == other.hasSystemCpuLoad());
+        if (hasSystemCpuLoad()) {
+          result = result && (Double.doubleToLongBits(getSystemCpuLoad())    
== Double.doubleToLongBits(other.getSystemCpuLoad()));
+        }
+        result = result && (hasFreePhysicalMemorySize() == 
other.hasFreePhysicalMemorySize());
+        if (hasFreePhysicalMemorySize()) {
+          result = result && 
(Double.doubleToLongBits(getFreePhysicalMemorySize())    == 
Double.doubleToLongBits(other.getFreePhysicalMemorySize()));
+        }
+        result = result && (hasFreeSwapSpaceSize() == 
other.hasFreeSwapSpaceSize());
+        if (hasFreeSwapSpaceSize()) {
+          result = result && (Double.doubleToLongBits(getFreeSwapSpaceSize())  
  == Double.doubleToLongBits(other.getFreeSwapSpaceSize()));
+        }
+        result = result && (hasHostname() == other.hasHostname());
+        if (hasHostname()) {
+          result = result && getHostname()
+              .equals(other.getHostname());
+        }
         result = result &&
             getUnknownFields().equals(other.getUnknownFields());
         return result;
@@ -2079,6 +2284,25 @@ public final class CubeVisitProtos {
           hash = (37 * hash) + AGGREGATEDROWCOUNT_FIELD_NUMBER;
           hash = (53 * hash) + getAggregatedRowCount();
         }
+        if (hasSystemCpuLoad()) {
+          hash = (37 * hash) + SYSTEMCPULOAD_FIELD_NUMBER;
+          hash = (53 * hash) + hashLong(
+              Double.doubleToLongBits(getSystemCpuLoad()));
+        }
+        if (hasFreePhysicalMemorySize()) {
+          hash = (37 * hash) + FREEPHYSICALMEMORYSIZE_FIELD_NUMBER;
+          hash = (53 * hash) + hashLong(
+              Double.doubleToLongBits(getFreePhysicalMemorySize()));
+        }
+        if (hasFreeSwapSpaceSize()) {
+          hash = (37 * hash) + FREESWAPSPACESIZE_FIELD_NUMBER;
+          hash = (53 * hash) + hashLong(
+              Double.doubleToLongBits(getFreeSwapSpaceSize()));
+        }
+        if (hasHostname()) {
+          hash = (37 * hash) + HOSTNAME_FIELD_NUMBER;
+          hash = (53 * hash) + getHostname().hashCode();
+        }
         hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
@@ -2196,6 +2420,14 @@ public final class CubeVisitProtos {
           bitField0_ = (bitField0_ & ~0x00000004);
           aggregatedRowCount_ = 0;
           bitField0_ = (bitField0_ & ~0x00000008);
+          systemCpuLoad_ = 0D;
+          bitField0_ = (bitField0_ & ~0x00000010);
+          freePhysicalMemorySize_ = 0D;
+          bitField0_ = (bitField0_ & ~0x00000020);
+          freeSwapSpaceSize_ = 0D;
+          bitField0_ = (bitField0_ & ~0x00000040);
+          hostname_ = "";
+          bitField0_ = (bitField0_ & ~0x00000080);
           return this;
         }
 
@@ -2240,6 +2472,22 @@ public final class CubeVisitProtos {
             to_bitField0_ |= 0x00000008;
           }
           result.aggregatedRowCount_ = aggregatedRowCount_;
+          if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+            to_bitField0_ |= 0x00000010;
+          }
+          result.systemCpuLoad_ = systemCpuLoad_;
+          if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+            to_bitField0_ |= 0x00000020;
+          }
+          result.freePhysicalMemorySize_ = freePhysicalMemorySize_;
+          if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+            to_bitField0_ |= 0x00000040;
+          }
+          result.freeSwapSpaceSize_ = freeSwapSpaceSize_;
+          if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+            to_bitField0_ |= 0x00000080;
+          }
+          result.hostname_ = hostname_;
           result.bitField0_ = to_bitField0_;
           onBuilt();
           return result;
@@ -2268,6 +2516,20 @@ public final class CubeVisitProtos {
           if (other.hasAggregatedRowCount()) {
             setAggregatedRowCount(other.getAggregatedRowCount());
           }
+          if (other.hasSystemCpuLoad()) {
+            setSystemCpuLoad(other.getSystemCpuLoad());
+          }
+          if (other.hasFreePhysicalMemorySize()) {
+            setFreePhysicalMemorySize(other.getFreePhysicalMemorySize());
+          }
+          if (other.hasFreeSwapSpaceSize()) {
+            setFreeSwapSpaceSize(other.getFreeSwapSpaceSize());
+          }
+          if (other.hasHostname()) {
+            bitField0_ |= 0x00000080;
+            hostname_ = other.hostname_;
+            onChanged();
+          }
           this.mergeUnknownFields(other.getUnknownFields());
           return this;
         }
@@ -2427,6 +2689,179 @@ public final class CubeVisitProtos {
           return this;
         }
 
+        // optional double systemCpuLoad = 5;
+        private double systemCpuLoad_ ;
+        /**
+         * <code>optional double systemCpuLoad = 5;</code>
+         */
+        public boolean hasSystemCpuLoad() {
+          return ((bitField0_ & 0x00000010) == 0x00000010);
+        }
+        /**
+         * <code>optional double systemCpuLoad = 5;</code>
+         */
+        public double getSystemCpuLoad() {
+          return systemCpuLoad_;
+        }
+        /**
+         * <code>optional double systemCpuLoad = 5;</code>
+         */
+        public Builder setSystemCpuLoad(double value) {
+          bitField0_ |= 0x00000010;
+          systemCpuLoad_ = value;
+          onChanged();
+          return this;
+        }
+        /**
+         * <code>optional double systemCpuLoad = 5;</code>
+         */
+        public Builder clearSystemCpuLoad() {
+          bitField0_ = (bitField0_ & ~0x00000010);
+          systemCpuLoad_ = 0D;
+          onChanged();
+          return this;
+        }
+
+        // optional double freePhysicalMemorySize = 6;
+        private double freePhysicalMemorySize_ ;
+        /**
+         * <code>optional double freePhysicalMemorySize = 6;</code>
+         */
+        public boolean hasFreePhysicalMemorySize() {
+          return ((bitField0_ & 0x00000020) == 0x00000020);
+        }
+        /**
+         * <code>optional double freePhysicalMemorySize = 6;</code>
+         */
+        public double getFreePhysicalMemorySize() {
+          return freePhysicalMemorySize_;
+        }
+        /**
+         * <code>optional double freePhysicalMemorySize = 6;</code>
+         */
+        public Builder setFreePhysicalMemorySize(double value) {
+          bitField0_ |= 0x00000020;
+          freePhysicalMemorySize_ = value;
+          onChanged();
+          return this;
+        }
+        /**
+         * <code>optional double freePhysicalMemorySize = 6;</code>
+         */
+        public Builder clearFreePhysicalMemorySize() {
+          bitField0_ = (bitField0_ & ~0x00000020);
+          freePhysicalMemorySize_ = 0D;
+          onChanged();
+          return this;
+        }
+
+        // optional double freeSwapSpaceSize = 7;
+        private double freeSwapSpaceSize_ ;
+        /**
+         * <code>optional double freeSwapSpaceSize = 7;</code>
+         */
+        public boolean hasFreeSwapSpaceSize() {
+          return ((bitField0_ & 0x00000040) == 0x00000040);
+        }
+        /**
+         * <code>optional double freeSwapSpaceSize = 7;</code>
+         */
+        public double getFreeSwapSpaceSize() {
+          return freeSwapSpaceSize_;
+        }
+        /**
+         * <code>optional double freeSwapSpaceSize = 7;</code>
+         */
+        public Builder setFreeSwapSpaceSize(double value) {
+          bitField0_ |= 0x00000040;
+          freeSwapSpaceSize_ = value;
+          onChanged();
+          return this;
+        }
+        /**
+         * <code>optional double freeSwapSpaceSize = 7;</code>
+         */
+        public Builder clearFreeSwapSpaceSize() {
+          bitField0_ = (bitField0_ & ~0x00000040);
+          freeSwapSpaceSize_ = 0D;
+          onChanged();
+          return this;
+        }
+
+        // optional string hostname = 8;
+        private java.lang.Object hostname_ = "";
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public boolean hasHostname() {
+          return ((bitField0_ & 0x00000080) == 0x00000080);
+        }
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public java.lang.String getHostname() {
+          java.lang.Object ref = hostname_;
+          if (!(ref instanceof java.lang.String)) {
+            java.lang.String s = ((com.google.protobuf.ByteString) ref)
+                .toStringUtf8();
+            hostname_ = s;
+            return s;
+          } else {
+            return (java.lang.String) ref;
+          }
+        }
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public com.google.protobuf.ByteString
+            getHostnameBytes() {
+          java.lang.Object ref = hostname_;
+          if (ref instanceof String) {
+            com.google.protobuf.ByteString b = 
+                com.google.protobuf.ByteString.copyFromUtf8(
+                    (java.lang.String) ref);
+            hostname_ = b;
+            return b;
+          } else {
+            return (com.google.protobuf.ByteString) ref;
+          }
+        }
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public Builder setHostname(
+            java.lang.String value) {
+          if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000080;
+          hostname_ = value;
+          onChanged();
+          return this;
+        }
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public Builder clearHostname() {
+          bitField0_ = (bitField0_ & ~0x00000080);
+          hostname_ = getDefaultInstance().getHostname();
+          onChanged();
+          return this;
+        }
+        /**
+         * <code>optional string hostname = 8;</code>
+         */
+        public Builder setHostnameBytes(
+            com.google.protobuf.ByteString value) {
+          if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000080;
+          hostname_ = value;
+          onChanged();
+          return this;
+        }
+
         // @@protoc_insertion_point(builder_scope:CubeVisitResponse.Stats)
       }
 
@@ -3224,17 +3659,19 @@ public final class CubeVisitProtos {
       "ubeVisitRequest\022\020\n\010behavior\030\001 \002(\t\022\025\n\rgtS" +
       "canRequest\030\002 \002(\014\022\024\n\014hbaseRawScan\030\003 
\002(\014\0223" +
       "\n\020hbaseColumnsToGT\030\004 \003(\0132\031.CubeVisitRequ" +
-      "est.IntList\032\027\n\007IntList\022\014\n\004ints\030\001 
\003(\005\"\304\001\n" +
+      "est.IntList\032\027\n\007IntList\022\014\n\004ints\030\001 
\003(\005\"\251\002\n" +
       "\021CubeVisitResponse\022\026\n\016compressedRows\030\001 \002" +
       "(\014\022\'\n\005stats\030\002 \002(\0132\030.CubeVisitResponse.St" +
-      "ats\032n\n\005Stats\022\030\n\020serviceStartTime\030\001 
\001(\003\022\026",
-      "\n\016serviceEndTime\030\002 \001(\003\022\027\n\017scannedRowCoun" +
-      "t\030\003 \001(\005\022\032\n\022aggregatedRowCount\030\004 
\001(\0052F\n\020C" +
-      "ubeVisitService\0222\n\tvisitCube\022\021.CubeVisit" +
-      "Request\032\022.CubeVisitResponseB`\nEorg.apach" +
-      "e.kylin.storage.hbase.cube.v2.coprocesso" +
-      "r.endpoint.generatedB\017CubeVisitProtosH\001\210" +
-      "\001\001\240\001\001"
+      "ats\032\322\001\n\005Stats\022\030\n\020serviceStartTime\030\001 
\001(\003\022",
+      "\026\n\016serviceEndTime\030\002 \001(\003\022\027\n\017scannedRowCou" +
+      "nt\030\003 \001(\005\022\032\n\022aggregatedRowCount\030\004 
\001(\005\022\025\n\r" +
+      "systemCpuLoad\030\005 \001(\001\022\036\n\026freePhysicalMemor" +
+      "ySize\030\006 \001(\001\022\031\n\021freeSwapSpaceSize\030\007 
\001(\001\022\020" +
+      "\n\010hostname\030\010 \001(\t2F\n\020CubeVisitService\0222\n\t" +
+      "visitCube\022\021.CubeVisitRequest\032\022.CubeVisit" +
+      "ResponseB`\nEorg.apache.kylin.storage.hba" +
+      "se.cube.v2.coprocessor.endpoint.generate" +
+      "dB\017CubeVisitProtosH\001\210\001\001\240\001\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner 
assigner =
       new 
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -3264,7 +3701,7 @@ public final class CubeVisitProtos {
           internal_static_CubeVisitResponse_Stats_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_CubeVisitResponse_Stats_descriptor,
-              new java.lang.String[] { "ServiceStartTime", "ServiceEndTime", 
"ScannedRowCount", "AggregatedRowCount", });
+              new java.lang.String[] { "ServiceStartTime", "ServiceEndTime", 
"ScannedRowCount", "AggregatedRowCount", "SystemCpuLoad", 
"FreePhysicalMemorySize", "FreeSwapSpaceSize", "Hostname", });
           return null;
         }
       };

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9ac673a2/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/protobuf/CubeVisit.proto
----------------------------------------------------------------------
diff --git 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/protobuf/CubeVisit.proto
 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/protobuf/CubeVisit.proto
index 4ac6414..a6ad308 100644
--- 
a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/protobuf/CubeVisit.proto
+++ 
b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/coprocessor/endpoint/protobuf/CubeVisit.proto
@@ -27,6 +27,10 @@ message CubeVisitResponse {
         optional int64 serviceEndTime = 2;
         optional int32 scannedRowCount = 3;
         optional int32 aggregatedRowCount = 4;
+        optional double systemCpuLoad = 5;
+        optional double freePhysicalMemorySize = 6;
+        optional double freeSwapSpaceSize = 7;
+        optional string hostname = 8;
     }
     required bytes compressedRows = 1;
     required Stats stats = 2;

Reply via email to