bamboo.softscribe
Class Scribe

java.lang.Object
  extended by ostore.util.StandardStage
      extended by bamboo.softscribe.Scribe
All Implemented Interfaces:
EventHandlerIF, SingleThreadedEventHandlerIF

public class Scribe
extends ostore.util.StandardStage
implements SingleThreadedEventHandlerIF

Scribe on Bamboo.

Version:
$Id: Scribe.java,v 1.2 2003/12/29 22:20:42 davidopp Exp $ Unlike Scribe, there is no CREATE operation. Also unlike Scribe, there are no explicit JOIN and LEAVE network messages; those are purely local operations. allChildGroups is a hashtable mapping a groupguid (the ID for a group, which is the destination GUID for messages for that group, and hence the determinant of the root of the multicast tree for that groupguid) to a hashtable. That second hashtable maps NodeID's of children of this node to Booleans indicating whether we have heard from that child since the last ChildAlarm was received. (We could store a timestamp instead.) myLocalGroups is a vector of groupguids of groups to which this node am subscribed. When a node wants to join a group, and periodically after it has joined, it routes an MCastJoinMsg to the groupguid. Upcalls at non-member nodes simply continue. When the message upcalls at the first member node (or the root), that node records the original sender in allChildGroups, marks the node as being heard from, and kills the message. When the ChildAlarm expires, we delete from allChildGroups all children from which we have not heard since the last ChildAlarm expired (and reset the heard-from flag). When a node multicasts, it routes an MCastUpMsg to the groupguid. Along the path, the message is forwarded. When the message reaches the root, the root generates a MCastDownMsg *network* (not Bamboo) message and sends it to each of its children for that tree. At each node, if the node is in the group, a local MCastDown is dispatched. In all cases the message is re-sent to that node's children, and so on.
Author:
David Oppenheimer

Nested Class Summary
protected static class Scribe.ChildAlarm
           
protected static class Scribe.ParentAlarm
           
 
Field Summary
 HashMap allChildGroups
           
protected static long app_id
           
protected  boolean DEBUG_MIN
           
protected  boolean initialized
           
protected  BigInteger my_guid
           
protected  ostore.util.SecureHash my_guid_sh
           
 Vector myLocalGroups
           
protected  Random rand
           
protected  LinkedList wait_q
           
 
Fields inherited from class ostore.util.StandardStage
classifier, DEBUG, event_types, inb_msg_types, my_node_id, my_sink, outb_msg_types, tag
 
Constructor Summary
Scribe()
           
 
Method Summary
 void handleEvent(QueueElementIF item)
           
 void init(ConfigDataIF config)
           
 
Methods inherited from class ostore.util.StandardStage
BUG, destroy, dispatch, handleEvents, now_ms, now_us
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_MIN

protected boolean DEBUG_MIN

rand

protected Random rand

initialized

protected boolean initialized

wait_q

protected LinkedList wait_q

app_id

protected static final long app_id

my_guid

protected BigInteger my_guid

my_guid_sh

protected ostore.util.SecureHash my_guid_sh

allChildGroups

public HashMap allChildGroups

myLocalGroups

public Vector myLocalGroups
Constructor Detail

Scribe

public Scribe()
       throws Exception
Throws:
Exception
Method Detail

init

public void init(ConfigDataIF config)
          throws Exception
Specified by:
init in interface EventHandlerIF
Overrides:
init in class ostore.util.StandardStage
Throws:
Exception

handleEvent

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