Uh oh!
There was an error while loading. Please reload this page.
HBASE-23994:Add WebUI to Canary - #1292
Conversation
Apache-HBase
commented
Mar 16, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Mar 16, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Mar 16, 2020
🎊 +1 overall
This message was automatically generated. |
| infoServer.start(); | ||
| LOG.info("Bind Canary http info server to port: " + port); | ||
| } catch (BindException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Avoid using e.printStackTrace directly?
There was a problem hiding this comment.
Avoid using e.printStackTrace directly?
yes, It's a mistake
| private Map<String, LongAdder> perTableReadLatency = new HashMap<>(); | ||
| private LongAdder writeLatency = new LongAdder(); | ||
| private final Map<String, List<RegionTaskResult>> regionMap = new ConcurrentHashMap<>(); | ||
| private Map<ServerName, LongAdder> perServerFailuresCount = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Declare as ConcurrentMap?
I do this for the following reasons:
- At the beginning of the sniffing, we will clear the Map
- Only Failures Server or Failures table will put an element into the map
- The sniffing process is concurrent with multiple threads
I do n’t know if I ’m doing it right. If not, any suggestions?
There was a problem hiding this comment.
I mean change Map<ServerName, LongAddr> to ConcurrentMap<ServerName, LongAddr>, and also for the above regionMap. Not a question why you use ConcurrentHashMap...
There was a problem hiding this comment.
I mean change
Map<ServerName, LongAddr>toConcurrentMap<ServerName, LongAddr>, and also for the aboveregionMap. Not a question why you useConcurrentHashMap...
Ok. It's done
| 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"; |
There was a problem hiding this comment.
Is it possible to not add these configurations in HConstants? Just put them in the CanaryTool class?
There was a problem hiding this comment.
Is it possible to not add these configurations in HConstants? Just put them in the CanaryTool class?
ok, I will modify the code here
Apache-HBase
commented
Mar 31, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Mar 31, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Mar 31, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 9, 2020
🎊 +1 overall
This message was automatically generated. |
Apache9
commented
Apr 9, 2020
Oh, please fix the checkstyle issues? |
Apache-HBase
commented
Apr 9, 2020
🎊 +1 overall
This message was automatically generated. |
GeorryHuang
commented
Apr 9, 2020
Ok I will handle it |
Apache-HBase
commented
Apr 9, 2020
🎊 +1 overall
This message was automatically generated. |
ndimiduk
left a comment
There was a problem hiding this comment.
Small comments.
Nice addition :)
| private void putUpWebUI() throws IOException { | ||
| if (zookeeperMode) { | ||
| LOG.info("WebUI is not supported in Zookeeper mode"); |
There was a problem hiding this comment.
nit: could skip these warnings (and the whole function body) when HBASE_CANARY_INFO_PORT == -1
There was a problem hiding this comment.
nit: could skip these warnings (and the whole function body) when
HBASE_CANARY_INFO_PORT == -1
will deal with it later
| CanaryTool.RegionStdOutSink sink = | ||
| (CanaryTool.RegionStdOutSink) getServletContext().getAttribute( | ||
| "sink"); | ||
| assert sink != null : "No tool in context!"; |
There was a problem hiding this comment.
What happens when sink == null when running without assertions? A nasty NPE? Would be better to handle null properly.
There was a problem hiding this comment.
What happens when
sink == nullwhen running without assertions? A nasty NPE? Would be better to handle null properly.
I changed it to throw a ServletException instead if sink == null.
| infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class); | ||
| infoServer.setAttribute("sink", this.sink); | ||
| infoServer.start(); | ||
| LOG.info("Bind Canary http info server to port: " + port); |
There was a problem hiding this comment.
Might as well print out the full socket address (bind address:port)
There was a problem hiding this comment.
Might as well print out the full socket address (bind address:port)
Good iead!
| regionStdOutSink.publishReadFailure(serverName1, regionInfo1, new IOException()); | ||
| regionStdOutSink.publishWriteFailure(serverName2, regionInfo2, new IOException()); | ||
| CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); | ||
| tmpl.render(new StringWriter(), regionStdOutSink); |
There was a problem hiding this comment.
No assertions at all? Is there nothing to verify within the rendered template output?
There was a problem hiding this comment.
No assertions at all? Is there nothing to verify within the rendered template output?
I just refer to the code of TestMasterStatusServlet. TestMasterStatusServlet also has no assertions. I am not sure how to test these html pages, any good suggestions? I can modify it as suggested
There was a problem hiding this comment.
This is just smoke-testing that the UI works and puts up something close to expected, right? How about a simple string match looking for the values of serverName1,2 and regionInfo1,2 in the rendered template output?
There was a problem hiding this comment.
This is just smoke-testing that the UI works and puts up something close to expected, right? How about a simple string match looking for the values of
serverName1,2andregionInfo1,2in the rendered template output?
Assertions have been added to the new commit
ndimiduk
commented
Apr 9, 2020
If you have time to make a PR vs. branch-2, I'd take it for 2.3 :) |
Apache-HBase
commented
Apr 9, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 9, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 9, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 10, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 10, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 10, 2020
🎊 +1 overall
This message was automatically generated. |
GeorryHuang
commented
Apr 10, 2020
Thank you for the modification comments given above, I am happy to make a PR vs. branch-2 |
Apache-HBase
commented
Apr 10, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 10, 2020
🎊 +1 overall
This message was automatically generated. |
…CanaryStatusServlet)
GeorryHuang
commented
Apr 13, 2020
Only found tabs in the Jamon file, and have purged |
Apache-HBase
commented
Apr 13, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 13, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 13, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 13, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 14, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Apr 14, 2020
🎊 +1 overall
This message was automatically generated. |
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
No description provided.