ZKMetadataStore: Ignore the event for root node
Turns out Linux emits a `node created` event for the node a bit later. Therefore, even if we add a listened after creating a root node, we still may catch it in the listener
This commit is contained in:
@@ -315,6 +315,10 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif
|
||||
ChildData data = Type.NODE_DELETED.equals(type) ? oldData : newData;
|
||||
String eventPath = data.getPath();
|
||||
String eventKey = getKey(eventPath);
|
||||
if (ZookeeperMetadataStore.this.root.equals(eventKey)) {
|
||||
// Ignore the root node for metadata tree
|
||||
return;
|
||||
}
|
||||
String value = IntegrationUtils.bytesToString(data.getData(), ZookeeperMetadataStore.this.encoding);
|
||||
|
||||
switch (type) {
|
||||
|
||||
Reference in New Issue
Block a user