Class AdaptiveMostUsedLabelsCacheImpl

    • Method Detail

      • scheduled

        @Scheduled(fixedDelay=3000L)
        public void scheduled()
        Check the queue every N seconds and process all records from the queue
      • getSpaceRecord

        public 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
        Specified by:
        getSpaceRecord in interface AdaptiveMostUsedLabelsCache
        Parameters:
        spaceId - - space id
        Returns:
        cached data
      • addTaskToRefreshPersistentCache

        public 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)
        Parameters:
        spaceId - - space id
        requestedLimit - - limit
      • getTaskQueueSize

        public int getTaskQueueSize()
        Returns:
        tasks queue size