[jira] [Commented] (HAMA-982) Vertex.read/writeState() method throws NullPointerException

2016-01-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on HAMA-982:
-

GitHub user edwardyoon opened a pull request:

https://github.com/apache/hama/pull/8

HAMA-982: Vertex.read/writeState() method throws NullPointerException

This fixes reported bug.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/edwardyoon/hama HAMA-982

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/hama/pull/8.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #8


commit 1dced0e9c8faefd775360e1fd3f919a7c93be8f8
Author: Edward J. Yoon 
Date:   2016-01-18T01:19:51Z

HAMA-982: Vertex.read/writeState() method throws NullPointerException




> Vertex.read/writeState() method throws NullPointerException
> ---
>
> Key: HAMA-982
> URL: https://issues.apache.org/jira/browse/HAMA-982
> Project: Hama
>  Issue Type: Bug
>  Components: graph
>Affects Versions: 0.7.0
>Reporter: Edward J. Yoon
>Assignee: Edward J. Yoon
> Fix For: 0.7.1
>
>
> It occurs at partitioning and initial supersteps.
> >  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)



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


[GitHub] hama pull request: HAMA-982: Vertex.read/writeState() method throw...

2016-01-28 Thread edwardyoon
GitHub user edwardyoon opened a pull request:

https://github.com/apache/hama/pull/8

HAMA-982: Vertex.read/writeState() method throws NullPointerException

This fixes reported bug.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/edwardyoon/hama HAMA-982

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/hama/pull/8.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #8


commit 1dced0e9c8faefd775360e1fd3f919a7c93be8f8
Author: Edward J. Yoon 
Date:   2016-01-18T01:19:51Z

HAMA-982: Vertex.read/writeState() method throws NullPointerException




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (HAMA-982) Vertex.read/writeState() method throws NullPointerException

2016-01-28 Thread Edward J. Yoon (JIRA)
Edward J. Yoon created HAMA-982:
---

 Summary: Vertex.read/writeState() method throws 
NullPointerException
 Key: HAMA-982
 URL: https://issues.apache.org/jira/browse/HAMA-982
 Project: Hama
  Issue Type: Bug
  Components: graph
Affects Versions: 0.7.0
Reporter: Edward J. Yoon
Assignee: Edward J. Yoon
 Fix For: 0.7.1


It occurs when partitioning and initial supersteps.

>  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)



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


[jira] [Updated] (HAMA-982) Vertex.read/writeState() method throws NullPointerException

2016-01-28 Thread Edward J. Yoon (JIRA)

 [ 
https://issues.apache.org/jira/browse/HAMA-982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Edward J. Yoon updated HAMA-982:

Description: 
It occurs at partitioning and initial supersteps.

>  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)

  was:
It occurs when partitioning and initial supersteps.

>  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)


> Vertex.read/writeState() method throws NullPointerException
> ---
>
> Key: HAMA-982
> URL: https://issues.apache.org/jira/browse/HAMA-982
> Project: Hama
>  Issue Type: Bug
>  Components: graph
>Affects Versions: 0.7.0
>Reporter: Edward J. Yoon
>Assignee: Edward J. Yoon
> Fix For: 0.7.1
>
>
> It occurs at partitioning and initial supersteps.
> >  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)



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


[CANCEL][VOTE] Apache Hama 0.7.1 release (RC1)

2016-01-28 Thread Edward J. Yoon
New bug has found.. I'll rollback and re-build again after fix reported bug.

On Mon, Jan 25, 2016 at 8:55 AM, Edward J. Yoon  wrote:
> Hi all,
>
> I just created a first release candidate for the Apache Hama 0.7.1 release.
> This release fixes Hama streaming and YARN bugs, and includes new feature
> round-robin task scheduling.
>
> The RC1 is available at:
> http://people.apache.org/~edwardyoon/dist/0.7.1-RC1/
>
> Tags:
> https://github.com/apache/hama/tree/0.7.1-RC1
>
> Please try it, run the tests, verify checksum files, etc. and vote.
>
> Thanks!
>
> --
> Best Regards, Edward J. Yoon
>
>
>



-- 
Best Regards, Edward J. Yoon


Re: RE: RE: RE: RE: Do Hama support member member variable?

2016-01-28 Thread Edward J. Yoon
Wow, you find the bug. Thanks ;)

>  at org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)

When the framework assign vertices to the proper machine at initial
phase, vertex objects are transferred in serialized form. At this step
 user defined code won't work correctly. I'll fix soon.

Anyway, you should able to manage an array of TextPair objects like below:

private TextPair[] test = new TextPair[1];

public void readState(DataInput in) throws IOException {
  int size = in.readInt();
  test = new TextPair[size];
  for(int i = 0; i < size; i++) {
test[i].readFields(in);
  }
}

public void writeState(DataOutput out) throws IOException {
  out.writeInt(test.length);
  for(int i = 0; i < test.length; i++) {
test[i].write(out);
  }
}

Thanks.


On Thu, Jan 28, 2016 at 6:45 PM, 步青云  wrote:
> Thanks for your reply. You do help me a lot.
> I have tried to use two methods. Some problem are still bothering me.
> When I use the first method of using Hadoop built-in writable classes, I get 
> a NullPointerException meaning the parents is null, even though I have 
> initialize parents. The code is like this.
> static ArrayWritable parents= new ArrayWritable(TextPair.class);
>
>
> public void writeState(DataOutput out) throws IOException {
> out.writeBoolean(match);
> parents.write(out);
> }
>
>
> public void readState(DataInput in) throws IOException {
>match = in.readBoolean();
>parents.readFields(in);
> }
>
>
>
> And the error message is as follow:
> Exception in thread "pool-6-thread-2" java.lang.RuntimeException: 
> java.lang.NullPointerException
> at 
> org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:562)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
> at org.apache.hadoop.io.ArrayWritable.write(ArrayWritable.java:103)
> at ProbMatch$ProbMatchVertex.writeState(ProbMatch.java:154)
> at org.apache.hama.graph.Vertex.write(Vertex.java:311)
> at 
> org.apache.hama.util.WritableUtils.unsafeSerialize(WritableUtils.java:55)
> at org.apache.hama.graph.MapVerticesInfo.put(MapVerticesInfo.java:64)
> at 
> org.apache.hama.graph.GraphJobRunner.addVertex(GraphJobRunner.java:577)
> at 
> org.apache.hama.graph.GraphJobRunner.access$300(GraphJobRunner.java:64)
> at 
> org.apache.hama.graph.GraphJobRunner$Parser.run(GraphJobRunner.java:557)
>
>
>
> When I'm trying use the second method, I don't know how to read and write an 
> object array. I can use out.writeInt() method to write int. But when I need 
> to write an object. How can I do this? I'm so sorry that I'm not good at 
> Java. Here is the some code I'm trying to write.
>
>
> static TextPair[] arr = new TextPair[1];
>
>
> public void writeState(DataOutput out) throws IOException {
> out.writeBoolean(match);
> out.writeInt(arr.length);
> for(int i = 0; i < arr.length; i++) {
>   out.writeInt(arr[i].toString());  // Is this right?
> }}
>
>
> public void readState(DataInput in) throws IOException {
>match = in.readBoolean();
>int length = in.readInt();
>for(int i=0;i   arr[i] = in.read// How can I read the textpair here?
>}
> }
>
>
>
> I'm very grateful to your help. Thanks again.
> Best Regards, Ping Liu.
>
>
>
>
> -- Original --
> From:  "Edward J. Yoon";;
> Date:  Thu, Jan 28, 2016 11:51 AM
> To:  "user";
>
> Subject:  RE: RE: RE: RE: Do Hama support member member variable?
>
>
>
> Hi,
>
> You can use Hadoop built-in writable classes or own custom Writable.
>
> static ArrayWritable arr = new ArrayWritable(DoubleWritable.class);
>
>   public void writeState(DataOutput out) throws IOException {
> arr.write(out);
>   }
>
> Or,
>
> static int[] arr2 = new int[3];
>
>   public void writeState(DataOutput out) throws IOException {
> out.writeInt(arr2.length);
> for(int i = 0; i < arr2.length; i++) {
>   out.writeInt(arr2[i]);
> }
>   }
>
>   public void readState(DataInput in) throws IOException {
> int size = in.readInt();
> for(int i = 0; i < size; i++) {
>   arr2[i] = in.readInt();
> }
>   }
>
> --
> Best Regards, Edward J. Yoon
>
>
> -Original Message-
> From: 步?云 [mailto:mailliup...@qq.com]
> Sent: Thursday, January 28, 2016 11:16 AM
> To: user
> Subject: Re: RE: RE: RE: Do Hama support member member variable?
>
> Hi,
>  I still don't know how to use member variable. What's the input parameter
> DataOutput out in writeState() method? Could you please give me a example to
> use this method? Thanks a lot.
>  By the way, how can I deal with object member variable? For example, the
> member variable "private List parents" sto