Package com.atlassian.bamboo.beehive
Class PrimaryNodeServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.beehive.PrimaryNodeServiceImpl
-
- All Implemented Interfaces:
PrimaryNodeService
public class PrimaryNodeServiceImpl extends Object implements PrimaryNodeService
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACQUIRE_PRIMARY_NODE_LOCK_JOB_INTERVAL_SECONDS
static int
NUMBER_OF_LEGIT_FAILED_ATTEMPTS_BEFORE_GIVING_UP
static long
PRIMARY_CLUSTER_LOCK_TIMEOUT_SECONDS
static String
PRIMARY_NODE_LOCK_NAME
static int
TIMEOUT_TO_INTERVAL_RATIO
-
Constructor Summary
Constructors Constructor Description PrimaryNodeServiceImpl(@NotNull ClusterNodeHeartbeatDao clusterNodeHeartbeatDao, @NotNull AutowiringJobFactory bootstrapJobFactory, @NotNull BambooClusterLockServiceImpl bambooClusterLockService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
joinPrimaryNodeElection()
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 Detail
-
PRIMARY_NODE_LOCK_NAME
public static final String PRIMARY_NODE_LOCK_NAME
- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
NUMBER_OF_LEGIT_FAILED_ATTEMPTS_BEFORE_GIVING_UP
public static final int NUMBER_OF_LEGIT_FAILED_ATTEMPTS_BEFORE_GIVING_UP
- See Also:
- Constant Field Values
-
ACQUIRE_PRIMARY_NODE_LOCK_JOB_INTERVAL_SECONDS
public static final int ACQUIRE_PRIMARY_NODE_LOCK_JOB_INTERVAL_SECONDS
-
-
Constructor Detail
-
PrimaryNodeServiceImpl
public PrimaryNodeServiceImpl(@NotNull @NotNull ClusterNodeHeartbeatDao clusterNodeHeartbeatDao, @NotNull @NotNull AutowiringJobFactory bootstrapJobFactory, @NotNull @NotNull BambooClusterLockServiceImpl bambooClusterLockService) throws org.quartz.SchedulerException
- Throws:
org.quartz.SchedulerException
-
-
Method Detail
-
joinPrimaryNodeElection
public void joinPrimaryNodeElection() throws org.quartz.SchedulerException
Description 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
-
-