Class VeniceProperties

java.lang.Object
com.linkedin.venice.utils.VeniceProperties
All Implemented Interfaces:
Serializable

public class VeniceProperties extends Object implements Serializable
See Also:
  • Constructor Details

  • Method Details

    • empty

      public static VeniceProperties empty()
    • getPropertiesCopy

      public Properties getPropertiesCopy()
    • keySet

      public Set<String> keySet()
    • containsKey

      public boolean containsKey(String k)
    • clipAndFilterNamespace

      public VeniceProperties clipAndFilterNamespace(String nameSpace)
      This method looks for all properties that begins with the given namespace. Once those properties are identified it removes the namespace and returns the properties. This enables support of dynamic kafka configurations. All Kafka Properties can follow an convention of namespace and the properties are extracted and supplied to the Kafka Producer/Consumer.
      Parameters:
      nameSpace - namespace to look for
      Returns:
      properties matches a namespace, but after removing the namespace.
    • getStoreProperties

      public VeniceProperties getStoreProperties(String storeName)
      Get store related properties. properties that do not begin with store- are considered common to all stores. out of properties that begins with store- , only properties that matches the store name are related to current store. These matching properties override the base properties if they are present.
      Parameters:
      storeName - name of the store
      Returns:
      Properties for the current store.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean prettyPrint)
    • storeFlattened

      public void storeFlattened(File file) throws IOException
      Store all properties in a file
      Parameters:
      file - to store into
      Throws:
      IOException - If there is an error writing
    • storeFlattened

      public void storeFlattened(OutputStream out) throws IOException
      Store all properties to an OutputStream
      Parameters:
      out - The stream to write to
      Throws:
      IOException - If there is an error writing
    • getString

      public String getString(String key, Supplier<String> defaultValue)
    • getString

      public String getString(String key, String defaultValue)
    • getStringWithAlternative

      public String getStringWithAlternative(String preferredKey, String altKey, String defaultValue)
    • getString

      public String getString(String key)
    • getStringWithAlternative

      public String getStringWithAlternative(String preferredKey, String altKey)
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
    • getBooleanWithAlternative

      public boolean getBooleanWithAlternative(String preferredKey, String altKey, boolean defaultValue)
    • getBoolean

      public boolean getBoolean(String key)
    • getLong

      public long getLong(String name, long defaultValue)
    • getLong

      public long getLong(String name)
    • getInt

      public int getInt(String name, int defaultValue)
    • getInt

      public int getInt(String name)
    • getOptionalInt

      public Optional<Integer> getOptionalInt(String name)
    • getDouble

      public double getDouble(String name, double defaultValue)
    • getDouble

      public double getDouble(String name)
    • getSizeInBytes

      public long getSizeInBytes(String name, long defaultValue)
    • getSizeInBytes

      public long getSizeInBytes(String name)
    • convertSizeFromLiteral

      public static long convertSizeFromLiteral(String size)
    • getList

      public List<String> getList(String key, List<String> defaultValue)
    • getListWithAlternative

      public List<String> getListWithAlternative(String preferredKey, String altKey, List<String> defaultValue)
    • getList

      public List<String> getList(String key)
    • getMap

      public Map<String,String> getMap(String key, Map<String,String> defaultValue)
    • getMap

      public Map<String,String> getMap(String key)
    • toProperties

      public Properties toProperties()
    • isEmpty

      public boolean isEmpty()
    • getAsMap

      public Map<String,String> getAsMap()