hama-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 顾荣 <gurongwal...@gmail.com>
Subject Re: Question about the "peer.getPeerIndex()" API in Hama
Date Wed, 19 Sep 2012 00:19:32 GMT
Okay, I got it ,thanks.

2012/9/19 Suraj Menon <surajsmenon@apache.org>

> 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 = peer.getAllPeerNames();
> > Arrays.sort(names);
> > int index = 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 顾荣 <gurongwalker@gmail.com>:
> > > 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 and
> > > PeerName info in Hama.
> > >
> > > In setup function, I choose a peer as master, and the in bsp function
> > 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message