Package com.atlassian.bamboo.beehive
Class PrimaryNodeServiceImpl
java.lang.Object
com.atlassian.bamboo.beehive.PrimaryNodeServiceImpl
- All Implemented Interfaces:
PrimaryNodeService
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final long
static final String
static final int
-
Constructor Summary
ConstructorDescriptionPrimaryNodeServiceImpl
(@NotNull ClusterNodeHeartbeatDao clusterNodeHeartbeatDao, @NotNull AutowiringJobFactory bootstrapJobFactory, @NotNull BambooClusterLockServiceImpl bambooClusterLockService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Acquire primary node lock, or go into secondary node mode if the primary lock is held by another node.void
shutdown()
Shutdown the service.
-
Field Details
-
PRIMARY_NODE_LOCK_NAME
- See Also:
-
PRIMARY_CLUSTER_LOCK_TIMEOUT_SECONDS
public static final long PRIMARY_CLUSTER_LOCK_TIMEOUT_SECONDS -
TIMEOUT_TO_INTERVAL_RATIO
public static final int TIMEOUT_TO_INTERVAL_RATIO- See Also:
-
NUMBER_OF_LEGIT_FAILED_ATTEMPTS_BEFORE_GIVING_UP
public static final int NUMBER_OF_LEGIT_FAILED_ATTEMPTS_BEFORE_GIVING_UP- See Also:
-
ACQUIRE_PRIMARY_NODE_LOCK_JOB_INTERVAL_SECONDS
public static final int ACQUIRE_PRIMARY_NODE_LOCK_JOB_INTERVAL_SECONDS
-
-
Constructor Details
-
PrimaryNodeServiceImpl
public PrimaryNodeServiceImpl(@NotNull @NotNull ClusterNodeHeartbeatDao clusterNodeHeartbeatDao, @NotNull @NotNull AutowiringJobFactory bootstrapJobFactory, @NotNull @NotNull BambooClusterLockServiceImpl bambooClusterLockService) throws org.quartz.SchedulerException - Throws:
org.quartz.SchedulerException
-
-
Method Details
-
joinPrimaryNodeElection
public void joinPrimaryNodeElection() throws org.quartz.SchedulerExceptionDescription copied from interface:PrimaryNodeService
Acquire primary node lock, or go into secondary node mode if the primary lock is held by another node. Care - this method starts the background job, therefore even the very first run is asynchronous and there is no guarantee that once this method returns the lock acquisition is complete.- Specified by:
joinPrimaryNodeElection
in interfacePrimaryNodeService
- Throws:
org.quartz.SchedulerException
-
shutdown
@PreDestroy public void shutdown()Description copied from interface:PrimaryNodeService
Shutdown the service.- Specified by:
shutdown
in interfacePrimaryNodeService
-