private boolean checkStateTransition(RemoteLogSegmentState existingState,
                                         RemoteLogSegmentState targetState,
                                         RemoteLogSegmentId segmentId) {
        boolean isValid = RemoteLogSegmentState.isValidTransition(existingState, targetState);
        if (!isValid) {
            log.error("Current state: {} can not be transitioned to target state: {}, segmentId: {}. Dropping the event",
                    existingState, targetState, segmentId);
        }
        return isValid;
    }
This method tracks the given remote segment as not yet available for reads. It does not add the segment
leader epoch offset mapping until this segment reaches COPY_SEGMENT_FINISHED state.

@param remoteLogSegmentMetadata RemoteLogSegmentMetadata instance
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/RemoteLogMetadataCache.java