add getQueryState() to recordBatch

so we can query the state of the current record batch for error handling