|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.greenhopper.global.AbstractLoggable com.atlassian.greenhopper.service.rank.RankIndexServiceImpl
@Service public class RankIndexServiceImpl
The rank system is made of two main components: The stored rank, which is a single linked list of issueIDs in an AO table, and the runtime rank
index, which is an in-memory lookup map of chained Rank
objects that maintain a numeric position index.
The index is loaded from the database once the plugin is initialised. During normal operations, this service takes care of rank change operations
by updating the database, the rank object chain and the position index.
All runtime queries against the position of an issue are hitting the index.
Field Summary |
---|
Fields inherited from class com.atlassian.greenhopper.global.AbstractLoggable |
---|
logger |
Constructor Summary | |
---|---|
RankIndexServiceImpl()
|
Method Summary | |
---|---|
void |
clearIndices(com.atlassian.jira.event.ClearCacheEvent event)
|
int |
compare(long customFieldId,
long firstId,
long secondId)
Used by Lucene to sort issues by rank |
long |
getIssuePosition(long customFieldId,
long issueId)
Fetch the position, add issue as last if it's not tracked |
RankChange |
rankAfter(long customFieldId,
long issueId,
long rankAfterId)
We define after as the default |
RankChange |
rankBefore(long customFieldId,
long issueId,
long rankBeforeId)
RankBefore is just a special case of RankAfter |
RankChange |
rankFirst(long customFieldId,
long issueId)
Rank first : rank after head |
RankChange |
rankLast(long customFieldId,
long issueId)
Rank last : rank after the parent of tail |
java.util.List<RankChange> |
rankLastForAllFields(long issueId)
|
RankChange |
removeIssue(long customFieldId,
long issueId)
Remove issue from DB and index |
java.util.List<RankChange> |
removeIssueForAllFields(long issueId)
|
void |
selfDestruct()
Destroy this service to ensure that we don't have several instances talking to the database in parallel, in the event of a leaked classloader. |
Methods inherited from class com.atlassian.greenhopper.global.AbstractLoggable |
---|
logDebug, logError, logException, logInfo, logTrace, logWarn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RankIndexServiceImpl()
Method Detail |
---|
public int compare(long customFieldId, long firstId, long secondId)
compare
in interface RankIndexService
public long getIssuePosition(long customFieldId, long issueId)
getIssuePosition
in interface RankIndexService
public RankChange rankFirst(long customFieldId, long issueId)
rankFirst
in interface RankIndexService
public RankChange rankBefore(long customFieldId, long issueId, long rankBeforeId)
rankBefore
in interface RankIndexService
issueId
- : The ID of the issue to be rankedrankBeforeId
- : The ID of the issue to be ranked before. If this doesn't exist in the index, it will be added at the last position.
public RankChange rankAfter(long customFieldId, long issueId, long rankAfterId)
rankAfter
in interface RankIndexService
issueId
- : The ID of the issue to be rankedrankAfterId
- : The ID of the issue to be ranked after. If this doesn't exist in the index, it will be added at the last position.
public RankChange rankLast(long customFieldId, long issueId)
rankLast
in interface RankIndexService
public java.util.List<RankChange> rankLastForAllFields(long issueId)
rankLastForAllFields
in interface RankIndexService
public RankChange removeIssue(long customFieldId, long issueId)
removeIssue
in interface RankIndexService
public java.util.List<RankChange> removeIssueForAllFields(long issueId)
removeIssueForAllFields
in interface RankIndexService
public void selfDestruct()
@EventListener public void clearIndices(com.atlassian.jira.event.ClearCacheEvent event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |