[
https://issues.apache.org/jira/browse/GEODE-2812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980647#comment-15980647
]
ASF GitHub Bot commented on GEODE-2812:
---------------------------------------
GitHub user masaki-yamakawa opened a pull request:
https://github.com/apache/geode/pull/475
GEODE-2812: Add API to get list of live locators
There is a Geode cluster using a logical member group, and from the client,
the connection pool to the logical member group is connected using the
PoolFactory API at the timing when connection becomes necessary.
At this time, even though the locator that was running at the initial
connection stops due to reasons such as regular maintenance etc., even if the
alternate locator is started before maintenance, I can not connect to the
locator in the static initial list.
1. Client side:PoolManager.createFactory().addLocator("localhost",
10334).setServerGroup("GroupA").create("pool1");
2. Geode cluster:start locator[localhost:10335].
3. Geode cluster:stop locator[localhost:10334].
4. Client side:PoolManager.createFactory().addLocator("localhost",
10334).setServerGroup("GroupB").create("pool2");
Therefore, I would like to decide the connection destination based on the
live locator list of another logical member group.
I added an API that can get the list of live locators from the Pool. Use
the API as follows:
```java
Pool pool = PoolManager.createFactory()
.addLocator("localhost", 10334)
.setSubscriptionEnabled(true).setServerGroup("GroupA")
.create("GroupAPool");
List<InetSocketAddress> = pool.getLiveLocators();
```
> Note:
> The list of live locators gets the result of the UpdateLocatorListTask
periodically running in AutoConnectionSourceImpl.
> Therefore, whether or not it is alive will cause a time lag, depending on
the task execution interval.
> Also, the result of ExplicitConnectionSourceImpl without using a locator
is always empty.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/masaki-yamakawa/geode feature/GEODE-2812
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/geode/pull/475.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #475
----
commit c3500aeb7c220918d11ed1329b89632b517b4af6
Author: masaki.yamakawa <[email protected]>
Date: 2017-04-24T02:20:42Z
GEODE-2812: Add API to get list of live locators
There is a Geode cluster using a logical member group, and from the
client, the connection pool to the logical member group is connected
using the PoolFactory API at the timing when connection becomes
necessary.
At this time, even though the locator that was running at the initial
connection stops due to reasons such as regular maintenance etc., even
if the alternate locator is started before maintenance, I can not
connect to the locator in the static initial list.
1. Client side:PoolManager.createFactory().addLocator("localhost",
10334).setServerGroup("GroupA").create("pool1");
2. Geode cluster:start locator[localhost:10335].
3. Geode cluster:stop locator[localhost:10334].
4. Client side:PoolManager.createFactory().addLocator("localhost",
10334).setServerGroup("GroupB").create("pool2");
Therefore, I would like to decide the connection destination based on
the live locator list of another logical member group.
I added an API that can get the list of live locators from the Pool. Use
the API as follows:
Pool pool = PoolManager.createFactory()
.addLocator("localhost", 10334)
.setSubscriptionEnabled(true).setServerGroup("GroupA")
.create("GroupAPool");
List<InetSocketAddress> = pool.getLiveLocators();
Note:
The list of live locators gets the result of the UpdateLocatorListTask
periodically running in AutoConnectionSourceImpl.
Therefore, whether or not it is alive will cause a time lag, depending
on the task execution interval.
Also, the result of ExplicitConnectionSourceImpl without using a locator
is always empty.
----
> Add API to get list of live locators
> ------------------------------------
>
> Key: GEODE-2812
> URL: https://issues.apache.org/jira/browse/GEODE-2812
> Project: Geode
> Issue Type: Improvement
> Components: client/server
> Reporter: Masaki Yamakawa
>
> There is a Geode cluster using a logical member group, and from the client,
> the connection pool to the logical member group is connected using the
> PoolFactory API at the timing when connection becomes necessary.
> At this time, even though the locator that was running at the initial
> connection stops due to reasons such as regular maintenance etc., even if the
> alternate locator is started before maintenance, I can not connect to the
> locator in the static initial list.
> # Client side:PoolManager.createFactory().addLocator("localhost",
> 10334).setServerGroup("GroupA").create("pool1");
> # Geode cluster:start locator [ localhost:10335 ].
> # Geode cluster:stop locator [ localhost:10334 ].
> # Client side:PoolManager.createFactory().addLocator("localhost",
> 10334).setServerGroup("GroupB").create("pool2");
> Therefore, I would like to decide the connection destination based on the
> live locator list of another logical member group.
> I added an API that can get the list of live locators from the Pool. Use the
> API as follows:
> {code:java|borderStyle=solid}
> Pool pool = PoolManager.createFactory()
> .addLocator("localhost", 10334)
> .setSubscriptionEnabled(true).setServerGroup("GroupA")
> .create("GroupAPool");
> List<InetSocketAddress> = pool.getLiveLocators();
> {code}
> {quote}
> Note:
> The list of live locators gets the result of the UpdateLocatorListTask
> periodically running in AutoConnectionSourceImpl.
> Therefore, whether or not it is alive will cause a time lag, depending on the
> task execution interval.
> Also, the result of ExplicitConnectionSourceImpl without using a locator is
> always empty.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)