Свойство | Type | Description | |
---|---|---|---|
_data | |||
_left_addr | Brunet.Address | ||
_left_transfer_state | TransferState | ||
_node | |||
_online | bool | ||
_right_addr | Brunet.Address | ||
_right_transfer_state | TransferState | ||
_rpc | RpcManager | ||
_sync | Object | ||
_transfer_sync | Object |
Méthode | Description | |
---|---|---|
Get ( MemBlock key, byte token ) : IList |
Retrieves data from the Dht. First old entries for the key are deleted from the dht, second a look up is performed, and finally using the token a range of data is selectively returned. |
|
HandleRpc ( ISender caller, string method, IList args, object rs ) : void |
This provides faster translation for Rpc methods as well as allows for Asynchronous Rpc calls which are required for Puts and Creates.
|
|
Put ( MemBlock key, MemBlock value, int ttl, bool unique, object rs ) : bool |
Called by a Dht client to store data here, this supports both Puts and Creates by using the unique parameter. Puts will store the value no matter what, Creates will only store the value if they are the first ones to store data on that key. This is the first part of a Put operation. This calls PutHandler on itself and the neighbor nearest to the key, which actually places the data into the store. The result is returned to the client upon completion of the call to the neighbor, if that fails the data is removed locally and an exception is sent to the client indicating failure. |
|
PutHandler ( MemBlock key, MemBlock value, int ttl, bool unique ) : bool |
Attempts to store the key:value pair into this server. First the dht deletes any expired entries stored at the key, second it retrieves the entries from the data store. If it is empty it creates a new entry and returns. Otherwise, it looks for the value in the list and updates the lease time. If there is no entry for that key:value pair it either adds it in the case of a put or throws an exception if it is a create. |
|
TableServer ( |
Creates a new TableServer object and registers it to the "dht" handler in the node's RpcManager.
|
Méthode | Description | |
---|---|---|
ConnectionHandler ( object o, |
This is called whenever there is a disconnect or a connect, the idea is to determine if there is a new left or right node, if there is and here is a pre-existing transfer, we must interupt it, and start a new transfer. The possible scenarios where this would be active: - no change on left - new left node with no previous node (from disc or new node) - left disconnect and new left ready - left disconnect and no one ready - no change on right - new right node with no previous node (from disc or new node) - right disconnect and new right ready - right disconnect and no one ready |
|
DepartureHandler ( ) : void |
Called when Node.Disconnect is triggered stopping transfer states and preventing any more transfers.
|
|
StateChangeHandler ( |
If we are or were connected in the right place, we accept DHT messages otherwise we ignore them.
|
protected ConnectionHandler ( object o, |
||
o | object | Unimportant |
eargs | Contains the ConnectionEventArgs, which lets us know if this was a Structured Connection change and if it is, we should check the state of the system to see if we have a new left or right neighbor. | |
Résultat | void |
public Get ( MemBlock key, byte token ) : IList | ||
key | MemBlock | The index used to look up. Contains the data necessary to do follow up look ups if all the data stored in a key is to big for MAX_BYTES. |
token | byte | |
Résultat | IList |
public HandleRpc ( ISender caller, string method, IList args, object rs ) : void | ||
caller | ISender | The ISender who made the request. |
method | string | The method requested. |
args | IList | A list of arguments to pass to the method. |
rs | object | The return state sent back to the RpcManager so that it knows who to return the result to. |
Résultat | void |
public Put ( MemBlock key, MemBlock value, int ttl, bool unique, object rs ) : bool | ||
key | MemBlock | The index to store the data at. |
value | MemBlock | Data to store at the key. |
ttl | int | Dht lease time in seconds |
unique | bool | True if this should perform a create, false otherwise. |
rs | object | The return state sent back to the RpcManager so that it knows who to return the result to. |
Résultat | bool |
public PutHandler ( MemBlock key, MemBlock value, int ttl, bool unique ) : bool | ||
key | MemBlock | The index to store the data at. |
value | MemBlock | Data to store at the key. |
ttl | int | Dht lease time in seconds |
unique | bool | True if this should perform a create, false otherwise. |
Résultat | bool |
protected StateChangeHandler ( |
||
n | The node for this event. | |
state | The new state. | |
Résultat | void |
public TableServer ( |
||
node | The node the dht is to serve from. | |
Résultat | System |
protected TableServerData,Brunet.Services.Dht _data | ||
Résultat |
protected TransferState _left_transfer_state | ||
Résultat | TransferState |
protected TransferState _right_transfer_state | ||
Résultat | TransferState |