Package com.linkedin.davinci.helix
Class AbstractStateModelFactory
java.lang.Object
org.apache.helix.participant.statemachine.StateModelFactory<org.apache.helix.participant.statemachine.StateModel>
com.linkedin.davinci.helix.AbstractStateModelFactory
- Direct Known Subclasses:
LeaderFollowerPartitionStateModelFactory
public abstract class AbstractStateModelFactory
extends org.apache.helix.participant.statemachine.StateModelFactory<org.apache.helix.participant.statemachine.StateModel>
ModelFactory manages Helix state model creation.
createNewStateModel(String, String)
is called every time a new resource is created. Since Helix internal maintains a map between
model definition and model factory, each factory could only create 1 type of model.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.helix.participant.statemachine.StateModelFactory
org.apache.helix.participant.statemachine.StateModelFactory.CustomizedExecutorService
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ExecutorService
protected final String
protected final org.apache.logging.log4j.Logger
protected CompletableFuture<HelixPartitionStatusAccessor>
protected final ParticipantStateTransitionStats
protected final ReadOnlyStoreRepository
-
Constructor Summary
ConstructorDescriptionAbstractStateModelFactory
(IngestionBackend ingestionBackend, VeniceConfigLoader configService, ExecutorService executorService, ParticipantStateTransitionStats stateTransitionStats, ReadOnlyStoreRepository storeMetadataRepo, CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, String instanceName) -
Method Summary
Modifier and TypeMethodDescriptionabstract org.apache.helix.participant.statemachine.StateModel
createNewStateModel
(String resourceName, String partitionName) This method will be invoked only once per partition per sessiongetExecutorService
(String resourceName) static String
getStateModelID
(String resourceName, int partitionId) getStateTransitionStats
(String resourceName) Use the right state transition stats for the resource.void
void
waitExecutorTermination
(long timeout, TimeUnit unit) Methods inherited from class org.apache.helix.participant.statemachine.StateModelFactory
createAndAddBatchMessageWrapper, createAndAddStateModel, createAndAddStateModel, createBatchMessageWrapper, createNewStateModel, getBatchMessageWrapper, getExecutorService, getExecutorService, getPartitionSet, getPartitionSet, getResourceSet, getStateModel, getStateModel, removeStateModel, removeStateModel
-
Field Details
-
logger
protected final org.apache.logging.log4j.Logger logger -
storeMetadataRepo
-
executorService
-
stateTransitionStats
-
partitionPushStatusAccessorFuture
-
instanceName
-
-
Constructor Details
-
AbstractStateModelFactory
public AbstractStateModelFactory(IngestionBackend ingestionBackend, VeniceConfigLoader configService, ExecutorService executorService, ParticipantStateTransitionStats stateTransitionStats, ReadOnlyStoreRepository storeMetadataRepo, CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, String instanceName)
-
-
Method Details
-
getExecutorService
- Overrides:
getExecutorService
in classorg.apache.helix.participant.statemachine.StateModelFactory<org.apache.helix.participant.statemachine.StateModel>
-
getStateTransitionStats
Use the right state transition stats for the resource. By default, use the regular one; when dual state transition thread pool is enabled, use the future version stats for future version resource. -
createNewStateModel
public abstract org.apache.helix.participant.statemachine.StateModel createNewStateModel(String resourceName, String partitionName) This method will be invoked only once per partition per session- Overrides:
createNewStateModel
in classorg.apache.helix.participant.statemachine.StateModelFactory<org.apache.helix.participant.statemachine.StateModel>
- Parameters:
resourceName
- $(topic_name) where state transition is happeningpartitionName
- $(topic_name)_$(partition) for which the State Transition Handler is required- Returns:
- VenicePartitionStateModel for the partition.
-
getConfigService
-
getStoreMetadataRepo
-
getIngestionBackend
-
getStateModelID
-
shutDownExecutor
public void shutDownExecutor() -
waitExecutorTermination
- Throws:
InterruptedException
-