You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Chinmay Kulkarni (JIRA)" <ji...@apache.org> on 2017/09/06 00:53:00 UTC

[jira] [Comment Edited] (HBASE-18762) Canary sink type cast error

    [ https://issues.apache.org/jira/browse/HBASE-18762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16154649#comment-16154649 ] 

Chinmay Kulkarni edited comment on HBASE-18762 at 9/6/17 12:53 AM:
-------------------------------------------------------------------

We can add simple type checks before type casting the provided sink, but this will still not really solve the problem, since we are allowed to provide inconsistent mode and sink types when running Canary. For example, we can specify no mode in the command-line arguments and specify a sink. In this case, what behavior should be expected? Should we ignore the mode in case it is not provided and just create a monitor of the same type as the sink or should we force the user to specify a mode?

Alternatively, if the user provides the '-zookeeper' option, but provides a sink of type RegionServerMonitor, what behavior should be expected? Should we override the mode? I think it does not make sense to ask the user to provide both the mode as well as the sink since there are many possibilities for such problems, but I'm also not sure why we have asked for both in the first case. Any ideas/suggestions are welcome.
[~apurtell] any ideas?


was (Author: ckulkarni):
We can add simple type checks before type casting the provided sink, but this will still not really solve the problem, since we are allowed to provide inconsistent mode and sink types when running Canary. For example, we can specify no mode in the command-line arguments and specify a sink. In this case, what behavior should be expected? Should we ignore the mode in case it is not provided and just create a monitor of the same type as the sink or should we force the user to specify a mode?

Alternatively, if the user provides the '-zookeeper' option, but provides a sink of type RegionServerMonitor, what behavior should be expected? Should we override the mode? I think it does not make sense to ask the user to provide both the mode as well as the sink since there are many possibilities for such problems, but I'm also not sure why we have asked for both in the first case. Any ideas/suggestions are welcome.
[~apurtell]

> Canary sink type cast error
> ---------------------------
>
>                 Key: HBASE-18762
>                 URL: https://issues.apache.org/jira/browse/HBASE-18762
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Chinmay Kulkarni
>            Assignee: Chinmay Kulkarni
>
> When running the main method of Canary.java, we see the following error:
> Exception in thread "main" java.lang.ClassCastException: org.apache.hadoop.hbase.tool.Canary$RegionServerStdOutSink cannot be cast to org.apache.hadoop.hbase.tool.Canary$RegionStdOutSink
> 	at org.apache.hadoop.hbase.tool.Canary.newMonitor(Canary.java:911)
> 	at org.apache.hadoop.hbase.tool.Canary.run(Canary.java:796)
> 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
> 	at org.apache.hadoop.hbase.tool.Canary.main(Canary.java:1571)
> This happens because we typecast the sink depending on the mode (zookeeper mode/region server mode) that Canary is configured in. In case no mode is specified, we typecast the sink into _RegionStdOutSink_. In general, it is possible to provide inconsistent mode and sink types while running Canary. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)