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

Vikrant Navalgund commented on BLUR-277:
----------------------------------------

Hi Aaron,
I suppose I can do that. Here is my reasoning for the changes I made. Please 
correct me if I am wrong.
In BlurControllerServer.java:286, we are already looping on the 
zk.exists("Ephemeral node") and we caught a KeeperException for this.

With my changes:
_zookeeper.create(controllerPath, version.getBytes(), Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
    } catch (KeeperException.NodeExistsException e) {
      LOG.info("Node [{0}] already registered, skipping znode creation for 
controller path", _nodeName);        
    } catch (KeeperException e) {

I am tying the specific exception of NodeExistsException to only the persistent 
node, because the above loop at line:286 would not throw a NodeExistsException, 
does it ?
Also, since we are doing an optimistic node creation for a persistent node, is 
it not better to go ahead and create or eat the NodeExistsException instead of 
one query and one set in the worst case. 

I can have each of the node creation in a try/catch block, I suppose that would 
be a much cleaner code. 
Please let me know your thoughts.

Regards,
Vikrant

> Create an API to fetch the list of total Controller Servers in the Controller 
> Cluster.
> --------------------------------------------------------------------------------------
>
>                 Key: BLUR-277
>                 URL: https://issues.apache.org/jira/browse/BLUR-277
>             Project: Apache Blur
>          Issue Type: Sub-task
>          Components: Blur
>    Affects Versions: 0.3.0
>            Reporter: Vikrant Navalgund
>             Fix For: 0.3.0
>
>         Attachments: BLUR-259-Subtask_1-MASTER.patch
>
>   Original Estimate: 6h
>  Remaining Estimate: 6h
>
> Right now we have an API to fetch the list of online controller servers. The 
> method says getControllerServerList() which in turn gets only the online 
> list. 
> Suppose the Blur Shell needs a list of both the online and the offline 
> controller list we have no way of getting it today. This API gets the total 
> controller list and with the existing method to get the online controller 
> list, the clients can do a Set difference and get the offline list.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to