com.atlassian.greenhopper.service.timetracking
Interface WorklogHistoryCache

All Known Implementing Classes:
WorklogHistoryCacheImpl

public interface WorklogHistoryCache

Caches the computed worklog history timeline, on a per-issue base. This data is not persisted anywhere. The eviction is done by CacheEvictionListener, which will remove entries when they are changed through JIRA.

The cache size can be configured from the general GH configuration.

Entries in the cache are considered eternal, meaning live-until-evicted. The eviction strategy is LRU by default. There is currently no disk overflow.

Author:
ahennecke

Field Summary
static int DEFAULT_MEMORY_SIZE
           
static java.lang.String SERVICE
           
 
Method Summary
 long calculateInMemorySize()
          Warning: huge performance / blocking impact.
 void clear()
          Removes all entries from the cache
 net.sf.ehcache.Element getElement(java.lang.String issueKey)
          Get the cache element for the issue key.
 long getMemoryStoreSize()
           
 double getUsageRatio()
           
 void remove(java.lang.String issueKey)
           
 void resize(int newSize)
          Resizes the cache.
 void setEntry(java.lang.String issueKey, java.util.SortedMap<org.joda.time.DateMidnight,DayWorkHistory> entry)
           
 

Field Detail

SERVICE

static final java.lang.String SERVICE
See Also:
Constant Field Values

DEFAULT_MEMORY_SIZE

static final int DEFAULT_MEMORY_SIZE
See Also:
Constant Field Values
Method Detail

getElement

net.sf.ehcache.Element getElement(java.lang.String issueKey)
Get the cache element for the issue key. The actual cache value is not returned here directly, since null values are cached. So the result could be:

Parameters:
issueKey - : The issue to fetch the timeline for

setEntry

void setEntry(java.lang.String issueKey,
              java.util.SortedMap<org.joda.time.DateMidnight,DayWorkHistory> entry)

remove

void remove(java.lang.String issueKey)

clear

void clear()
Removes all entries from the cache


getMemoryStoreSize

long getMemoryStoreSize()
Returns:
The number of entries currently in the memory cache

getUsageRatio

double getUsageRatio()
Returns:
the memory cache usage ratio - percentage of how much of the memory cache is currently used

calculateInMemorySize

long calculateInMemorySize()
Warning: huge performance / blocking impact. Use with care.


resize

void resize(int newSize)
Resizes the cache. This will destroy the current cache and create a new one. Entries are not carried over, to avoid stale data. The new cache will be lazily populated.

Parameters:
newSize - : The maximum number of entries that the cache can hold.


Copyright © 2007-2012 Atlassian. All Rights Reserved.