[
https://issues.apache.org/jira/browse/TEZ-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14173170#comment-14173170
]
Siddharth Seth commented on TEZ-1666:
-------------------------------------
bq. Context.getUserPayload() will return a UserPayload object. If the DAG
creation code has provided a ByteBuffer then userPayload.getPayload() gives the
buffer to you. If the DAG creation code has not provided any ByteBuffer then
userPayload.getPayload() will return null. All scenarios are covered if these
semantics are documented. UserPayload.getPayload() is what the I/P/O need to
check for the ByteBuffer if they need a ByteBuffer.
I agree that this is an option - and can be done. The reason I opened the jira,
however, was because my first expectation was that getUserPayload will return
null since I hadn't specified one. Expected behaviour vs Unexpected behaviour
clarified via javadocs.
bq. The bottomline is whether the UserPayload will ever be augmented with
anything else in addition to the ByteBuffer that is currently being provided.
If we add something that the user is specifying, then there's no problem. The
question is whether Tez will try to re-use this field to store non
user-specified entities. I think maintaining a clean separation and letting
users control this particular field is better.
> UserPayload should be null if the payload is not specified
> ----------------------------------------------------------
>
> Key: TEZ-1666
> URL: https://issues.apache.org/jira/browse/TEZ-1666
> Project: Apache Tez
> Issue Type: Bug
> Reporter: Siddharth Seth
> Priority: Critical
>
> As an example in the ProcessorDescriptor - if no payload is specified,
> context.getUserPayload should return null.
> SleepProcessor has an explicit check for a null payload, to enable default
> sleep value - which fails.
> Marking as critical since this is an API behaviour inconsistency.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)