code: void updateSegmentIndexOffset(long segmentId, long indexOffset) {
          boolean remove = indexOffset < 0;
          SegmentKeyCache cache;
          int generation;
          synchronized (this.segmentCaches) {
              generation = this.currentCacheGeneration;
              if (remove) {
                  cache = this.segmentCaches.remove(segmentId);
              } else {
                  cache = this.segmentCaches.computeIfAbsent(segmentId, s -> new SegmentKeyCache(s, this.cache));
              }
          }
  
          if (cache != null) {
              if (remove) {
                  evict(cache.evictAll());
              } else {
                  cache.setLastIndexedOffset(indexOffset, generation);
              }
          }
      }
docs: Updates the Last Indexed Offset for a given Segment. This is used for cache eviction purposes - no cache entry with
  a segment offsets smaller than this value may be evicted. A Segment must be registered either via this method or
  via {@link #updateSegmentIndexOffsetIfMissing} in order to have backpointers recorded for the tail-end section of
  the index.
  
  @param segmentId   The Id of the Segment to update the Last Indexed Offset for.
  @param indexOffset The Last Indexed Offset to set. If negative, this will clear up the value.