Package com.linkedin.venice.helix
Class ZkAllowlistAccessor
- java.lang.Object
-
- com.linkedin.venice.helix.ZkAllowlistAccessor
-
- All Implemented Interfaces:
AllowlistAccessor
,java.io.Closeable
,java.lang.AutoCloseable
public class ZkAllowlistAccessor extends java.lang.Object implements AllowlistAccessor
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
Constructors Constructor Description ZkAllowlistAccessor(java.lang.String zkAddress)
ZkAllowlistAccessor(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInstanceToAllowList(java.lang.String clusterName, java.lang.String helixNodeId)
Add the given helix nodeId into the allowlist in ZK.void
close()
java.util.Set<java.lang.String>
getAllowList(java.lang.String clusterName)
Get all helix nodeIds in the allowlist of the given cluster from ZK.boolean
isInstanceInAllowlist(java.lang.String clusterName, java.lang.String helixNodeId)
Judge whether the given helix nodeId is in the allowlist or not.void
removeInstanceFromAllowList(java.lang.String clusterName, java.lang.String helixNodeId)
Remove the given helix nodeId from the allowlist in ZK.
-
-
-
Constructor Detail
-
ZkAllowlistAccessor
public ZkAllowlistAccessor(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer)
-
ZkAllowlistAccessor
public ZkAllowlistAccessor(java.lang.String zkAddress)
-
-
Method Detail
-
isInstanceInAllowlist
public boolean isInstanceInAllowlist(java.lang.String clusterName, java.lang.String helixNodeId)
Judge whether the given helix nodeId is in the allowlist or not.- Specified by:
isInstanceInAllowlist
in interfaceAllowlistAccessor
-
getAllowList
public java.util.Set<java.lang.String> getAllowList(java.lang.String clusterName)
Get all helix nodeIds in the allowlist of the given cluster from ZK.- Specified by:
getAllowList
in interfaceAllowlistAccessor
-
addInstanceToAllowList
public void addInstanceToAllowList(java.lang.String clusterName, java.lang.String helixNodeId)
Add the given helix nodeId into the allowlist in ZK.- Specified by:
addInstanceToAllowList
in interfaceAllowlistAccessor
-
removeInstanceFromAllowList
public void removeInstanceFromAllowList(java.lang.String clusterName, java.lang.String helixNodeId)
Remove the given helix nodeId from the allowlist in ZK.- Specified by:
removeInstanceFromAllowList
in interfaceAllowlistAccessor
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-