org.apache.hama.bsp
Interface BSPPeerInterface

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

public interface BSPPeerInterface
extends BSPRPCProtocolVersion, java.io.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_CLIENT_PORT, DEFAULT_ZOOKEEPER_PAUSE, DEFAULT_ZOOKEEPER_RETRIES, DEFAULT_ZOOKEEPER_ROOT, DEFAULT_ZOOKEEPER_SERVER_ADDR, EMPTY_BYTE_ARRAY, GROOM_RPC_HOST, GROOM_RPC_PORT, GROOM_SERVER_IMPL, PEER_HOST, PEER_ID, PEER_PORT, UTF8_ENCODING, ZOOKEEPER_CLIENT_PORT, ZOOKEEPER_CONFIG_NAME, ZOOKEEPER_PAUSE, ZOOKEEPER_QUORUM, ZOOKEEPER_RETRIES, ZOOKEEPER_ROOT, ZOOKEEPER_SERVER_ADDRS, ZOOKEEPER_SESSION_TIMEOUT
 
Method Summary
 void clear()
          Clears all queues entries.
 java.lang.String[] getAllPeerNames()
           
 BSPMessage getCurrentMessage()
           
 int getNumCurrentMessages()
           
 java.lang.String getPeerName()
           
 long getSuperstepCount()
           
 void put(BSPMessage msg)
          Puts a message to local queue.
 void put(BSPMessageBundle messages)
          Puts a bundle of messages to local queue.
 void send(java.lang.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(java.lang.String peerName,
          BSPMessage msg)
          throws java.io.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:
java.io.IOException

put

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

Parameters:
msg -
Throws:
java.io.IOException

put

void put(BSPMessageBundle messages)
         throws java.io.IOException
Puts a bundle of messages to local queue.

Parameters:
messages -
Throws:
java.io.IOException

getCurrentMessage

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

getNumCurrentMessages

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

sync

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

Throws:
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
java.io.IOException

getSuperstepCount

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

getPeerName

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

getAllPeerNames

java.lang.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 © 2008-2011 The Apache Software Foundation. All Rights Reserved.