boolean close() throws Exception { try { if (handleGroupKey && groupKey != null) { // If a operator wants to do some work at the end of a group reducer.endGroup(); } } catch (Exception e) { if (!abort) { // signal new failure to map-reduce throw new RuntimeException("Hive Runtime Error while closing operators: " + e.getMessage(), e); } } return abort; }
protected final void defaultEndGroup() throws HiveException { LOG.debug("Ending group"); if (CollectionUtils.isEmpty(childOperators)) { LOG.trace("No children operators; end group done"); return; } LOG.trace("Ending group for children"); for (Operator<? extends OperatorDesc> op : childOperators) { op.endGroup(); } LOG.trace("End group done"); }
boolean close() throws Exception { try { if (handleGroupKey && groupKey != null) { // If a operator wants to do some work at the end of a group reducer.endGroup(); } } catch (Exception e) { if (!abort) { // signal new failure to map-reduce throw new RuntimeException("Hive Runtime Error while closing operators: " + e.getMessage(), e); } } return abort; }
protected final void defaultEndGroup() throws HiveException { if (isLogDebugEnabled) { LOG.debug("Ending group"); } if (childOperators == null) { return; } if (isLogDebugEnabled) { LOG.debug("Ending group for children:"); } for (Operator<? extends OperatorDesc> op : childOperators) { op.endGroup(); } if (isLogDebugEnabled) { LOG.debug("End group Done"); } }
@Override public void endGroup() throws HiveException { if (childOperators == null) { return; } // We will start a new key group. We can call flush the buffer // of children from lastChildIndex (inclusive) to the last child and // propagate processGroup to those children. for (int i = lastChildIndex; i < childOperatorsArray.length; i++) { Operator<? extends OperatorDesc> child = childOperatorsArray[i]; child.flush(); child.endGroup(); for (int childTag: newChildOperatorsTag[i]) { child.processGroup(childTag); } } }
@Override public void processGroup(int tag) throws HiveException { processGroupCalled[tag] = true; boolean shouldProceed = true; for (int i = 0; i < numParents; i++) { if (!processGroupCalled[i]) { shouldProceed = false; break; } } if (shouldProceed) { Operator<? extends OperatorDesc> child = childOperatorsArray[0]; int childTag = childOperatorsTag[0]; child.flush(); child.endGroup(); child.processGroup(childTag); } }
@Override public void endGroup() throws HiveException { if (childOperators == null) { return; } // We will start a new key group. We can call flush the buffer // of children from lastChildIndex (inclusive) to the last child and // propagate processGroup to those children. for (int i = lastChildIndex; i < childOperatorsArray.length; i++) { Operator<? extends OperatorDesc> child = childOperatorsArray[i]; child.flush(); child.endGroup(); for (int childTag: newChildOperatorsTag[i]) { child.processGroup(childTag); } } }
/** * We assume that the input rows associated with the same key are ordered by * the tag. Because a tag maps to a childindex, when we see a new childIndex, * we will not see the last childIndex (lastChildIndex) again before we start * a new key group. So, we can call flush the buffer of children * from lastChildIndex (inclusive) to currentChildIndex (exclusive) and * propagate processGroup to those children. * @param currentChildIndex the childIndex we have right now. * @throws HiveException */ private void endGroupIfNecessary(int currentChildIndex) throws HiveException { if (lastChildIndex != currentChildIndex) { for (int i = lastChildIndex; i < currentChildIndex; i++) { Operator<? extends OperatorDesc> child = childOperatorsArray[i]; child.flush(); child.endGroup(); for (int childTag: newChildOperatorsTag[i]) { child.processGroup(childTag); } } lastChildIndex = currentChildIndex; } }
@Override public void processGroup(int tag) throws HiveException { processGroupCalled[tag] = true; boolean shouldProceed = true; for (int i = 0; i < numParents; i++) { if (!processGroupCalled[i]) { shouldProceed = false; break; } } if (shouldProceed) { Operator<? extends OperatorDesc> child = childOperatorsArray[0]; int childTag = childOperatorsTag[0]; child.flush(); child.endGroup(); child.processGroup(childTag); } }
LOG.trace("End Group"); reducer.endGroup();
/** * We assume that the input rows associated with the same key are ordered by * the tag. Because a tag maps to a childindex, when we see a new childIndex, * we will not see the last childIndex (lastChildIndex) again before we start * a new key group. So, we can call flush the buffer of children * from lastChildIndex (inclusive) to currentChildIndex (exclusive) and * propagate processGroup to those children. * @param currentChildIndex the childIndex we have right now. * @throws HiveException */ private void endGroupIfNecessary(int currentChildIndex) throws HiveException { if (lastChildIndex != currentChildIndex) { for (int i = lastChildIndex; i < currentChildIndex; i++) { Operator<? extends OperatorDesc> child = childOperatorsArray[i]; child.flush(); child.endGroup(); for (int childTag: newChildOperatorsTag[i]) { child.processGroup(childTag); } } lastChildIndex = currentChildIndex; } }
LOG.trace("End Group"); reducer.endGroup();
reducer.endGroup();
reducer.endGroup();
} else { reducer.endGroup();
reducer.endGroup();
reducer.endGroup();
LOG.trace("End Group"); reducer.endGroup();
} else { reducer.endGroup();
} else { reducer.endGroup();