I updated the patch as follows:
Having the word Computer in the interface name and configs could cause confusion, due to how it's an overloaded term. I don't have any great suggestions though. PigStatsOutputSizeReader?
Changed to PigStatsOutputSizeReader.
Instead of registering a single new computer it would be ideal if we could register a list of computers.
Each computer could have a boolean supports(POStore poStore) method that returns whether this class supports a given POStore. This can often be done by inspecting the output path. A default URI-based abstract class could help with that part.
Each reader implements boolean supports(String uri) method. For FileBasedOutputSizeReader, the output of UriUtil.isHDFSFileOrLocalOrS3N() is returned.
The computers would then be consulted in order, where the first to support the POStore wins.
If a computer can't determine a size for some reason (i.e., it doesn't support it or an exception occurred), it shouldn't return 0. Instead maybe we reserve -1 for this case and document it as such.
In addition, I replaced POStore with String. Please let me know what you think.