Class VeniceProperties
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.VeniceProperties
(Map<CharSequence, CharSequence> properties) VeniceProperties
(Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionclipAndFilterNamespace
(String nameSpace) Extracts properties that begin with the specified namespace.clipAndFilterNamespace
(Set<String> namespaces) Extracts properties that begin with any of the specified namespaces.boolean
static long
convertSizeFromLiteral
(String size) static VeniceProperties
empty()
boolean
getAsMap()
boolean
getBoolean
(String key) boolean
getBoolean
(String key, boolean defaultValue) boolean
getBooleanWithAlternative
(String preferredKey, String altKey, boolean defaultValue) double
double
int
int
getListWithAlternative
(String preferredKey, String altKey, List<String> defaultValue) long
long
getOptionalInt
(String name) long
getSizeInBytes
(String name) long
getSizeInBytes
(String name, long defaultValue) getStoreProperties
(String storeName) Get store related properties.getStringWithAlternative
(String preferredKey, String altKey) getStringWithAlternative
(String preferredKey, String altKey, String defaultValue) int
hashCode()
boolean
isEmpty()
keySet()
void
storeFlattened
(File file) Store all properties in a filevoid
Store all properties to anOutputStream
toString()
toString
(boolean prettyPrint)
-
Constructor Details
-
VeniceProperties
Deprecated.Useempty()
-
VeniceProperties
-
VeniceProperties
-
-
Method Details
-
empty
-
getPropertiesCopy
-
keySet
-
containsKey
-
clipAndFilterNamespace
Extracts properties that begin with the specified namespace.This method identifies all properties that start with the given namespace, removes the namespace prefix, and returns the filtered properties.
This enables support for dynamic configurations (e.g., required by Pub/Sub clients). All properties following a namespace-based convention can be extracted and used by various adapters, such as Pub/Sub Producers or Consumers.
- Parameters:
nameSpace
- The namespace to filter properties by.- Returns:
- A
VeniceProperties
instance containing properties with the namespace removed.
-
clipAndFilterNamespace
Extracts properties that begin with any of the specified namespaces.This method identifies all properties that start with one of the provided namespaces, removes the matching namespace prefix, and returns the filtered properties.
This supports dynamic configurations for various use cases, including Pub/Sub clients, messaging systems, and other configurable components. By following a namespace-based convention, different configurations can be extracted and supplied to respective adapters.
Example structure:
"pubsub.kafka.bootstrap.servers" "pubsub.pulsar.service.url" "pubsub.warpstream.bucket.url"
Using this method with namespaces {"pubsub.kafka.", "pubsub.pulsar."} would result in:
"bootstrap.servers" "service.url"
- Parameters:
namespaces
- A set of namespaces to filter properties by.- Returns:
- A
VeniceProperties
instance containing properties with the matching namespaces removed.
-
getStoreProperties
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
-
hashCode
public int hashCode() -
toString
-
toString
-
storeFlattened
Store all properties in a file- Parameters:
file
- to store into- Throws:
IOException
- If there is an error writing
-
storeFlattened
Store all properties to anOutputStream
- Parameters:
out
- The stream to write to- Throws:
IOException
- If there is an error writing
-
getString
-
getString
-
getStringWithAlternative
-
getString
-
getStringWithAlternative
-
getBoolean
-
getBooleanWithAlternative
-
getBoolean
-
getLong
-
getLong
-
getInt
-
getInt
-
getOptionalInt
-
getDouble
-
getDouble
-
getSizeInBytes
-
getSizeInBytes
-
convertSizeFromLiteral
-
getList
-
getListWithAlternative
-
getList
-
getMap
-
getMap
-
toProperties
-
isEmpty
public boolean isEmpty() -
getAsMap
-
empty()