kaisun2000 commented on a change in pull request #924: WIP: fix
ZkHelixPropertyStore loses Zookeeper notification issue
URL: https://github.com/apache/helix/pull/924#discussion_r401247502
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/impl/client/SharedZkClient.java
##########
@@ -112,4 +112,9 @@ public String create(final String path, Object datat,
final List<ACL> acl,
protected boolean isManagingZkConnection() {
return false;
}
+
+ // test only
+ public HelixZkClient getConnectionManager() {
+ return _connectionManager;
+ }
Review comment:
Here is the case:
test case is in package org.apache.helix.store.zk, here is the how it is
constructed.
` ZkSerializer serializer = new ZNRecordSerializer();
ZkHelixPropertyStore<ZNRecord> store =
new ZkHelixPropertyStore<>(ZK_ADDR, serializer, subRoot,
subscribedPaths);`
We need the internal shared ZkClient in the store; and further the internal
_ZkconnectionManager.
Note, ZkHelixPropertyStore uses ZkCacheBasedDataAccessor which lives in
package org.apache.helix.manager.zk;
Note, ShareZkClient and ZkConnectionManager lives in package
org.apache.helix.zookeeper.impl.client;
So the solution (in this case, but not in general) can be:
I can put the test in the org.apache.helix.zookeeper.impl.client,
zookeeper-api module
I can also initialize the HelixPropertystore like this:
1/ construct SharedZkClient
2/ construct ZkBaseDataAccessor using this sharedZkCLient.
3/ construct ZkHelixPropertyStore (using ZkBaseDataAccessor.
by making SharedZkClient's _zkConnectionManager protected, we can use it
here.
The problem is that org.apache.helix.zookeeper.impl.client is in
Zookeeper-api, we need a test scope dependency to Helix-core and Helix-common
module. Does this test dependency work here?
@lei-xia @narendly ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]