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

Edward J. Yoon commented on HAMA-955:
-------------------------------------

I tested your patch with below code, but results are incorrect. Before apply it 
to other source code, you can test using junit. MultiThreading scenario also 
can be tested.

{code}
  @Test
  public void testUnSafe() throws IOException {
    GraphJobMessage msg = new GraphJobMessage(new IntWritable());
    msg.add(WritableUtils.serialize(new IntWritable(3)));
    msg.add(WritableUtils.serialize(new IntWritable(4)));
    msg.add(WritableUtils.serialize(new IntWritable(5)));
    
    UnsafeByteArrayInputStream bis = new 
UnsafeByteArrayInputStream(msg.getValuesBytes());

    for (int i = 0; i < msg.getNumOfValues(); i++) {
      IntWritable tmp = new IntWritable();
      tmp.readFields(bis);
      System.out.println(tmp.get());
    }
  }
{code}

> Support UnsafeByteArrayInputStream and UnSafeByteArrayOutputStream
> ------------------------------------------------------------------
>
>                 Key: HAMA-955
>                 URL: https://issues.apache.org/jira/browse/HAMA-955
>             Project: Hama
>          Issue Type: Task
>          Components: bsp core
>    Affects Versions: 0.7.0
>            Reporter: Minho Kim
>         Attachments: HAMA-955.patch, HAMA-955_v1.patch, HAMA-955_v2.patch, 
> HAMA-955_v3.patch
>
>
> You'll be able to use UnsafeByteArrayInput and Output Stream.
> Although it is not safe, it can give you more faster performance than 
> java.io.ByteArrayInput(Output)Stream.
> If you need to run more faster job, you can use this through setting Hama 
> configuration.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to