Commit bbf568c
authored
Avoid some uses of ConcurrentLinkedQueue.size() in SharedBlobCacheService (elastic#128119) (elastic#128194) (elastic#128203)
SharedBlobCacheService keeps track of the free regions in a
ConcurrentLinkedQueue. We use its "size()" method in three places
outside of tests but unfortunately this is not a constant time operation
because of the asynchronous nature of this queue. This change removes
two of the uses where we only check if the queue is empty by calling the
"isEmpty()" method instead.1 parent 6b4bdc8 commit bbf568c
File tree
1 file changed
+8
-3
lines changed1 file changed
+8
-3
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| 503 | + | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| |||
571 | 572 | | |
572 | 573 | | |
573 | 574 | | |
574 | | - | |
| 575 | + | |
575 | 576 | | |
576 | 577 | | |
577 | 578 | | |
| |||
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
622 | | - | |
| 623 | + | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
| |||
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
674 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
675 | 680 | | |
676 | 681 | | |
677 | 682 | | |
| |||
0 commit comments