bamboo.dht
Class Gateway
java.lang.Object
bamboo.util.StandardStage
bamboo.dht.Gateway
- All Implemented Interfaces:
- EventHandlerIF, SingleThreadedEventHandlerIF
public class Gateway
- extends StandardStage
- implements SingleThreadedEventHandlerIF
A gateway to access the DHT using Sun RPC over TCP.
- Version:
- $Id: Gateway.java,v 1.41 2005/03/02 02:25:13 srhea Exp $
- Author:
- Sean C. Rhea
|
Field Summary |
protected Runnable |
accept_cb
|
protected static ByteBuffer |
bbuf
|
protected static long |
CONN_TIMEOUT
|
static Map |
instances
|
protected Curry.Thunk7<Integer,Dht.GetReq,Dht.GetResp,String,Long,String,String> |
log_get_resp
|
protected Curry.Thunk8<Integer,Dht.PutReq,Dht.PutResp,String,Long,byte[],String,String> |
log_put_resp
|
protected MessageDigest |
md
|
protected int |
server_port
|
protected static Simulator |
simulator
|
protected ServerSocket |
ssock
|
protected ServerSocketChannel |
ssock_channel
|
protected ByteBuffer |
write_buf
|
Curry.Thunk8<Curry.Thunk1<Object>,Dht.PutReq,String,Long,byte[],String,String,Dht.PutResp> |
xml_rpc_put_done
|
|
Method Summary |
protected String |
armor_string(String input)
|
BigInteger |
byte_array_to_big_int(byte[] origb)
|
void |
do_get(int xact_id,
bamboo_get_args args,
ostore.util.NodeId client_id,
GatewayClient client)
|
void |
do_put(int xact_id,
bamboo_put_args args,
ostore.util.NodeId client_id,
GatewayClient client)
|
protected Dht.GetReq |
get_args_to_get_req(bamboo_get_args get_args)
|
protected bamboo_get_res |
get_resp_to_get_res(Dht.GetResp resp)
|
void |
handleEvent(QueueElementIF item)
|
void |
init(ConfigDataIF config)
|
protected void |
log_get_req(int xact_id,
Dht.GetReq req,
String client,
String client_lib,
String application)
|
protected void |
log_put_req(int xact_id,
Dht.PutReq req,
String client,
byte[] value_hash,
String client_lib,
String application)
|
ostore.util.NodeId |
my_node_id()
|
protected Dht.PutReq |
put_args_to_put_req(bamboo_put_args put_args,
InetAddress client)
|
protected void |
simulator_get_done(Dht.GetReq req,
Dht.GetResp resp,
GatewayClient client,
ostore.util.NodeId client_id,
int xact_id,
long start_ms)
|
protected void |
simulator_put_done(Dht.PutReq req,
Dht.PutResp resp,
GatewayClient client,
ostore.util.NodeId client_id,
int xact_id,
long start_ms,
byte[] value_hash)
|
| 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 |
ssock
protected ServerSocket ssock
ssock_channel
protected ServerSocketChannel ssock_channel
server_port
protected int server_port
accept_cb
protected Runnable accept_cb
write_buf
protected ByteBuffer write_buf
CONN_TIMEOUT
protected static final long CONN_TIMEOUT
- See Also:
- Constant Field Values
xml_rpc_put_done
public Curry.Thunk8<Curry.Thunk1<Object>,Dht.PutReq,String,Long,byte[],String,String,Dht.PutResp> xml_rpc_put_done
md
protected MessageDigest md
log_put_resp
protected Curry.Thunk8<Integer,Dht.PutReq,Dht.PutResp,String,Long,byte[],String,String> log_put_resp
log_get_resp
protected Curry.Thunk7<Integer,Dht.GetReq,Dht.GetResp,String,Long,String,String> log_get_resp
instances
public static Map instances
simulator
protected static Simulator simulator
bbuf
protected static ByteBuffer bbuf
Gateway
public Gateway()
init
public void init(ConfigDataIF config)
throws Exception
- Specified by:
init in interface EventHandlerIF- Overrides:
init in class StandardStage
- Throws:
Exception
handleEvent
public void handleEvent(QueueElementIF item)
- Specified by:
handleEvent in interface EventHandlerIF- Overrides:
handleEvent in class StandardStage
byte_array_to_big_int
public BigInteger byte_array_to_big_int(byte[] origb)
put_args_to_put_req
protected Dht.PutReq put_args_to_put_req(bamboo_put_args put_args,
InetAddress client)
get_args_to_get_req
protected Dht.GetReq get_args_to_get_req(bamboo_get_args get_args)
get_resp_to_get_res
protected bamboo_get_res get_resp_to_get_res(Dht.GetResp resp)
armor_string
protected String armor_string(String input)
log_put_req
protected void log_put_req(int xact_id,
Dht.PutReq req,
String client,
byte[] value_hash,
String client_lib,
String application)
log_get_req
protected void log_get_req(int xact_id,
Dht.GetReq req,
String client,
String client_lib,
String application)
do_put
public void do_put(int xact_id,
bamboo_put_args args,
ostore.util.NodeId client_id,
GatewayClient client)
do_get
public void do_get(int xact_id,
bamboo_get_args args,
ostore.util.NodeId client_id,
GatewayClient client)
my_node_id
public ostore.util.NodeId my_node_id()
simulator_put_done
protected void simulator_put_done(Dht.PutReq req,
Dht.PutResp resp,
GatewayClient client,
ostore.util.NodeId client_id,
int xact_id,
long start_ms,
byte[] value_hash)
simulator_get_done
protected void simulator_get_done(Dht.GetReq req,
Dht.GetResp resp,
GatewayClient client,
ostore.util.NodeId client_id,
int xact_id,
long start_ms)