okumin commented on code in PR #5478:
URL: https://github.com/apache/hive/pull/5478#discussion_r2365964209
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java:
##########
@@ -385,17 +385,22 @@ public static int countOperatorsUpstream(Operator<?>
start, Set<Class<? extends
}
public static void setMemoryAvailable(final List<Operator<? extends
OperatorDesc>> operators,
- final long memoryAvailableToTask) {
- if (operators == null) {
+ final long memoryAvailable) {
+ if (operators == null || operators.isEmpty()) {
return;
}
+ final long memoryAvailablePerOperator = memoryAvailable / operators.size();
+ Preconditions.checkArgument(memoryAvailablePerOperator > 0);
+ if (operators.size() > 1) {
+ LOG.info("Assigning {} bytes to {} operators",
memoryAvailablePerOperator, operators.size());
+ }
for (Operator<? extends OperatorDesc> op : operators) {
if (op.getConf() != null) {
- op.getConf().setMaxMemoryAvailable(memoryAvailableToTask);
+ op.getConf().setMaxMemoryAvailable(memoryAvailablePerOperator);
}
if (op.getChildOperators() != null && !op.getChildOperators().isEmpty())
{
- setMemoryAvailable(op.getChildOperators(), memoryAvailableToTask);
+ setMemoryAvailable(op.getChildOperators(), memoryAvailablePerOperator);
Review Comment:
That's likely true. Only operators that buffer records are expected to use
`OperatorDesc#getMaxMemoryAvailable`. I suspect parallel operators could
concurrently buffer records.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]