public void closeHandlers() {
        status = ElasticResourceStatus.CLOSED;
    }
Append records to segment.
Note that lastOffset is the expected value of nextOffset after append. lastOffset = (the real last offset of the
records) + 1

@param records    records to append
@param lastOffset expected next offset after append
@return the size of the appended records
@throws IOException
core/src/main/scala/kafka/log/streamaspect/ElasticLogFileRecords.java