com.atlassian.greenhopper.service.rank
Class RankIndexServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.rank.RankIndexServiceImpl
All Implemented Interfaces:
RankIndexService

@Service
public class RankIndexServiceImpl
extends java.lang.Object
implements RankIndexService

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
protected  LoggerWrapper log
           
 
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
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final LoggerWrapper log
Constructor Detail

RankIndexServiceImpl

public RankIndexServiceImpl()
Method Detail

compare

public int compare(long customFieldId,
                   long firstId,
                   long secondId)
Used by Lucene to sort issues by rank

Specified by:
compare in interface RankIndexService

getIssuePosition

public long getIssuePosition(long customFieldId,
                             long issueId)
Fetch the position, add issue as last if it's not tracked

Specified by:
getIssuePosition in interface RankIndexService

selfDestruct

public 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.


clearIndices

@EventListener
public void clearIndices(com.atlassian.jira.event.ClearCacheEvent event)
Specified by:
clearIndices in interface RankIndexService


Copyright © 2007-2014 Atlassian. All Rights Reserved.