Guest User

Untitled

a guest
Dec 12th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public int evict(int evictionQuota){
  2. int counter = 0;
  3.  
  4. for(ConcurrentHashMap<Integer, SpaceEvictionStrategy> priorityLevel : getPriorities().values()){
  5. if(counter == evictionQuota)
  6. break;
  7. if(priorityLevel.isEmpty())
  8. continue;
  9. for (SpaceEvictionStrategy strategy : priorityLevel.values()) {
  10. counter += strategy.evict(evictionQuota - counter);
  11. if(counter == evictionQuota)
  12. break;
  13. }
  14. }
  15. return counter;
  16. }
Add Comment
Please, Sign In to add comment