Get rid of IteratorBase::is_exhausted flag since it is not possible to rely on...
Get rid of IteratorBase::is_exhausted flag since it is not possible to rely on it unless we lock each call to GetNext which is not preferable. Each iterator now handles saving/restoring exhausted state. As a guideline, we always reset the input_impl(s) when they get exhausted. This can be used as an indicator of exhausted-ness for non-terminal iterators. Also reduces memory overhead. Each iterator should also handle calls to GetNextInternal when it is exhausted. Fixed this for some datasets. Also fix a bug in dataset_serialization_test_base. We were not saving a checkpoint after exhausting the iterator so verify_exhausted_iterator was not really testing restoring an exhausted iterator. PiperOrigin-RevId: 175253023
Loading
Please sign in to comment