[
https://issues.apache.org/jira/browse/HBASE-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892607#action_12892607
]
stack commented on HBASE-2663:
------------------------------
bq. Then when we want to evict, just scan from the end of the list
You'd use the LinkedList in addition to PriorityQueue, just so pull off the end
of the queue? Or you thinking dump PriorityQueue and just use LinkedList (do
they have same add/remove characteristic?).
You'd run three linked lists, one for SINGLE, MULTI and MEMORY (see head of
BlockPriority)?
We'd need to keep running counts on each of the three linked lists lettting any
of them grow to fill space unused by others?
> LRU cache makes needless datastructure copies during eviction
> -------------------------------------------------------------
>
> Key: HBASE-2663
> URL: https://issues.apache.org/jira/browse/HBASE-2663
> Project: HBase
> Issue Type: Improvement
> Components: regionserver
> Reporter: Todd Lipcon
>
> Was browsing the LRU eviction code and came upon some very inefficient code.
> When we do eviction, BlockBucket.free() calls queue.get() which first inserts
> everything from the PriorityQueue<Block> into a LinkedList, then copies that
> entire linked list into an array. We then iterate over usually just a small
> percentage of the array to free some blocks until we have freed the requested
> amount.
> We ought to be able to just pull items out of the PriorityQueue directly and
> avoid all the churn.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.