Package com.linkedin.davinci.config
Class VeniceConfigLoader
java.lang.Object
com.linkedin.davinci.config.VeniceConfigLoader
VeniceConfigService loads the static configuration that does not change
once the Server is started. Modifying these configs once the server
is up and running, does not get reflected until the server is restarted.
There are 3 configurations provided.
1) Cluster Configuration
The configuration that needs to be shared between the Controller and
Server goes here.
2) Server Configuration
Multiple nodes that should share the same value should go in here.
Cluster Name, ZooKeeper Address or any other configuration that is common
between many storage nodes go here.
3) Override Configuration
These value override the values in Base Configuration ( if present). Node Id
for each server goes here.
There are two types of overrides supported.
1) Precedence among the files
Any Key in Server Configuration overrides the same key in Cluster Configuration.
Any Key in Override Configuration overrides the same key in Server Configuration.
2) Overriding keys for specific store only.
The following config sets default to all stores and override for foobar store.
bdb.max.logfile.size=1000
store-foobar.bdb.max.logfile.size=5000
There are two ways of providing the Configs.
1) Config directory. The Config uses 3 files cluster.properties, server.properties and
server-override.properties (optional).
2) java.util.properties. It takes in 3 props for the above 3 configuration.
The static config initializes the config and starts the default services.
The configuration does not specify what stores Storage Node hosts/serves.
The Storage Node waits for Commands from Helix to understand what stores
and partitions it was assigned to.
This design, assumes that without Helix, the
storage node/server will not be able to read/write data as it has no
knowledge of the stores.
Helix Controller may also provide dynamic properties that can override
the properties at the store level. This is not implemented currently.
There is no validation in the code, to differentiate between Valid and
Invalid Overrides for now. Once the code is evolved and our usage
patterns are narrowed down, checks can be enforced if necessary.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVeniceConfigLoader
(VeniceProperties properties) VeniceConfigLoader
(VeniceProperties clusterProperties, VeniceProperties serverProperties) VeniceConfigLoader
(VeniceProperties clusterProperties, VeniceProperties serverProperties, Map<String, Map<String, String>> kafkaClusterMap) -
Method Summary
Modifier and TypeMethodDescriptiongetStoreConfig
(String pubsubTopicName) getStoreConfig
(String pubsubTopicName, PersistenceType storePersistenceType) static VeniceConfigLoader
loadFromConfigDirectory
(String configDirPath) static VeniceConfigLoader
Initializes the Venice configuration service from known environment variablesparseKafkaClusterMap
(String configDirectory) parseKafkaClusterMap
(String configDirectory, String fileName) The file contains the following info: The otherUrls field is used to translate URLs coming from other processes (e.g.static void
storeKafkaClusterMap
(File configDirectory, String fileName, Map<String, Map<String, String>> kafkaClusterMap) static void
-
Field Details
-
VENICE_CONFIG_DIR
- See Also:
-
CLUSTER_PROPERTIES_FILE
- See Also:
-
SERVER_PROPERTIES_FILE
- See Also:
-
KAFKA_CLUSTER_MAP_FILE
- See Also:
-
-
Constructor Details
-
VeniceConfigLoader
-
VeniceConfigLoader
-
VeniceConfigLoader
public VeniceConfigLoader(VeniceProperties clusterProperties, VeniceProperties serverProperties, Map<String, Map<String, String>> kafkaClusterMap)
-
-
Method Details
-
getVeniceClusterConfig
-
getVeniceServerConfig
-
getCombinedProperties
-
getStoreConfig
-
getStoreConfig
public VeniceStoreVersionConfig getStoreConfig(String pubsubTopicName, PersistenceType storePersistenceType) -
loadFromEnvironmentVariable
Initializes the Venice configuration service from known environment variables- Returns:
- VeniceConfigService object
-
loadFromConfigDirectory
-
parseKafkaClusterMap
public static Map<String,Map<String, parseKafkaClusterMapString>> (String configDirectory) throws Exception - Throws:
Exception
-
parseKafkaClusterMap
public static Map<String,Map<String, parseKafkaClusterMapString>> (String configDirectory, String fileName) throws Exception The file contains the following info:TopicSwitch
emitted by the controller, or by a previous run of the server which was configured differently). The various URLs included in otherUrls fields must be globally unique. The securityProtocol entry must be compatible with the url entry (i.e. have the right port). N.B.: This is actually JSON, not XML, and it has some weird escaping in it. TODO: Clean this up. =- Throws:
Exception
-
storeKafkaClusterMap
public static void storeKafkaClusterMap(File configDirectory, Map<String, Map<String, throws ExceptionString>> kafkaClusterMap) - Throws:
Exception
-
storeKafkaClusterMap
public static void storeKafkaClusterMap(File configDirectory, String fileName, Map<String, Map<String, throws ExceptionString>> kafkaClusterMap) - Throws:
Exception
-