@Override
public void attachOutputs(Map<String, LogicalOutput> outputs,
Configuration conf)
throws ExecException {
LogicalOutput logicalOut = outputs.get(outputKey);
if (logicalOut == null || !(logicalOut instanceof MROutput)) {
throw new ExecException("POStoreTez only accepts MROutput. key = "
+ getOperatorKey() + ", outputs = " + outputs);
}
output = (MROutput) logicalOut;
try {
writer = output.getWriter();
} catch (IOException e) {
throw new ExecException(e);
}
CounterGroup multiStoreGroup = processorContext.getCounters()
.getGroup(MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP);
if (multiStoreGroup == null) {
processorContext.getCounters().addGroup(
MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP,
MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP);
}
String name = MRPigStatsUtil.getMultiStoreCounterName(this);
if (name != null) {
outputRecordCounter = multiStoreGroup.addCounter(name, name, 0);
}
}