|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbamboo.util.StandardStage
bamboo.dht.Dht
public class Dht
Distributed hash table layer for Bamboo.
| Nested Class Summary | |
|---|---|
static class |
Dht.DiskSizeMsg
|
static class |
Dht.ForwardedGetReqMsg
|
static class |
Dht.ForwardedGetState
|
static class |
Dht.ForwardThroughLeafSetReq
|
static class |
Dht.GetReq
|
static class |
Dht.GetReqPayload
|
protected static class |
Dht.GetReqState
|
static class |
Dht.GetResp
|
static class |
Dht.GetRespMsg
|
static interface |
Dht.NetMsgResCb
|
static class |
Dht.PutReq
|
static class |
Dht.PutReqPayload
|
static class |
Dht.PutResp
|
static class |
Dht.PutRespMsg
|
| Field Summary | |
|---|---|
protected Map |
active_gets
|
protected Map |
active_puts
|
protected static long |
app_id
|
protected double[] |
avail_tokens
One token per byte. |
protected Map |
client_to_usage
|
protected double[] |
disk_sizes
The sizes of our virtual disks, in bytes. |
protected double[] |
fill_rates
Fill rates in bytes per millisecond, only set by compute_rates (). |
ASyncCore.TimerCB |
forwarded_get_timeout
|
protected static int |
FORWARDED_GET_TIMEOUT
|
protected Map |
forwarded_gets
|
protected Rpc.RequestCB |
fwd_thru_ls_req_cb
|
protected Rpc.ResponseCB |
fwd_thru_ls_resp_cb
|
protected ASyncCore.TimerCB |
get_retry_cb
|
protected static long |
GET_TIMEOUT
|
protected boolean |
initialized
|
protected boolean |
iterative_routing
|
protected long[] |
last_fill_time
The last time we added any tokens to each bucket. |
protected int |
leaf_set_size
|
protected Map[] |
ls_disk_sizes
Keep track of the disk sizes of our leaf set, and scale put rates based on them. |
protected BigInteger |
MAX_GUID
|
protected double[] |
max_tokens
Capacity limits for the token buckets. |
static int |
MAX_TTL_SEC
|
protected static BigInteger |
MIN_GUID
|
protected int |
min_replica_count
|
protected static BigInteger |
NEG_ONE
|
protected long |
next_get_seq
|
protected long |
next_put_seq
|
protected BambooNeighborInfo[] |
preds
|
protected ASyncCore.TimerCB |
put_retry_cb
|
protected static long |
PUT_TIMEOUT
|
protected Random |
rand
|
protected BigInteger |
resp_high
|
protected BigInteger |
resp_low
|
protected Rpc |
rpc
|
protected LinkedList |
slop
|
protected int[] |
slop_cap
|
protected int[] |
slop_size
|
protected ASyncCore.TimerCB |
slop_to_disk_cb
|
protected Map[] |
slop_usage
|
protected BambooNeighborInfo[] |
succs
|
protected ASyncCore.TimerCB |
swap_disk_sizes_cb
|
protected long |
total_usage
|
protected int[] |
ttl_sec_ranges
|
protected LinkedList |
wait_q
|
| Fields inherited from class bamboo.util.StandardStage |
|---|
acore, classifier, DEBUG, event_types, inb_msg_types, logger, my_node_id, my_sink, outb_msg_types, sim_running |
| Constructor Summary | |
|---|---|
Dht()
|
|
| Method Summary | |
|---|---|
protected void |
add_to_disk(int size,
int ttl_sec)
|
protected void |
add_to_slop(BambooRouteDeliver msg,
Dht.PutReqPayload payload)
|
protected boolean |
below_fair_share(InetAddress client,
int size,
int ttl_sec)
|
protected void |
compute_rates()
|
protected double |
disk_avail_rate(int ttl_sec)
|
protected boolean |
disk_space_avail(int size,
int ttl_sec)
|
protected void |
forward_thru_ls(Object[] pair)
|
void |
forwarded_get_advance(Dht.ForwardedGetState state)
|
protected void |
handle_disk_size_msg(Dht.DiskSizeMsg msg)
|
protected void |
handle_forwarded_get_req_msg(Dht.ForwardedGetReqMsg msg)
|
protected void |
handle_get_by_guid_resp(StorageManager.GetByGuidResp resp)
Returns all values whose keys are greater than the given placemark, if any. |
protected void |
handle_get_req_payload(BambooRouteDeliver msg,
Dht.GetReqPayload payload)
|
protected void |
handle_get_req(Dht.GetReq req)
|
protected void |
handle_get_resp_msg(Dht.GetRespMsg msg)
|
protected void |
handle_leaf_set_changed(BambooLeafSetChanged msg)
|
protected void |
handle_put_or_remove_resp(PutOrRemoveResp ack)
|
protected void |
handle_put_req_payload(BambooRouteDeliver msg,
Dht.PutReqPayload payload)
|
protected void |
handle_put_req(Dht.PutReq req)
|
protected void |
handle_put_resp_msg(Dht.PutRespMsg msg)
|
void |
handleEvent(QueueElementIF item)
|
void |
init(ConfigDataIF config)
|
protected long |
next_get_seq()
|
protected long |
next_put_seq()
|
protected void |
return_to_client(ostore.network.NetworkMessage msg)
|
protected void |
send_disk_size_msg(ostore.util.NodeId peer)
|
protected void |
set_forwarded_get_timeout()
|
protected boolean |
slop_empty(int ttl_sec)
|
protected boolean |
slop_space_avail(InetAddress client,
int size,
int ttl_sec)
|
protected long |
slop_usage(int disk,
InetAddress client)
|
protected void |
start_get_req(Dht.GetReqState state)
|
void |
storage_changed(boolean added,
InetAddress client_id,
long size)
|
protected int |
storage_size(Dht.PutReqPayload payload)
|
protected int |
ttl_to_vdisk(int ttl_sec)
|
| 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 |
|---|
protected Rpc rpc
protected boolean initialized
protected LinkedList wait_q
protected static final long app_id
protected boolean iterative_routing
protected Random rand
protected long next_put_seq
protected long next_get_seq
protected Map active_puts
protected Map active_gets
protected Map forwarded_gets
public static int MAX_TTL_SEC
protected int[] ttl_sec_ranges
protected Map client_to_usage
protected long total_usage
protected double[] avail_tokens
fill_rates, below.
protected double[] max_tokens
protected double[] fill_rates
protected double[] disk_sizes
protected Map[] ls_disk_sizes
protected long[] last_fill_time
protected int min_replica_count
protected BambooNeighborInfo[] preds
protected BambooNeighborInfo[] succs
protected int leaf_set_size
protected BigInteger resp_low
protected BigInteger resp_high
protected static final BigInteger MIN_GUID
protected BigInteger MAX_GUID
protected static final BigInteger NEG_ONE
protected ASyncCore.TimerCB swap_disk_sizes_cb
protected LinkedList slop
protected int[] slop_size
protected int[] slop_cap
protected Map[] slop_usage
protected ASyncCore.TimerCB slop_to_disk_cb
protected static final long PUT_TIMEOUT
protected ASyncCore.TimerCB put_retry_cb
protected static final long GET_TIMEOUT
protected ASyncCore.TimerCB get_retry_cb
protected static final int FORWARDED_GET_TIMEOUT
public ASyncCore.TimerCB forwarded_get_timeout
protected Rpc.ResponseCB fwd_thru_ls_resp_cb
protected Rpc.RequestCB fwd_thru_ls_req_cb
| Constructor Detail |
|---|
public Dht()
throws Exception
Exception| Method Detail |
|---|
protected long next_put_seq()
protected long next_get_seq()
protected int ttl_to_vdisk(int ttl_sec)
public void storage_changed(boolean added,
InetAddress client_id,
long size)
storage_changed in interface StorageManager.StorageMonitor
protected boolean below_fair_share(InetAddress client,
int size,
int ttl_sec)
protected void compute_rates()
protected void handle_leaf_set_changed(BambooLeafSetChanged msg)
protected void send_disk_size_msg(ostore.util.NodeId peer)
protected void handle_disk_size_msg(Dht.DiskSizeMsg msg)
protected boolean disk_space_avail(int size,
int ttl_sec)
protected void add_to_disk(int size,
int ttl_sec)
protected double disk_avail_rate(int ttl_sec)
protected int storage_size(Dht.PutReqPayload payload)
protected boolean slop_empty(int ttl_sec)
protected boolean slop_space_avail(InetAddress client,
int size,
int ttl_sec)
protected void add_to_slop(BambooRouteDeliver msg,
Dht.PutReqPayload payload)
protected long slop_usage(int disk,
InetAddress client)
public void init(ConfigDataIF config)
throws Exception
init in interface EventHandlerIFinit in class StandardStageExceptionpublic void handleEvent(QueueElementIF item)
handleEvent in interface EventHandlerIFhandleEvent in class StandardStageprotected void handle_put_req(Dht.PutReq req)
protected void handle_put_resp_msg(Dht.PutRespMsg msg)
protected void handle_get_req(Dht.GetReq req)
protected void handle_get_resp_msg(Dht.GetRespMsg msg)
protected void handle_put_req_payload(BambooRouteDeliver msg,
Dht.PutReqPayload payload)
protected void handle_get_req_payload(BambooRouteDeliver msg,
Dht.GetReqPayload payload)
protected void handle_forwarded_get_req_msg(Dht.ForwardedGetReqMsg msg)
protected void start_get_req(Dht.GetReqState state)
protected void handle_put_or_remove_resp(PutOrRemoveResp ack)
protected void handle_get_by_guid_resp(StorageManager.GetByGuidResp resp)
Using the standard StorageManager.Key.compareTo function, instead of a Comparator that compares guids first, works here because all values for a given get have the same guid.
protected void set_forwarded_get_timeout()
public void forwarded_get_advance(Dht.ForwardedGetState state)
protected void return_to_client(ostore.network.NetworkMessage msg)
protected void forward_thru_ls(Object[] pair)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||