bamboo.openhash.multicast
Class MulticastClient

java.lang.Object
  extended by bamboo.util.StandardStage
      extended by bamboo.openhash.multicast.MulticastClient
All Implemented Interfaces:
EventHandlerIF, SingleThreadedEventHandlerIF

public class MulticastClient
extends StandardStage
implements SingleThreadedEventHandlerIF

An implementation of multicast.


Nested Class Summary
 class MulticastClient.JoinGetDoneCb
           
 class MulticastClient.JoinPutDoneCb
           
static class MulticastClient.JoinState
           
 class MulticastClient.PingState
           
 class MulticastClient.ResendState
           
 
Field Summary
protected  ASyncCore acore
           
protected  GatewayClient client
           
protected  MessageDigest digest
           
protected  boolean exception_seen
           
protected  BigInteger groupname
           
protected static BigInteger MOD
           
protected  InetSocketAddress my_addr
           
protected  byte[] my_addr_bytes
           
protected  BigInteger my_key
           
protected  ostore.util.NodeId my_nodeid
           
protected  PriorityQueue[] queue
           
protected  int replication
           
protected static int total_levels
           
protected static BigInteger TWO
           
 
Fields inherited from class bamboo.util.StandardStage
classifier, DEBUG, event_types, inb_msg_types, logger, my_node_id, my_sink, outb_msg_types, sim_running
 
Constructor Summary
MulticastClient()
           
 
Method Summary
static byte[] addr2bytes(InetSocketAddress addr)
           
static byte[] bi2bytes(BigInteger i)
           
static InetSocketAddress bytes2addr(byte[] bytes)
           
static BigInteger bytes2bi(byte[] bytes)
           
 int dispatch_forward(int level, StatMessage sm)
           
 void dispatch_lat_req(MulticastClient.PingState ping_state)
           
 int dispatch_send(int level, int msg_num)
           
protected  int get_recv_level(BigInteger this_key, BigInteger recv_key, int num_levels)
           
 void handle_lat_resp(MulticastClient.PingState ping_state, long rtt_ms)
           
 void handleEvent(QueueElementIF item)
           
 void init(ConfigDataIF config)
           
protected  void join_get(MulticastClient.JoinState state)
           
protected  void join_put(MulticastClient.JoinState state)
           
 void join(BigInteger groupname, int ttl_s, String app, ASyncCore.TimerCB cb, Object user_data)
           
protected  boolean opposite_partition(BigInteger this_key, BigInteger get_key, int level)
           
protected  BigInteger partition_number(BigInteger key)
           
 void receive(StatMessage nm)
           
 void remove_from_queue(MulticastClient.PingState ping_state)
           
protected  BigInteger rendezvous_point(BigInteger key, BigInteger groupname, int level)
           
protected  boolean same_partition(BigInteger this_key, BigInteger get_key, int level)
           
 void send_msg(int msg_num, ASyncCore.TimerCB cb, Object user_data)
           
 
Methods inherited from class bamboo.util.StandardStage
BUG, BUG, BUG, config_get_boolean, config_get_double, config_get_int, config_get_string, configGetInt, destroy, dispatch, enqueue, handleEvents, lookup_stage, now_ms, timer_ms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TWO

protected static BigInteger TWO

MOD

protected static BigInteger MOD

exception_seen

protected boolean exception_seen

client

protected GatewayClient client

acore

protected ASyncCore acore

digest

protected MessageDigest digest

my_key

protected BigInteger my_key

my_addr

protected InetSocketAddress my_addr

my_addr_bytes

protected byte[] my_addr_bytes

my_nodeid

protected ostore.util.NodeId my_nodeid

replication

protected int replication

total_levels

protected static int total_levels

groupname

protected BigInteger groupname

queue

protected PriorityQueue[] queue
Constructor Detail

MulticastClient

public MulticastClient()
Method Detail

rendezvous_point

protected BigInteger rendezvous_point(BigInteger key,
                                      BigInteger groupname,
                                      int level)

partition_number

protected BigInteger partition_number(BigInteger key)

opposite_partition

protected boolean opposite_partition(BigInteger this_key,
                                     BigInteger get_key,
                                     int level)

same_partition

protected boolean same_partition(BigInteger this_key,
                                 BigInteger get_key,
                                 int level)

get_recv_level

protected int get_recv_level(BigInteger this_key,
                             BigInteger recv_key,
                             int num_levels)

bytes2addr

public static InetSocketAddress bytes2addr(byte[] bytes)

addr2bytes

public static byte[] addr2bytes(InetSocketAddress addr)

bi2bytes

public static byte[] bi2bytes(BigInteger i)

bytes2bi

public static BigInteger bytes2bi(byte[] bytes)

init

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

join

public void join(BigInteger groupname,
                 int ttl_s,
                 String app,
                 ASyncCore.TimerCB cb,
                 Object user_data)

join_get

protected void join_get(MulticastClient.JoinState state)

join_put

protected void join_put(MulticastClient.JoinState state)

send_msg

public void send_msg(int msg_num,
                     ASyncCore.TimerCB cb,
                     Object user_data)

dispatch_send

public int dispatch_send(int level,
                         int msg_num)

receive

public void receive(StatMessage nm)

dispatch_forward

public int dispatch_forward(int level,
                            StatMessage sm)

dispatch_lat_req

public void dispatch_lat_req(MulticastClient.PingState ping_state)

remove_from_queue

public void remove_from_queue(MulticastClient.PingState ping_state)

handle_lat_resp

public void handle_lat_resp(MulticastClient.PingState ping_state,
                            long rtt_ms)

handleEvent

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