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

Sijie Guo commented on BOOKKEEPER-261:
--------------------------------------

Thanks Aniruddha.

some comments on your patch.

from the patch, seems that get hub info action is put as part of publisher. I 
don't think it is a good idea to put get hub info in publisher. actually get 
hub info action is a kind of admin action. How about putting it in an admin 
interface as below? I am not very sure is *Admin* a good name due to my poor 
english. maybe you could have a better name for it.

{code}
public interface Admin {

    public String getRegion();

}

public interface Client {

    public Admin getAdmin();

}
{code}

besides that hubInfo is a kind of Nouns, not a verb, while publish/subscribe 
are verbs. So I would suggest changing it to 'GetHubInfo'. 

HedwigClientImpl:

why return null instead of throwing exception? It would be easy to client to 
know what happened than hiding it.

HubInfoHandler:

it would be better to include Apache license in the header of the file.

{quote}
String infoRequest = cfg.getMyRegion();
{quote}

it would be better to have a meaningful name more than 'infoRequest'.

BTW, it would be better that if you could put the patch on review board, which 
might be easy for reviewing. :) https://reviews.apache.org/dashboard/
                
> Let a hedwig-client discover the region of the hedwig-server cluster it is 
> connected to
> ---------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-261
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-261
>             Project: Bookkeeper
>          Issue Type: Improvement
>          Components: hedwig-client
>            Reporter: Aniruddha
>            Assignee: Aniruddha
>            Priority: Minor
>         Attachments: BK-261.patch
>
>
> Currently, the client-server protocol doesn't let a Hedwig client discover 
> the region that it is a part of. There are a couple of approaches that I 
> could think of to do this - 1) The client publishes and subscribes to a 
> randomly generated topic-name. It can then set it's region to the srcRegion 
> of the received message. 2) Have a discovery operation akin to the 
> publish/subscribe operations and let the server respond to this with 
> information about itself (region name and any other information it might want 
> to pass on to the client). I personally prefer (2). I could produce a patch 
> if the approach looks good. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to