@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "VO_VOLATILE_INCREMENT",
      justification = "replaceAtIndex is invoked under a synchronize block so safe")
  private void replaceAtIndex(int idx, ImmutableSegment newSegment) {
    pipeline.set(idx, newSegment);
    readOnlyCopy = new LinkedList<>(pipeline);
    // the version increment is indeed needed, because the swap uses removeAll() method of the
    // linked-list that compares the objects to find what to remove.
    // The flattening changes the segment object completely (creation pattern) and so
    // swap will not proceed correctly after concurrent flattening.
    version++;
  }
Checking that the {@link Segment}s in suffix input parameter is same as the {@link Segment}s in
{@link CompactionPipeline#pipeline} one by one from the last element to the first element of
suffix. If matched, remove suffix from {@link CompactionPipeline#pipeline}. <br/>
Must be called under the {@link CompactionPipeline#pipeline} Lock.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java