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 76EDAD975 for ; Wed, 19 Sep 2012 01:11:06 +0000 (UTC) Received: (qmail 75868 invoked by uid 500); 19 Sep 2012 01:11:06 -0000 Delivered-To: apmail-hama-user-archive@hama.apache.org Received: (qmail 75852 invoked by uid 500); 19 Sep 2012 01:11:06 -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 75843 invoked by uid 99); 19 Sep 2012 01:11:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 01:11:06 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gurongwalker@gmail.com designates 209.85.219.47 as permitted sender) Received: from [209.85.219.47] (HELO mail-oa0-f47.google.com) (209.85.219.47) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 01:10:58 +0000 Received: by oagn9 with SMTP id n9so581382oag.34 for ; Tue, 18 Sep 2012 18:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lrYHhFvmj6pLWribiO8CDUOMvq1aLlva7m/jxmoGQ9g=; b=rbcr0d5vtp4RQX3RBFOAFEF9ZxN05/nul5zTz1W+pOTMaRS6FZaeQyxP1cgETzARDW h2vHRNVvd1s4y2EzzzciZyibPmv9+Go9Ued0rtu1pyBzr7MnwZM8px/cWP3qZ/ptt0Ki Xoow8IvQ4vXjoUdyUbh7sxks7mdzzFTBKc02GYgxgXoSqqCOYtSgwLGvPeGUOzvNDDJQ hgccV71oGtEXqsZCcBjM4QnEWUEUsfJqIHUVWUHQRHcT3B3rqqbk3AclSo9oNbZbPrjj jVe7yMFIyLj68QQ/6VRdKhkNViUGg+Gst4QHC1S9rwz/8/2pMi7BlHQB4b7Bh834kiGk 42Yg== MIME-Version: 1.0 Received: by 10.60.1.106 with SMTP id 10mr1834666oel.84.1348017037018; Tue, 18 Sep 2012 18:10:37 -0700 (PDT) Received: by 10.76.9.3 with HTTP; Tue, 18 Sep 2012 18:10:36 -0700 (PDT) In-Reply-To: References: Date: Wed, 19 Sep 2012 09:10:36 +0800 Message-ID: Subject: Re: Question about the "peer.getPeerIndex()" API in Hama From: =?GB2312?B?ucvI2Q==?= To: user@hama.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1ebb8a487fa04ca03acb7 --e89a8fb1ebb8a487fa04ca03acb7 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Hi=A3=AC BTW, is there a java user API doc for Hama? Regards, Walker 2012/9/19 =B9=CB=C8=D9 > Okay, I got it ,thanks. > > > 2012/9/19 Suraj Menon > >> Hi Walker, >> >> The old contract was changed because if a task gets re-allocated on a >> different machine on failure, that can change the peer-Ids of all the >> tasks. >> The current trunk version returns the task-id, which remains same >> throughout the lifecycle of the job execution. >> With this peerIndex could be made a part of your computation logic. >> >> -Suraj >> >> On Tue, Sep 18, 2012 at 11:59 AM, Thomas Jungblut < >> thomas.jungblut@gmail.com >> > wrote: >> >> > Hi Walker, >> > >> > seems the contract is broken and the array is not sorted anymore. >> > >> > Try to use: >> > >> > String[] names =3D peer.getAllPeerNames(); >> > Arrays.sort(names); >> > int index =3D Arrays.binarySearch(names, peer.getPeerName()); >> > >> > Sorry for the inconvenience, we have replaced it with the task id in >> > the latest trunk, so this will be fixed in the next release. >> > >> > 2012/9/18 =B9=CB=C8=D9 : >> > > Hi, >> > > >> > > I have a Hama cluster of 3 nodes. The host name of the nodes are >> > slave019, >> > > slave020, slave021. I wirte a simple program to test the PeerIndex a= nd >> > > PeerName info in Hama. >> > > >> > > In setup function, I choose a peer as master, and the in bsp functio= n >> > each >> > > peer get its PeerIndex and its PeerName by peer.getPeerIndex() and >> > > peer.getPeerName() API and send it to the master peer. Lastly, in >> > cleanup >> > > function of the master peer, it write out the messages in its queue. >> The >> > > result is below: >> > > >> > > peerName: slave020:61001 peerIndex: -7 >> > > peerName: slave019:61002 peerIndex: 4 >> > > peerName: slave021:61001 peerIndex: 6 >> > > peerName: slave019:61001 peerIndex: -1 >> > > peerName: slave021:61002 peerIndex: -8 >> > > peerName: slave020:61002 peerIndex: -7 >> > > peerName: slave019:61003 peerIndex: 5 >> > > peerName: slave021:61003 peerIndex: 7 >> > > peerName: slave020:61003 peerIndex: -7 >> > > >> > > The peerNames are reasonable, but I am confused with the peerIndex >> > > information. What does they mean? According to the source code of >> > > BSPPeer.java, the comment message is below >> > > /** >> > > * @return the index of this peer from sorted array by name. >> > > */ >> > > public int getPeerIndex(); >> > > >> > > However, the peerIndex messages I got seem not to be so....Can you >> give >> > me >> > > a hint? >> > > >> > > Thanks in advance. >> > > >> > > Walker >> > >> > > --e89a8fb1ebb8a487fa04ca03acb7--