From user-return-1476-apmail-hama-user-archive=hama.apache.org@hama.apache.org Thu Jan 28 03:51:22 2016 Return-Path: X-Original-To: apmail-hama-user-archive@www.apache.org Delivered-To: apmail-hama-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B77E318260 for ; Thu, 28 Jan 2016 03:51:22 +0000 (UTC) Received: (qmail 66297 invoked by uid 500); 28 Jan 2016 03:51:19 -0000 Delivered-To: apmail-hama-user-archive@hama.apache.org Received: (qmail 66138 invoked by uid 500); 28 Jan 2016 03:51:19 -0000 Mailing-List: contact user-help@hama.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hama.apache.org Delivered-To: mailing list user@hama.apache.org Received: (qmail 66125 invoked by uid 99); 28 Jan 2016 03:51:19 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2016 03:51:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D8CF1C0D4B for ; Thu, 28 Jan 2016 03:51:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.427 X-Spam-Level: X-Spam-Status: No, score=0.427 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, MIME_QP_LONG_LINE=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, SPF_HELO_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 2jfN5utE-yM2 for ; Thu, 28 Jan 2016 03:51:10 +0000 (UTC) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 0543942A33 for ; Thu, 28 Jan 2016 03:51:07 +0000 (UTC) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O1N00S6I9CZWG40@mailout1.samsung.com> for user@hama.apache.org; Thu, 28 Jan 2016 12:50:59 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 94.DE.04972.32099A65; Thu, 28 Jan 2016 12:50:59 +0900 (KST) X-AuditID: cbfee68e-f793c6d00000136c-58-56a99023b968 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 2C.7E.09068.32099A65; Thu, 28 Jan 2016 12:50:59 +0900 (KST) MIME-version: 1.0 Content-type: TEXT/PLAIN; CHARSET=EUC-KR Content-transfer-encoding: quoted-printable Received: from edwardyoon ([10.113.70.76]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O1N006E19CZS710@mmp1.samsung.com> for user@hama.apache.org; Thu, 28 Jan 2016 12:50:59 +0900 (KST) From: "Edward J. Yoon" To: user@hama.apache.org References: In-reply-to: Subject: RE: RE: RE: RE: Do Hama support member member variable? Date: Thu, 28 Jan 2016 12:51:01 +0900 Message-id: <004d01d1597f$1aee5280$50caf780$@samsung.com> X-Mailer: Microsoft Outlook 14.0 Thread-index: AQG2lqriw0tvsHgNcRg8IWhP6aHKMp9FwgSQ Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRmVeSWpSXmKPExsWyRsSkRFd5wsowg737lCz2XpvJ5sDo8e5w I2MAYxSXTUpqTmZZapG+XQJXxuqH69gKrupUvJp7lbWBcbJyFyMnh4SA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zOEUMJO4ur0GJCws4CDx9MZtVhCbRUBV4tnBNawgJbwClhJfVmpBnKYgsePsa0aIiUYS6zte sEKcICKx78U7xgmMgrOQHDoL4dBZSA6dhaRjASPLKkaJ1ILkguKk9FyjvNRyveLE3OLSvHS9 5PzcTYzgGH0mvYPx8C73Q4wCHIxKPLwMUSvDhFgTy4orcw8xSnAwK4nwKlYDhXhTEiurUovy 44tKc1KLDzGaAr0xkVlKNDkfmD7ySuINjU3MjCyNzA0tjIzNlcR5912KDBMSSE8sSc1OTS1I LYLpY+LglGpgZM29ZPOr9dnrn/a2J+etXup2I2lnspKqSuQJxlMB/t+m3GGdEbRWquvEob3n 9rt9WSm+yt9upr3q2teCHt9c/N523Wn03Lci+7/PxOfbJaqOH+Zy1Tz59ZTwjfQlWuc3aX9t /vL3aFyc+fIuu+53DrdXn/+/4vyBC0EK2+eXKUgWM3sKOz4IsVBiKc5INNRiLipOBADNQDja 5wIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Hi, You can use Hadoop built-in writable classes or own custom Writable. static ArrayWritable arr =3D new ArrayWritable(DoubleWritable.class); public void writeState(DataOutput out) throws IOException { arr.write(out); } Or, static int[] arr2 =3D new int[3]; public void writeState(DataOutput out) throws IOException { out.writeInt(arr2.length); for(int i =3D 0; i < arr2.length; i++) { out.writeInt(arr2[i]); } } public void readState(DataInput in) throws IOException { int size =3D in.readInt(); for(int i =3D 0; i < size; i++) { arr2[i] =3D in.readInt(); } } -- Best Regards, Edward J. Yoon -----Original Message----- From: =DC=C6=3F=E9=F6 [mailto:mailliuping@qq.com] Sent: Thursday, January 28, 2016 11:16 AM To: user Subject: Re: RE: RE: RE: Do Hama support member member variable=3F Hi, I still don't know how to use member variable. What's the input parameter DataOutput out in writeState() method=3F Could you please give me a example to use this method=3F Thanks a lot. By the way, how can I deal with object member variable=3F For example, the member variable "private List parents" store the parents of the vertex. How can I read and write this variable=3F If you can take time to reply me, I will be very grateful to you. Best Regard, Ping Liu. ------------------ Original ------------------ From: "Edward J. Yoon";; Date: Wed, Jan 27, 2016 03:12 PM To: "user"; Subject: RE: RE: RE: Do Hama support member member variable=3F Just FYI, Hama 0.7.1 release candidate is now available. Please feel free to use this, and it'd nice if you can let me know whether it works well with you. Release tarball: http://people.apache.org/~edwardyoon/dist/0.7.1-RC1 -- Best Regards, Edward J. Yoon -----Original Message----- From: =DC=C6=3F=E9=F6 [mailto:mailliuping@qq.com] Sent: Wednesday, January 27, 2016 11:01 AM To: user Subject: Re: RE: RE: Do Hama support member member variable=3F I know. If I use the static variable like "private static boolean match", I could get the right value of match too. Could I use static variable=3F Thanks a lot. Best regards. Ping Liu. ------------------ Original ------------------ From: "Edward J. Yoon";; Date: Wed, Jan 27, 2016 09:39 AM To: "user"; Subject: RE: RE: Do Hama support member member variable=3F Basically Vertex object is writable, and we store the vertex objects in serialized form. There are two purposes: 1) to reduce memory usage 2) to write on file system (checkpoint and recovery). So, you should use readState() and writeState() methods to save object member variables. Thanks! -- Best Regards, Edward J. Yoon -----Original Message----- From: =DC=C6=3F=E9=F6 [mailto:mailliuping@qq.com] Sent: Wednesday, January 27, 2016 10:27 AM To: user Subject: Re: RE: Do Hama support member member variable=3F Hi, Thank you very much. You helped me a lot. But I still don't know how to use readState() and writeState() methods. What is the input parameter DataInput in and DataOutput out=3F And as far as I know, I can assign the value of member variable directly in hama-0.6.3, such as match =3D true. Why I can't do this in Hama-0.7.0=3F Waiting for your reply. Thanks. Best Regards, Ping Liu. ------------------ Original ------------------ From: "Edward J. Yoon";; Date: Wed, Jan 27, 2016 07:15 AM To: "user"; Subject: RE: Do Hama support member member variable=3F Hi, You should use readState() and writeState() methods like below: public static class ProbMatchVertex extends Vertex { private boolean match =3D false; public void readState(DataInput in) throws IOException { match =3D in.readBoolean(); } public void writeState(DataOutput out) throws IOException { out.writeBoolean(match); } .. } -- Best Regards, Edward J. Yoon -----Original Message----- From: =B2=BD=C7=E0=D4=C6 [mailto:mailliuping@qq.com] Sent: Tuesday, January 26, 2016 10:16 PM To: user Subject: Do Hama support member member variable=3F Hello, I'm trying to run a graph job. But i have got some problems. I want to use member variable in vertex class, the code is as follow. I have changed the value of the member variable in one superstep. But when I use this member variable in next superstep, the value of this member variable is still the defalult value. For example, "match" is the member variable. I have changed the value of "match" to be ture in superstep 0, but when I print "match" in superstep 1, the result was "match: false". Could anyone tell me why the value of member variable is changed=3F Thanks very much. Best wishes. public static class ProbMatchVertex extends Vertex { private boolean match =3D false; @Override public void compute(Iterable messages) throws IOException { if (getSuperstepCount() =3D=3D 0) { match =3D true; sendMessageToNeighbors(new TriTextPair(getVertexID(), getVertexLabel(), new Text(""))); } else if(getSuperstepCount() =3D=3D 1){ System.out.println("match:" + match); parents =3D new ArrayList(); for(TriTextPair msg : messages){ parents.add(msg); sendMessage(msg.getFirst(), new TriTextPair(getVertexID(), getVertexLabel(), new Text(""))); } } } Ping Liu