Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface AllowlistAccessor
      • 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 interface AllowlistAccessor
      • 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 interface AllowlistAccessor
      • 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 interface AllowlistAccessor
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable