Fix logs in SegmentLoaderLocalCacheManager (#7229)

This commit is contained in:
Jihoon Son 2019-03-11 21:16:03 -07:00 committed by Fangjin Yang
parent 0df8ee3f79
commit e240fba247
1 changed files with 5 additions and 3 deletions

View File

@ -322,14 +322,16 @@ public class SegmentLoaderLocalCacheManager implements SegmentLoader
);
}
@SuppressWarnings("ObjectEquality")
private void unlock(DataSegment dataSegment, ReferenceCountingLock lock)
{
segmentLocks.compute(
dataSegment,
(segment, existingLock) -> {
//noinspection ObjectEquality
if (existingLock == null || existingLock != lock) {
throw new ISE("WTH? Different createOrGetLock instance");
if (existingLock == null) {
throw new ISE("WTH? the given lock has already been removed");
} else if (existingLock != lock) {
throw new ISE("WTH? Different lock instance");
} else {
if (existingLock.numReferences == 1) {
return null;