ostore.network
Class Network

java.lang.Object
  |
  +--ostore.network.Network
All Implemented Interfaces:
EventHandlerIF, ProfilableIF, SingleThreadedEventHandlerIF

public class Network
extends Object
implements SingleThreadedEventHandlerIF, EventHandlerIF, ProfilableIF

A stage to tie the OceanStore dispatch model to Sandstorms asyncronous networking functionality. To send a message on the network, inherit it from NetworkMessage, set inbound = false, and dispatch it. This stage will catch the event, open a connection (if one is not open already), and send it. To receive messages, just listen for the correct type conditioned on inbound == true.

Version:
$Id: Network.java,v 1.80 2003/05/20 01:32:31 hweather Exp $
Author:
Sean C. Rhea

Nested Class Summary
protected static class Network.MsgsBytes
           
static class Network.NatHackMsg
           
 
Field Summary
protected  boolean bw_counting
           
static boolean DEBUG
           
static boolean DEBUG_SERIALIZATION
           
protected  Map inbound_bw
           
protected  Map outbound_bw
           
 
Constructor Summary
Network()
           
 
Method Summary
 void destroy()
           
 void handle_sink_flushed_event(SinkFlushedEvent flush)
           
 void handleEvent(QueueElementIF item)
           
 void handleEvents(QueueElementIF[] items)
           
 void init(ConfigDataIF config)
           
protected  void print_bw_numbers(Object user_data)
           
protected  NodeId process_identity_message(IdentityMessage ident)
           
 int profileSize()
           
protected  void record_bytes(Map map, NodeId peer, int sz, Object msg)
           
protected  void send_message(NetworkMessage msg, ATcpConnection conn, NodeId peer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

DEBUG_SERIALIZATION

public static final boolean DEBUG_SERIALIZATION
See Also:
Constant Field Values

inbound_bw

protected Map inbound_bw

outbound_bw

protected Map outbound_bw

bw_counting

protected boolean bw_counting
Constructor Detail

Network

public Network()
Method Detail

handle_sink_flushed_event

public void handle_sink_flushed_event(SinkFlushedEvent flush)

record_bytes

protected void record_bytes(Map map,
                            NodeId peer,
                            int sz,
                            Object msg)

send_message

protected void send_message(NetworkMessage msg,
                            ATcpConnection conn,
                            NodeId peer)

handleEvent

public void handleEvent(QueueElementIF item)
                 throws EventHandlerException
Specified by:
handleEvent in interface EventHandlerIF
EventHandlerException

print_bw_numbers

protected void print_bw_numbers(Object user_data)

handleEvents

public void handleEvents(QueueElementIF[] items)
                  throws EventHandlerException
Specified by:
handleEvents in interface EventHandlerIF
EventHandlerException

init

public void init(ConfigDataIF config)
          throws Exception
Specified by:
init in interface EventHandlerIF
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface EventHandlerIF
Exception

profileSize

public int profileSize()
Specified by:
profileSize in interface ProfilableIF

process_identity_message

protected NodeId process_identity_message(IdentityMessage ident)