private boolean validateSuffixList(LinkedList<ImmutableSegment> suffix) {
    if (suffix.isEmpty()) {
      // empty suffix is always valid
      return true;
    }
    Iterator<ImmutableSegment> pipelineBackwardIterator = pipeline.descendingIterator();
    Iterator<ImmutableSegment> suffixBackwardIterator = suffix.descendingIterator();
    ImmutableSegment suffixCurrent;
    ImmutableSegment pipelineCurrent;
    for (; suffixBackwardIterator.hasNext();) {
      if (!pipelineBackwardIterator.hasNext()) {
        // a suffix longer than pipeline is invalid
        return false;
      }
      suffixCurrent = suffixBackwardIterator.next();
      pipelineCurrent = pipelineBackwardIterator.next();
      if (suffixCurrent != pipelineCurrent) {
        // non-matching suffix
        return false;
      }
    }
    // suffix matches pipeline suffix
    return true;
  }
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