Enum VeniceSystemStoreType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<VeniceSystemStoreType>

    public enum VeniceSystemStoreType
    extends java.lang.Enum<VeniceSystemStoreType>
    Enum used to differentiate the different types of Venice system stores when access their metadata. Currently only the store metadata system stores are treated differently because they are sharing metadata in Zookeeper. Future system store types should be added here especially if they also would like to share metadata in Zookeeper.
    • Method Detail

      • values

        public static VeniceSystemStoreType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (VeniceSystemStoreType c : VeniceSystemStoreType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static VeniceSystemStoreType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getPrefix

        public java.lang.String getPrefix()
      • isStoreZkShared

        public boolean isStoreZkShared()
      • getKeySchema

        public java.lang.String getKeySchema()
      • getValueSchema

        public java.lang.String getValueSchema()
      • getZkSharedStoreName

        public java.lang.String getZkSharedStoreName()
      • getZkSharedStoreNameInCluster

        public java.lang.String getZkSharedStoreNameInCluster​(java.lang.String clusterName)
      • isNewMedataRepositoryAdopted

        public boolean isNewMedataRepositoryAdopted()
      • getSystemStoreName

        public java.lang.String getSystemStoreName​(java.lang.String regularStoreName)
        This function is to compose a system store name according to the current system store type and the regular store name.
        Parameters:
        regularStoreName -
        Returns:
      • isSystemStore

        public boolean isSystemStore​(java.lang.String storeName)
        This function is used to check whether the passed store name belongs to the current system store type.
        Parameters:
        storeName -
        Returns:
      • extractRegularStoreName

        public java.lang.String extractRegularStoreName​(java.lang.String systemStoreName)
        This function is to extract the regular store name from the system store name.
        Parameters:
        systemStoreName -
        Returns:
      • getClientAccessMethod

        public Method getClientAccessMethod()
      • generateSystemStoreAclBinding

        public AclBinding generateSystemStoreAclBinding​(AclBinding regularStoreAclBinding)
        Generate the corresponding AclBinding for a given Venice system store type based on the corresponding Venice store's Read acl. i.e. all principals that are allowed to read a Venice store is allowed to read or write to its corresponding Venice system store topics.
        Parameters:
        regularStoreAclBinding - of the associated Venice store.
        Returns:
        AclBinding to get read or write access for the corresponding Venice system store.
      • getSystemStoreAclFromTopicAcl

        public static AclBinding getSystemStoreAclFromTopicAcl​(AclBinding systemStoreTopicAclBinding)
        AclBinding of system store resource retrieved from authorizer service will not have the system store specific Method types and instead will either be READ or WRITE. This method transform a kafka topic AclBinding to a system store AclBinding.
        Parameters:
        systemStoreTopicAclBinding - AclBinding for the system store's kafka topic.
        Returns:
      • getSystemStoreType

        public static VeniceSystemStoreType getSystemStoreType​(java.lang.String storeName)
      • getEnabledSystemStoreTypes

        public static java.util.List<VeniceSystemStoreType> getEnabledSystemStoreTypes​(Store regularStore)
        Get a list of enabled Venice system store types based on the given regular Venice Store object.
        Parameters:
        regularStore - object to generate a list of enabled system store types with.
        Returns:
        a list of enabled VeniceSystemStoreType
      • extractUserStoreName

        public static java.lang.String extractUserStoreName​(java.lang.String storeName)
        Extract the corresponding user store name from the given store name if it happens to be a system store.