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

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

we need javadoc for getClusterStatus(). Specially explain what cluster status 
will return.

{code}
public static ClusterStatusProtos.Option toOption(ClusterStatus.Option option) {
public static EnumSet<Option> getOptions(List<ClusterStatusProtos.Option> 
options) {
{code}
For readability, It would be better to have naming "toOptions".

{code}
+      default: throw new IllegalArgumentException("Invalid status: " + option);
{code}
status -> option

{code}
+  public static GetClusterStatusRequest 
buildGetClusterStatusRequest(EnumSet<Option> options) {
+    GetClusterStatusRequest.Builder request = 
GetClusterStatusRequest.newBuilder();
+    for (Option opt : options) {
+      request.addOptions(ProtobufUtil.toOption(opt));
+    }
+    return request.build();
{code}
Why not add a helper method in ProtobufUtil? List<ClusterStatusProtos.Option> 
toOptions(EnumSet<Option> options)

> 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, 
> HBASE-18621.master.004.patch, HBASE-18621.master.005.patch, 
> HBASE-18621.master.006.patch, HBASE-18621.master.007.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