[GitHub] [hbase] Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to Canary

2020-04-08 Thread GitBox
Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to 
Canary
URL: https://github.com/apache/hbase/pull/1292#discussion_r405892777
 
 

 ##
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
 ##
 @@ -274,16 +303,50 @@ public void publishReadTiming(String znode, String 
server, long msTime) {
 private Map perTableReadLatency = new HashMap<>();
 private LongAdder writeLatency = new LongAdder();
 private final Map> regionMap = new 
ConcurrentHashMap<>();
+private Map perServerFailuresCount = new 
ConcurrentHashMap<>();
 
 Review comment:
   I mean change `Map` to `ConcurrentMap`, and also for the above `regionMap`. Not a question why you use 
`ConcurrentHashMap`...


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [hbase] Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to Canary

2020-03-25 Thread GitBox
Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to 
Canary
URL: https://github.com/apache/hbase/pull/1292#discussion_r398291858
 
 

 ##
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
 ##
 @@ -274,16 +303,50 @@ public void publishReadTiming(String znode, String 
server, long msTime) {
 private Map perTableReadLatency = new HashMap<>();
 private LongAdder writeLatency = new LongAdder();
 private final Map> regionMap = new 
ConcurrentHashMap<>();
+private Map perServerFailuresCount = new 
ConcurrentHashMap<>();
 
 Review comment:
   Declare as ConcurrentMap?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [hbase] Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to Canary

2020-03-25 Thread GitBox
Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to 
Canary
URL: https://github.com/apache/hbase/pull/1292#discussion_r398291625
 
 

 ##
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
 ##
 @@ -123,6 +127,31 @@
 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)
 public class CanaryTool implements Tool, Canary {
 
+
+  private void putUpWebUI() throws IOException {
+if (zookeeperMode) {
+  LOG.info("WebUI is not supported in Zookeeper mode");
+} else if (regionServerMode) {
+  LOG.info("WebUI is not supported in RegionServer mode");
+} else {
+  Configuration conf = new Configuration();
+  int port = conf.getInt(HConstants.HBASE_CANARY_INFO_PORT, 
DEFAULT_CANARY_INFOPORT);
+  // -1 is for disabling info server
+  if (port < 0) return;
+  String addr = conf.get(HBASE_CANARY_INFO_BINDADDRESS, "0.0.0.0");
+  try {
+InfoServer infoServer = new InfoServer("canary", addr, port, false, 
conf);
+infoServer.addUnprivilegedServlet("canary", "/canary-status", 
CanaryStatusServlet.class);
+infoServer.setAttribute("sink", this.sink);
+infoServer.start();
+LOG.info("Bind Canary http info server to port: " + port);
+  } catch (BindException e) {
+e.printStackTrace();
 
 Review comment:
   Avoid using e.printStackTrace directly?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [hbase] Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to Canary

2020-03-25 Thread GitBox
Apache9 commented on a change in pull request #1292: HBASE-23994:Add WebUI to 
Canary
URL: https://github.com/apache/hbase/pull/1292#discussion_r398292304
 
 

 ##
 File path: hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
 ##
 @@ -1464,6 +1464,12 @@
 
   public static final String HBASE_CANARY_READ_RAW_SCAN_KEY = 
"hbase.canary.read.raw.enabled";
 
+  public static final String HBASE_CANARY_INFO_PORT = "hbase.canary.info.port";
 
 Review comment:
   Is it possible to not add these configurations in HConstants? Just put them 
in the CanaryTool class?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services