For better or worse currently Sequence interface is used in Druid in situations when we need to "iterate, then close something when done". QueryableIndexIndexableAdapter.getRows() returns Iterable which closes it's resources when hasNext() failed, that is unreliable (somebody might just not try to iterate to the end of the iterable).
For better or worse currently
Sequenceinterface is used in Druid in situations when we need to "iterate, then close something when done".QueryableIndexIndexableAdapter.getRows()returnsIterablewhich closes it's resources whenhasNext()failed, that is unreliable (somebody might just not try to iterate to the end of the iterable).