hpcc-systems/HPCC-Platform — pull request #1027 by rengolin (2011-11-18 12:29:25+00:00)
Title: Factor file iterators into common code

Move common logic from CDFileIt, CDSuperFileIT, cSubFileIt and CDFilePartIt into a common base class and leave only specific implementation to each derived class.

There's one change of semantics in CDSuperFileIterator::query() but that was hinted in the previous change that there was no reason for that and all regression tests pass without it.

I left a note, so if we find any problem regarding listing super-files (owners) of a logic file, we know where to look and (maybe) how to fix it. However, the way it is now is, AFAICS, the correct way of doing it.

If we do find a bug around that change, the correct fix would be to fix whatever iterates through it to check if the next() is valid according to its own semantics. It'll also help factoring it upper still, since most other iterator have a common base logic (but it's not the scope of this patch).