@Override
        public String toString() {
            return "InFlightBatch(" +
                "firstOffset=" + firstOffset +
                ", lastOffset=" + lastOffset +
                ", inFlightState=" + batchState +
                ", offsetState=" + ((offsetState == null) ? "null" : offsetState) +
                ")";
        }
The InFlightBatch maintains the in-memory state of the fetched records i.e. in-flight records.
core/src/main/java/kafka/server/share/SharePartition.java