Class MetaStoreWriter

java.lang.Object
com.linkedin.venice.system.store.MetaStoreWriter
All Implemented Interfaces:
Closeable, AutoCloseable

public class MetaStoreWriter extends Object implements Closeable
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 Details

  • Constructor Details

  • Method Details

    • writeStoreProperties

      public void writeStoreProperties(String clusterName, Store store)
      This function should be invoked for any store metadata change.
    • writeStoreKeySchemas

      public void writeStoreKeySchemas(String storeName, Collection<SchemaEntry> keySchemas)
    • writeStoreValueSchemas

      public 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.
    • writeHeartbeat

      public void writeHeartbeat(String storeName, long heartbeatTimestamp)
    • writeInUseValueSchema

      public void writeInUseValueSchema(String storeName, int versionNumber, int valueSchemaId)
    • writeReadyToServerStoreReplicas

      public void writeReadyToServerStoreReplicas(String clusterName, String storeName, int version, int partitionId, Collection<Instance> readyToServeInstances)
      This function is used to produce a snapshot for replica statuses.
    • writeStoreClusterConfig

      public void writeStoreClusterConfig(StoreConfig storeConfig)
      Write StoreConfig equivalent to the meta system store. This is still only invoked by child controllers only.
    • deleteStoreReplicaStatus

      public void deleteStoreReplicaStatus(String clusterName, String storeName, int version, int partitionId)
      Clean up deprecated replica statuses. Currently, it is being used when cleaning up a deprecated version topic, where it guarantees all the partition replicas have been removed from Venice Cluster in TopicCleanupService.
    • removeMetaStoreWriter

      public void removeMetaStoreWriter(String metaStoreName)
      This function should be used only for store deletion scenario.
      Parameters:
      metaStoreName -
    • getMetaStoreWriter

      public VeniceWriter getMetaStoreWriter(String metaStoreName)
    • close

      public void close() throws IOException
      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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException