[ 
https://issues.apache.org/jira/browse/TEZ-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14172817#comment-14172817
 ] 

Siddharth Seth commented on TEZ-1666:
-------------------------------------

bq. If ProcDesc.setUserPayload() not called by the user, the ideally 
procContext.getPayload() should also not be called because this proc does not 
care about the payload. If it does call getUserPayload for some reason then the 
actual ByteBuffer returned via that would still be null. Can this just be fixed 
by clarifying the javadoc?
That is an option, but the immediate expectation would be that if a payload has 
not been specified, nothing should be returned. SleepProcessor is an example 
where it uses defaults when the payload is not set - and that's not an 
unreasonable usage. Since there's a layer of indirection - it gets confusing.
Are there any disadvantages of returning a null if the UserPayload has not been 
set ?

> 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)

Reply via email to