HDFS-17053. Optimize method BlockInfoStriped#findSlot to reduce time complexity. (#5757). Contributed by farmmamba.
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
parent
7c54a78343
commit
e14c52c25f
@ -105,7 +105,8 @@ private void initIndices() {
|
|||||||
|
|
||||||
private int findSlot() {
|
private int findSlot() {
|
||||||
int i = getTotalBlockNum();
|
int i = getTotalBlockNum();
|
||||||
for (; i < getCapacity(); i++) {
|
int capacity = getCapacity();
|
||||||
|
for (; i < capacity; i++) {
|
||||||
if (getStorageInfo(i) == null) {
|
if (getStorageInfo(i) == null) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user