Class LexoRankBalancingService
java.lang.Object
com.atlassian.greenhopper.service.lexorank.balance.LexoRankBalancingService
Service that handles balancing of lexorank.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet balancing service status.void
Initialise the service, this will be called when Agile plug is started.boolean
Check to see if the service has disabled balancing.void
onJiraReindexComplete
(com.atlassian.jira.issue.index.ReindexAllCompletedEvent event) Enable LexoRank balancing when foreground re-indexing stops.void
onJiraReindexStart
(com.atlassian.jira.issue.index.ReindexAllStartedEvent event) When jira is reindexing we need to avoid to run the lexorank balancer in this node.void
Handle re-rank events, and schedule a re-balance as necessary.void
void
void
pluginFrameworkShuttingDown
(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent evt) Detect Plugin framework shutdown.void
pluginModuleDisabled
(com.atlassian.plugin.event.events.PluginModuleDisabledEvent evt) Detect JIRA Agile shutdown.boolean
rankingOperationsDisabled
(Long fieldId) Check to see if rank operations are disabledrequestBalance
(Long rankFieldId) Request an immediate rebalance for the specified fieldIdSchedule an immediate rebalance for all field ids.boolean
Request a scheduled balance.
-
Constructor Details
-
LexoRankBalancingService
public LexoRankBalancingService()
-
-
Method Details
-
onSpringContextStarted
@PostConstruct public void onSpringContextStarted() -
onSpringContextStopped
@PreDestroy public void onSpringContextStopped() -
initialise
public void initialise()Initialise the service, this will be called when Agile plug is started. -
pluginFrameworkShuttingDown
@EventListener public void pluginFrameworkShuttingDown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent evt) Detect Plugin framework shutdown. -
pluginModuleDisabled
@EventListener public void pluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent evt) Detect JIRA Agile shutdown. -
onJiraReindexStart
@EventListener public void onJiraReindexStart(com.atlassian.jira.issue.index.ReindexAllStartedEvent event) When jira is reindexing we need to avoid to run the lexorank balancer in this node. If the balancer is running we could get write lock timeouts from lucene.- Parameters:
event
- the event
-
onJiraReindexComplete
@EventListener public void onJiraReindexComplete(com.atlassian.jira.issue.index.ReindexAllCompletedEvent event) Enable LexoRank balancing when foreground re-indexing stops. -
isBalancingDisabled
public boolean isBalancingDisabled()Check to see if the service has disabled balancing.- Returns:
- true when balancing has been disabled.
-
shouldBalancingBackOff
public boolean shouldBalancingBackOff() -
onLexoRankEvent
Handle re-rank events, and schedule a re-balance as necessary.- Parameters:
event
- is the rank event.
-
rankingOperationsDisabled
Check to see if rank operations are disabled- Parameters:
fieldId
- the RANK fieldId- Returns:
- true when ranking is disabled
-
requestFullBalance
Schedule an immediate rebalance for all field ids. -
requestBalance
Request an immediate rebalance for the specified fieldId- Parameters:
rankFieldId
-
-
submitScheduledBalance
Request a scheduled balance. The balance will not be run if it's already in progress. -
getExecutorService
-
getBalanceStatus
Get balancing service status.- Returns:
-