[
https://issues.apache.org/jira/browse/HBASE-18762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163952#comment-16163952
]
Andrew Purtell commented on HBASE-18762:
----------------------------------------
bq. For example, if the user provides the '-zookeeper' option and passes a
RegionSink, should we create a RegionMonitor or a ZooKeeperMonitor?
Let's not overthink this.
If the code was properly refactored, why would this happen? If the user
provides the '-zookeeper' option then we create a ZooKeeperMonitor and we
create sinks of type ZookeeperStdOutSink. Parse the command line options,
figure out what kind of class topology we want to build, then build it.
> 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)