public class AdaptiveMostUsedLabelsCacheImpl extends Object implements AdaptiveMostUsedLabelsCache
Modifier and Type | Class and Description |
---|---|
static class |
AdaptiveMostUsedLabelsCacheImpl.TimestampProvider |
Constructor and Description |
---|
AdaptiveMostUsedLabelsCacheImpl(AdaptiveLabelCacheDao adaptiveLabelCacheDao,
LabelManagerInternal labelManagerDelegate) |
AdaptiveMostUsedLabelsCacheImpl(AdaptiveMostUsedLabelsCacheImpl.TimestampProvider timestampProvider,
AdaptiveLabelCacheDao adaptiveLabelCacheDao,
LabelManagerInternal labelManagerDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
addTaskToRefreshPersistentCache(long spaceId,
int requestedLimit)
Adds a new task for refreshing cache records in the queue
If there is another cache record in the queue, we should not add a new one
We need to update the existing one (if required)
|
void |
deleteAllPersistedRecords()
Removes all records from persistent cache
|
void |
deletePersistedRecord(long spaceId)
Removes a record from the persistent cache
|
void |
deletePersistedRecordForSite()
Removes a cache record for the entire site (global most popular labels)
Does not remove cache records for spaces
|
List<LiteLabelSearchResult> |
getSiteRecord(int limit)
Reads most used labels for the whole site
Implementation can use its own hard limit if the provided limit is too large
|
List<LiteLabelSearchResult> |
getSpaceRecord(long spaceId,
int limit)
Reads most used labels for the particular space from cache
Implementation can use its own hard limit if the provided limit is too large
|
List<LiteLabelSearchResult> |
getSpaceRecord(String spaceKey,
int limit)
A wrapper which allows to retrive data by space key (not by space id)
Would be removed in the future
|
int |
getTaskQueueSize() |
void |
scheduled()
Check the queue every N seconds and process all records from the queue
|
public AdaptiveMostUsedLabelsCacheImpl(AdaptiveMostUsedLabelsCacheImpl.TimestampProvider timestampProvider, AdaptiveLabelCacheDao adaptiveLabelCacheDao, LabelManagerInternal labelManagerDelegate)
public AdaptiveMostUsedLabelsCacheImpl(AdaptiveLabelCacheDao adaptiveLabelCacheDao, LabelManagerInternal labelManagerDelegate)
public List<LiteLabelSearchResult> getSpaceRecord(String spaceKey, int limit)
getSpaceRecord
in interface AdaptiveMostUsedLabelsCache
spaceKey
- - space keylimit
- - limitpublic void deleteAllPersistedRecords()
deleteAllPersistedRecords
in interface AdaptiveMostUsedLabelsCache
public void deletePersistedRecord(long spaceId)
deletePersistedRecord
in interface AdaptiveMostUsedLabelsCache
spaceId
- - space idpublic void deletePersistedRecordForSite()
deletePersistedRecordForSite
in interface AdaptiveMostUsedLabelsCache
@Scheduled(fixedDelay=3000L) public void scheduled()
public List<LiteLabelSearchResult> getSiteRecord(int limit)
getSiteRecord
in interface AdaptiveMostUsedLabelsCache
limit
- - limitpublic List<LiteLabelSearchResult> getSpaceRecord(long spaceId, int limit)
getSpaceRecord
in interface AdaptiveMostUsedLabelsCache
spaceId
- - space idpublic void addTaskToRefreshPersistentCache(long spaceId, int requestedLimit)
spaceId
- - space idrequestedLimit
- - limitpublic int getTaskQueueSize()
Copyright © 2003–2021 Atlassian. All rights reserved.