org.apache.hama.bsp
Interface BSPPeerInterface

All Superinterfaces:
BSPRPCProtocolVersion, Closeable, Constants, org.apache.hadoop.ipc.VersionedProtocol
All Known Subinterfaces:
BSPPeerProtocol
All Known Implementing Classes:
BSPPeer, GroomServer

public interface BSPPeerInterface
extends BSPRPCProtocolVersion, Closeable, Constants

BSP communication interface.


Field Summary
 
Fields inherited from interface org.apache.hama.bsp.BSPRPCProtocolVersion
versionID
 
Fields inherited from interface org.apache.hama.Constants
CLUSTER_DISTRIBUTED, CLUSTER_IS_DISTRIBUTED, DEFAULT_GROOM_RPC_HOST, DEFAULT_GROOM_RPC_PORT, DEFAULT_PEER_HOST, DEFAULT_PEER_PORT, DEFAULT_ZOOKEEPER_PAUSE, DEFAULT_ZOOKEEPER_RETRIES, DEFAULT_ZOOKEEPER_ROOT, DEFAULT_ZOOKEEPER_SERVER_ADDR, DEFAULT_ZOOKEPER_CLIENT_PORT, EMPTY_BYTE_ARRAY, GROOM_RPC_HOST, GROOM_RPC_PORT, GROOM_SERVER_IMPL, PEER_HOST, PEER_ID, PEER_PORT, UTF8_ENCODING, ZOOKEEPER_CONFIG_NAME, ZOOKEEPER_PAUSE, ZOOKEEPER_QUORUM, ZOOKEEPER_RETRIES, ZOOKEEPER_ROOT, ZOOKEEPER_SERVER_ADDRS, ZOOKEPER_CLIENT_PORT
 
Method Summary
 void clear()
          Clears all queues entries.
 String[] getAllPeerNames()
           
 BSPMessage getCurrentMessage()
           
 int getNumCurrentMessages()
           
 String getPeerName()
           
 long getSuperstepCount()
           
 void put(BSPMessage msg)
          Puts a message to local queue.
 void send(String peerName, BSPMessage msg)
          Send a data with a tag to another BSPSlave corresponding to hostname.
 void sync()
          Barrier Synchronization.
 
Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol
getProtocolVersion
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

send

void send(String peerName,
          BSPMessage msg)
          throws IOException
Send a data with a tag to another BSPSlave corresponding to hostname. Messages sent by this method are not guaranteed to be received in a sent order.

Parameters:
peerName -
msg -
Throws:
IOException

put

void put(BSPMessage msg)
         throws IOException
Puts a message to local queue.

Parameters:
msg -
Throws:
IOException

getCurrentMessage

BSPMessage getCurrentMessage()
                             throws IOException
Returns:
A message from the peer's received messages queue (a FIFO).
Throws:
IOException

getNumCurrentMessages

int getNumCurrentMessages()
Returns:
The number of messages in the peer's received messages queue.

sync

void sync()
          throws IOException,
                 org.apache.zookeeper.KeeperException,
                 InterruptedException
Barrier Synchronization. Sends all the messages in the outgoing message queues to the corresponding remote peers.

Throws:
InterruptedException
org.apache.zookeeper.KeeperException
IOException

getSuperstepCount

long getSuperstepCount()
Returns:
the count of current super-step

getPeerName

String getPeerName()
Returns:
The name of this peer in the format "hostname:port".

getAllPeerNames

String[] getAllPeerNames()
Returns:
The names of all the peers executing tasks from the same job (including this peer).

clear

void clear()
Clears all queues entries.



Copyright © 2011 The Apache Software Foundation