private static RecordState fetchRecordState(byte acknowledgeType) {
        switch (acknowledgeType) {
            case 1 /* ACCEPT */:
                return RecordState.ACKNOWLEDGED;
            case 2 /* RELEASE */:
                return RecordState.AVAILABLE;
            case 3 /* REJECT */:
            case 0 /* GAP */:
                return RecordState.ARCHIVED;
            default:
                throw new IllegalArgumentException("Invalid acknowledge type: " + acknowledgeType);
        }
    }
Check if the start offset has moved and within the request first and last offset.

@param batchFirstOffset The first offset of the batch.
@param batchLastOffset The last offset of the batch.

@return True if the start offset has moved and within the request first and last offset, false otherwise.
core/src/main/java/kafka/server/share/SharePartition.java