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) private void unlock(DataSegment dataSegment, ReferenceCountingLock lock)
{ {
segmentLocks.compute( segmentLocks.compute(
dataSegment, dataSegment,
(segment, existingLock) -> { (segment, existingLock) -> {
//noinspection ObjectEquality if (existingLock == null) {
if (existingLock == null || existingLock != lock) { throw new ISE("WTH? the given lock has already been removed");
throw new ISE("WTH? Different createOrGetLock instance"); } else if (existingLock != lock) {
throw new ISE("WTH? Different lock instance");
} else { } else {
if (existingLock.numReferences == 1) { if (existingLock.numReferences == 1) {
return null; return null;