Package com.linkedin.venice.system.store
Class MetaStoreWriter
java.lang.Object
com.linkedin.venice.system.store.MetaStoreWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
This class is to write metadata: store properties/key schema/value schemas/replica statuses to meta system store.
So far, only child fabric should write to it and in the future, we may want to support the write from parent fabric,
which can be used for the fabric buildup.
TODO: we may need to consider to close the corresponding VeniceWriter when the store is deleted.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetaStoreWriter
(TopicManager topicManager, VeniceWriterFactory writerFactory, HelixReadOnlyZKSharedSchemaRepository schemaRepo, PubSubTopicRepository pubSubTopicRepository, long closeTimeoutMs, int numOfConcurrentVwCloseOps) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
If numOfConcurrentVwCloseOps is set to -1, then all the VeniceWriters will be closed asynchronously and concurrently.getMetaStoreWriter
(String metaStoreName) void
removeMetaStoreWriter
(String metaStoreName) This function should be used only for store deletion scenario.void
writeHeartbeat
(String storeName, long heartbeatTimestamp) void
writeInUseValueSchema
(String storeName, int versionNumber, int valueSchemaId) void
writeStoreClusterConfig
(StoreConfig storeConfig) WriteStoreConfig
equivalent to the meta system store.void
writeStoreKeySchemas
(String storeName, Collection<SchemaEntry> keySchemas) void
writeStoreProperties
(String clusterName, Store store) This function should be invoked for any store metadata change.void
writeStoreValueSchemas
(String storeName, Collection<SchemaEntry> valueSchemas) This function should be invoked for any value schema changes, and the should contain all the value schemas since this operation will be a full PUT.
-
Field Details
-
KEY_STRING_STORE_NAME
- See Also:
-
KEY_STRING_CLUSTER_NAME
- See Also:
-
KEY_STRING_VERSION_NUMBER
- See Also:
-
KEY_STRING_PARTITION_ID
- See Also:
-
KEY_STRING_SCHEMA_ID
- See Also:
-
-
Constructor Details
-
Method Details
-
writeStoreProperties
This function should be invoked for any store metadata change. -
writeStoreKeySchemas
-
writeStoreValueSchemas
This function should be invoked for any value schema changes, and the should contain all the value schemas since this operation will be a full PUT. -
writeHeartbeat
-
writeInUseValueSchema
-
writeStoreClusterConfig
WriteStoreConfig
equivalent to the meta system store. This is still only invoked by child controllers only. -
removeMetaStoreWriter
This function should be used only for store deletion scenario.- Parameters:
metaStoreName
-
-
getMetaStoreWriter
-
close
If numOfConcurrentVwCloseOps is set to -1, then all the VeniceWriters will be closed asynchronously and concurrently. If numOfConcurrentVwCloseOps is set to a positive number, then the VeniceWriters will be closed with a bounded concurrency until timeout. Once timeout is reached, the remaining VeniceWriters will be closed asynchronously and concurrently.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-