You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by "Bikas Saha (JIRA)" <ji...@apache.org> on 2014/04/10 20:04:23 UTC
[jira] [Commented] (TEZ-373) Create UserPayload class
[ https://issues.apache.org/jira/browse/TEZ-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13965623#comment-13965623 ]
Bikas Saha commented on TEZ-373:
--------------------------------
USerPayload should have a PB object for serde so that we dont have to do this.
{code}- out.write(userPayload);
+ byte[] payload = userPayload.getBytes();
+ out.writeInt(payload.length);{code}
Once the UserPayload object has been deserialized into the internal code, we should be passing it around directly instead of the byte[] that we passed around initially. We would expect this method to now expect a UserPayload object instead of byte[], right? Same for other places in non-user facing code where we are currently passing around raw byte[]s. This is the basic premise of this jira - to encapsulate all internal uses of user payload byte[] into a new UserPayload object.
{code} EdgeManagerContextImpl(String srcVertexName, String destVertexName,
@Nullable byte[] userPayload) {
@@ -66,12 +67,12 @@ public class Edge {
checkNotNull(destVertexName, "destVertexName is null");
this.srcVertexName = srcVertexName;
this.destVertexName = destVertexName;
- this.userPayload = userPayload;
+ this.userPayload = new UserPayload(userPayload);{code}
Sorry for the late review. Was caught up with the release.
> Create UserPayload class
> ------------------------
>
> Key: TEZ-373
> URL: https://issues.apache.org/jira/browse/TEZ-373
> Project: Apache Tez
> Issue Type: Sub-task
> Reporter: Bikas Saha
> Assignee: Tsuyoshi OZAWA
> Labels: newbie
> Attachments: TEZ-373.1.patch, TEZ-373.2.patch, TEZ-373.3.patch, TEZ-373.4.patch, TEZ-373.5.patch
>
>
> Currently Tez allows user payload to be passed as byte[]. Within Tez code is hard to understand where byte[] is userPayload and where is not user payload. If we create a TezUserPayload class that contains byte[] as a member then its much easier to search and identify in code.
--
This message was sent by Atlassian JIRA
(v6.2#6252)