HBASE-15691 ConcurrentModificationException in BucketAllocator
This commit is contained in:
parent
739fedbbb7
commit
105c5c36e6
|
@ -188,7 +188,7 @@ public final class BucketAllocator {
|
|||
this.sizeIndex = sizeIndex;
|
||||
}
|
||||
|
||||
public void instantiateBucket(Bucket b) {
|
||||
public synchronized void instantiateBucket(Bucket b) {
|
||||
assert b.isUninstantiated() || b.isCompletelyFree();
|
||||
b.reconfigure(sizeIndex, bucketSizes, bucketCapacity);
|
||||
bucketList.put(b, b);
|
||||
|
@ -240,7 +240,7 @@ public final class BucketAllocator {
|
|||
return b;
|
||||
}
|
||||
|
||||
private void removeBucket(Bucket b) {
|
||||
private synchronized void removeBucket(Bucket b) {
|
||||
assert b.isCompletelyFree();
|
||||
bucketList.remove(b);
|
||||
freeBuckets.remove(b);
|
||||
|
@ -256,7 +256,7 @@ public final class BucketAllocator {
|
|||
if (b.isCompletelyFree()) completelyFreeBuckets.put(b, b);
|
||||
}
|
||||
|
||||
public IndexStatistics statistics() {
|
||||
public synchronized IndexStatistics statistics() {
|
||||
long free = 0, used = 0;
|
||||
for (Object obj : bucketList.keySet()) {
|
||||
Bucket b = (Bucket) obj;
|
||||
|
|
|
@ -754,6 +754,8 @@ public class BucketCache implements BlockCache, HeapSize {
|
|||
}
|
||||
}
|
||||
|
||||
} catch (Throwable t) {
|
||||
LOG.warn("Failed freeing space", t);
|
||||
} finally {
|
||||
cacheStats.evict();
|
||||
freeInProgress = false;
|
||||
|
|
Loading…
Reference in New Issue