* defaults to FileBasedOutputSizeReader.
* @param sto POStore
* @param conf configuration
*/
public static long getOutputSize(POStore sto, Configuration conf) {
PigStatsOutputSizeReader reader = null;
String readerNames = conf.get(
PigStatsOutputSizeReader.OUTPUT_SIZE_READER_KEY,
FileBasedOutputSizeReader.class.getCanonicalName());
for (String className : readerNames.split(",")) {
reader = (PigStatsOutputSizeReader) PigContext.instantiateFuncFromSpec(className);
if (reader.supports(sto, conf)) {
LOG.info("using output size reader: " + className);
try {
return reader.getOutputSize(sto, conf);
} catch (FileNotFoundException e) {
LOG.warn("unable to find the output file", e);
return -1;
} catch (IOException e) {
LOG.warn("unable to get byte written of the job", e);