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

Hemanth Yamijala commented on ATLAS-571:
----------------------------------------

Change impact:

* When {{AtlasClient}} is started in HA mode, it needs to find the active 
instance. This can be done by querying Zookeeper or by enhancing the admin 
status API of ATLAS-513 to return the current active server address.
* During course of operation of a client, an Active instance could be brought 
down. This will cause a Jersey {{ClientHandlerException}}. If this occurs, the 
client can detect the new active instance again from Zookeeper.
* The same can be done if the client gets a response with status code 
SERVICE_UNAVAILABLE (which can happen during transitionary states).
* I tested GETs and POSTs using {{AtlasClient}} APIs pointed to a passive 
instance. These are automatically redirected to the active, and the Jersey 
client is automatically handling them. This is as per the default value for 
following redirects as documented here: 
https://jersey.java.net/apidocs/1.19/jersey/com/sun/jersey/api/client/config/ClientConfig.html#PROPERTY_FOLLOW_REDIRECTS.
 This does mean that an AtlasClient created pointing to a passive instance will 
continue to query the passive (and get automatically redirected) until one of 
the errors mentioned above occurs. In Jersey 2.x, there seems to be ways of 
detected the redirected location (JERSEY-1611). However, we could probably take 
this enhancement later.

I will continue implementation on these lines. Please let me know if anyone has 
comments.

> Modify Atlas client for necessary changes in context of HA
> ----------------------------------------------------------
>
>                 Key: ATLAS-571
>                 URL: https://issues.apache.org/jira/browse/ATLAS-571
>             Project: Atlas
>          Issue Type: Sub-task
>            Reporter: Hemanth Yamijala
>            Assignee: Hemanth Yamijala
>
> In ATLAS-511, we are introducing mechanisms to handle automated failover and 
> also redirecting of requests etc. This JIRA is to test and make necessary 
> changes to the AtlasClient class to take advantage of these changes and 
> behave in an optimal manner. This implementation could also serve as a model 
> for others who are writing their own clients against the Atlas API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to