Package com.linkedin.venice.helix
Class ZkAllowlistAccessor
java.lang.Object
com.linkedin.venice.helix.ZkAllowlistAccessor
- All Implemented Interfaces:
AllowlistAccessor
,Closeable
,AutoCloseable
Class used to access to the allowlist stored in ZK. As operating allowlist should happen very rarely, all of
request will hit ZK directly without cache.
-
Constructor Summary
ConstructorDescriptionZkAllowlistAccessor
(String zkAddress) ZkAllowlistAccessor
(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInstanceToAllowList
(String clusterName, String helixNodeId) Add the given helix nodeId into the allowlist in ZK.void
close()
getAllowList
(String clusterName) Get all helix nodeIds in the allowlist of the given cluster from ZK.boolean
isInstanceInAllowlist
(String clusterName, String helixNodeId) Judge whether the given helix nodeId is in the allowlist or not.void
removeInstanceFromAllowList
(String clusterName, String helixNodeId) Remove the given helix nodeId from the allowlist in ZK.
-
Constructor Details
-
ZkAllowlistAccessor
public ZkAllowlistAccessor(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer) -
ZkAllowlistAccessor
-
-
Method Details
-
isInstanceInAllowlist
Judge whether the given helix nodeId is in the allowlist or not.- Specified by:
isInstanceInAllowlist
in interfaceAllowlistAccessor
-
getAllowList
Get all helix nodeIds in the allowlist of the given cluster from ZK.- Specified by:
getAllowList
in interfaceAllowlistAccessor
-
addInstanceToAllowList
Add the given helix nodeId into the allowlist in ZK.- Specified by:
addInstanceToAllowList
in interfaceAllowlistAccessor
-
removeInstanceFromAllowList
Remove the given helix nodeId from the allowlist in ZK.- Specified by:
removeInstanceFromAllowList
in interfaceAllowlistAccessor
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-