Andrey Belom created CURATOR-485:
------------------------------------
Summary: GroupMember API does not expose PersistentEphemeralNode
or callbacks
Key: CURATOR-485
URL: https://issues.apache.org/jira/browse/CURATOR-485
Project: Apache Curator
Issue Type: Bug
Components: Recipes
Affects Versions: 4.0.1
Environment: win7 64, curator 4.0.1, zk 3.5
Reporter: Andrey Belom
I create an instance of GroupMember using GroupMember(CuratorFramework client,
String membershipPath, String thisId) constructor, invoke GroupMember.start()
method and GroupMember.setThisData() method
depending on timing of things I sometimes get
{code:java}
Exception in thread "main" java.lang.IllegalStateException: initial create has
not been processed. Call waitForInitialCreate() to ensure.
at
org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:444)
at
org.apache.curator.framework.recipes.nodes.PersistentNode.setData(PersistentNode.java:391)
at
org.apache.curator.framework.recipes.nodes.GroupMember.setThisData(GroupMember.java:95){code}
I am sorry if I am missing something, but what API allows me to invoke
pen.waitForInitialCreate or get some sort of a callback letting me know that I
am allowed to change data?
There is a way to override newPersistentEphemeralNode() method in order to save
pen reference and invoke waitForInitialCreate after GroupMember.start() but
that does not seem right.
I am really sorry if I am missing the point of this recipe.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)