Class CompactionManager
java.lang.Object
com.linkedin.venice.controller.logcompaction.CompactionManager
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
ConstructorsConstructorDescriptionCompactionManager
(RepushOrchestrator repushOrchestrator, long timeSinceLastLogCompactionThreshold) -
Method Summary
Modifier and TypeMethodDescriptioncompactStore
(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 functionfilterStoresForCompaction(java.util.ArrayList<com.linkedin.venice.meta.StoreInfo>)
.boolean
isCompactionReady
(StoreInfo storeInfo) This function abstracts the criteria for a store to be ready for compaction public for testing inTestHybrid.testHybridStoreLogCompaction()
todo: move TestHybrid::testHybridStoreLogCompaction to TestCompactionManager, then make this class package private
-
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 functionfilterStoresForCompaction(java.util.ArrayList<com.linkedin.venice.meta.StoreInfo>)
.- Parameters:
clusterName
- cluster to look for compaction-ready stores inchildControllers
- list of controllers to look for compaction-ready stores in- Returns:
- list of StoreInfo of stores ready for log compaction in clusterName
-
isCompactionReady
This function abstracts the criteria for a store to be ready for compaction public for testing inTestHybrid.testHybridStoreLogCompaction()
todo: move TestHybrid::testHybridStoreLogCompaction to TestCompactionManager, then make this class package private -
compactStore
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)
andRepushOrchestrator.repush(com.linkedin.venice.controller.repush.RepushJobRequest)
- a wrapper around repush() - handles repush job status/response- Parameters:
repushJobRequest
-- Throws:
Exception
-