docs: @Override
     public boolean acquireReadLock(String filename) {
        FileReadLockKey readLockKey = new FileReadLockKey(indexName, filename, affinitySegmentId);
        Integer lockValue = locksCache.get(readLockKey);
        boolean done = false;
        while (done == false) {
           if (lockValue != null) {
              int refCount = lockValue.intValue();
              if (refCount == 0) {
                 // too late: in case refCount==0 the delete is being performed
                 return false;
              }
              Integer newValue = Integer.valueOf(refCount + 1);
              done = locksCache.replace(readLockKey, lockValue, newValue);
              if ( ! done) {
                 lockValue = locksCache.get(readLockKey);
              }
           } else {
              // readLocks are not stored, so if there's no value assume it's ==1, which means
              // existing file, not deleted, nobody else owning a read lock. but check for ambiguity
              lockValue = locksCache.putIfAbsent(readLockKey, 2);
              done = (null == lockValue);
              if (done) {
                 // have to check now that the fileKey still exists to prevent the race condition of
                 // T1 fileKey exists - T2 delete file and remove readlock - T1 putIfAbsent(readlock, 2)
                 final FileCacheKey fileKey = new FileCacheKey(indexName, filename, affinitySegmentId);
                 if (metadataCache.get(fileKey) == null) {
                    locksCache.withFlags(Flag.IGNORE_RETURN_VALUES).removeAsync(readLockKey);
                    return false;
                 }
              }
           }
        }
        return true;
     }