public boolean pushHead(MutableSegment segment) {
    // Record the ImmutableSegment' heap overhead when initialing
    MemStoreSizing memstoreAccounting = new NonThreadSafeMemStoreSizing();
    ImmutableSegment immutableSegment =
      SegmentFactory.instance().createImmutableSegment(segment, memstoreAccounting);
    if (region != null) {
      region.addMemStoreSize(memstoreAccounting.getDataSize(), memstoreAccounting.getHeapSize(),
        memstoreAccounting.getOffHeapSize(), memstoreAccounting.getCellsCount());
    }
    synchronized (pipeline) {
      boolean res = addFirst(immutableSegment);
      readOnlyCopy = new LinkedList<>(pipeline);
      return res;
    }
  }
<pre>
Version is volatile to ensure it is atomically read when not using a lock.
To indicate whether the suffix of pipeline changes:
1.for {@link CompactionPipeline#pushHead(MutableSegment)},new {@link ImmutableSegment} only
  added at Head, {@link #version} not change.
2.for {@link CompactionPipeline#swap},{@link #version} increase.
3.for {@link CompactionPipeline#replaceAtIndex},{@link #version} increase.
</pre>
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java