-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-23994:Add WebUI to Canary #1292
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using e.printStackTrace directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using e.printStackTrace directly?
yes, It's a mistake
@@ -274,16 +303,50 @@ public void publishReadTiming(String znode, String server, long msTime) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare as ConcurrentMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean change
Map<ServerName, LongAddr>
toConcurrentMap<ServerName, LongAddr>
, and also for the aboveregionMap
. Not a question why you useConcurrentHashMap
...
Ok. It's done
@@ -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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to not add these configurations in HConstants? Just put them in the CanaryTool class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to not add these configurations in HConstants? Just put them in the CanaryTool class?
ok, I will modify the code here
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
fc29b87
to
717fb3f
Compare
🎊 +1 overall
This message was automatically generated. |
Oh, please fix the checkstyle issues? |
🎊 +1 overall
This message was automatically generated. |
Ok I will handle it |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could skip these warnings (and the whole function body) when HBASE_CANARY_INFO_PORT == -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when
sink == null
when 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well print out the full socket address (bind address:port)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No assertions at all? Is there nothing to verify within the rendered template output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
andregionInfo1,2
in the rendered template output?
Assertions have been added to the new commit
If you have time to make a PR vs. branch-2, I'd take it for 2.3 :) |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Thank you for the modification comments given above, I am happy to make a PR vs. branch-2 |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…CanaryStatusServlet)
Only found tabs in the Jamon file, and have purged |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
HBASE-23994: Add WebUI to Canary Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
This reverts commit daf79de.
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
No description provided.