Package com.linkedin.venice.views
Class VeniceView
java.lang.Object
com.linkedin.venice.views.VeniceView
- Direct Known Subclasses:
ChangeCaptureView
,MaterializedView
,VeniceViewWriter
This is the abstract implementation of the 'management' component for a venice view. This
class is meant to be lightweight and is leveraged by the controller in order to understand
what resources need to be maintained for the view. The first (and so far) only resource we
have in the interface is for KafkaTopics. Creators of views should implement both this class
and it's component class
VeniceViewWriter
and make sure
it's full package name is returned by
getWriterClassName()
Ideally, all details about management and functionality for any given view is strictly contained
within these two classes, and as little implementation details are leaked through the rest of the
code base.
TODO:
Despite best intentions, there is still a little bit of work to do in this interface. We've had to
leak some implementation details in the first cut about specific views here in order to define the
naming convention for resources which must be cleaned up. Additionally, there should be support in
this interface for lifecycle management of arbitrary resources (not just kafka topics).-
Field Summary
Modifier and TypeFieldDescriptionprotected final Properties
protected final String
static final String
-
Constructor Summary
ConstructorDescriptionVeniceView
(Properties props, String storeName, Map<String, String> viewParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getTopicNamesAndConfigsForVersion
(int version) Implementations should override to return a map of topicName:topic Configs relevant for topic materialization (things like partition count, RF, etc.) TODO: Come up with list of config names that should be parsed by VeniceAdmin to pass along to TopicManager.Implementations should return the fully specified class name for the component VeniceViewWriter implementation.getWriterOptionsBuilder
(String viewTopicName, Version version) static boolean
isViewTopic
(String topicName) static String
parseStoreFromViewTopic
(String topicName) static int
parseVersionFromViewTopic
(String topicName) void
validateConfigs
(Store store) Validate that the configs set up for this view for this store are valid.
-
Field Details
-
VIEW_TOPIC_SEPARATOR
- See Also:
-
props
-
storeName
-
viewParameters
-
-
Constructor Details
-
VeniceView
-
-
Method Details
-
getWriterOptionsBuilder
-
getTopicNamesAndConfigsForVersion
Implementations should override to return a map of topicName:topic Configs relevant for topic materialization (things like partition count, RF, etc.) TODO: Come up with list of config names that should be parsed by VeniceAdmin to pass along to TopicManager.- Returns:
- a map keyed by the name of the topic to be created and the configs which should be applied for that creation
-
getWriterClassName
Implementations should return the fully specified class name for the component VeniceViewWriter implementation.- Returns:
- returns the className of the writer which should be instantiated.
-
validateConfigs
Validate that the configs set up for this view for this store are valid. If not, throw an exception. Implementors should override this function to add their own validation logic. -
close
public void close() -
isViewTopic
-
parseStoreFromViewTopic
-
parseVersionFromViewTopic
-