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

Chia-Ping Tsai commented on HBASE-18621:
----------------------------------------

The changes looks like this.
{code}
enum Option {
  HBASE_VERSION = 0;
  LIVE_SERVERS = 1;
  DEAD_SERVERS = 2;
  REGIONS_STATE = 3;
  MASTER_COPROCESSORS = 4;
  MASTER = 5;
  BACKUP_MASTERS = 6;
  BALANCER_ON = 7;
}

message Options {
  repeated Option options = 1;
}
{code}
As far as I know, the message size will increase because the *repeated* will 
introduce a List object. But on the other hand, we can use Switch statement in 
converting the proto's object to our object.
{code}
    for (ClusterStatusProtos.Option option : options.getOptionsList()) {
      switch (option) {
        
      }
    }
{code}
Personally, i prefer this coding style. This change is not, however, required.

> Refactor ClusterOptions before applying to code base
> ----------------------------------------------------
>
>                 Key: HBASE-18621
>                 URL: https://issues.apache.org/jira/browse/HBASE-18621
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Reid Chan
>            Assignee: Reid Chan
>         Attachments: HBASE-18621.master.001.patch, 
> HBASE-18621.master.002.patch, HBASE-18621.master.003.patch
>
>
> So far, ClusterStatus.Options is not so clean that can be applied to code 
> base.
> Refactoring it before next move.



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

Reply via email to