Class CompactionManager

java.lang.Object
com.linkedin.venice.controller.logcompaction.CompactionManager

public class CompactionManager extends Object
This class contains functions used by VeniceHelixAdmin to: 1. Get stores ready for compaction based on a set of criteria. These criteria have individual functions if they involve multiple steps. 2. Trigger repush to compact a store with function RepushOrchestrator.repush(RepushJobRequest) & processes the status/response of the repush job.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompactionManager(RepushOrchestrator repushOrchestrator, long timeSinceLastLogCompactionThreshold)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    compactStore(RepushJobRequest repushJobRequest)
    This function triggers a repush job to perform log compaction on the topic of a store.
    getStoresForCompaction(String clusterName, Map<String,ControllerClient> childControllers)
    This function iterates over a list of child controllers, in order to obtain the list of stores in each child controller, and then filter out the stores that are ready for compaction with function filterStoresForCompaction(java.util.ArrayList<com.linkedin.venice.meta.StoreInfo>).
    boolean
    This function abstracts the criteria for a store to be ready for compaction public for testing in TestHybrid.testHybridStoreLogCompaction() todo: move TestHybrid::testHybridStoreLogCompaction to TestCompactionManager, then make this class package private

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompactionManager

      public CompactionManager(RepushOrchestrator repushOrchestrator, long timeSinceLastLogCompactionThreshold)
  • Method Details

    • getStoresForCompaction

      public List<StoreInfo> getStoresForCompaction(String clusterName, Map<String,ControllerClient> childControllers)
      This function iterates over a list of child controllers, in order to obtain the list of stores in each child controller, and then filter out the stores that are ready for compaction with function filterStoresForCompaction(java.util.ArrayList<com.linkedin.venice.meta.StoreInfo>).
      Parameters:
      clusterName - cluster to look for compaction-ready stores in
      childControllers - list of controllers to look for compaction-ready stores in
      Returns:
      list of StoreInfo of stores ready for log compaction in clusterName
    • isCompactionReady

      public boolean isCompactionReady(StoreInfo storeInfo)
      This function abstracts the criteria for a store to be ready for compaction public for testing in TestHybrid.testHybridStoreLogCompaction() todo: move TestHybrid::testHybridStoreLogCompaction to TestCompactionManager, then make this class package private
    • compactStore

      public RepushJobResponse compactStore(RepushJobRequest repushJobRequest) throws Exception
      This function triggers a repush job to perform log compaction on the topic of a store.

      - intermediary between VeniceHelixAdmin.compactStore(com.linkedin.venice.controller.repush.RepushJobRequest) and RepushOrchestrator.repush(com.linkedin.venice.controller.repush.RepushJobRequest) - a wrapper around repush() - handles repush job status/response

      Parameters:
      repushJobRequest -
      Throws:
      Exception