Naanou.LookupService
Class RemoteNode

This is the class that gets published. One-to-one releationship with a Naanou.LookupService.Node. Methods that get called on this object are most likely from another node somewhere on network.

Field Summary
System.Collections.ArrayList fillFingerWorkers
Naanou.LookupService.Node node

Constructor Summary
RemoteNode(Naanou.LookupService.Node node)
         Constructor

Property Summary
Naanou.Common.BasicAddress Address
         Gets the address of this node
Naanou.LookupService.NodeAddress AddressNode
bool FingersReady
string Network
         Gets the network this node belongs too
bool OnCycle
         Is the node currently in a cycle
Naanou.Common.BasicAddress Predecessor
         Gets the predecessor of this node
Naanou.LookupService.NodeAddress PredecessorNode
         Predecessor node
Naanou.Common.BasicAddress Successor
         Gets the successor of this node
Naanou.LookupService.NodeAddress SuccessorNode
         Successor node

Method Summary
Naanou.Common.BasicAddress BackwardsProbe()
         Used by Node.StrongFastStabilisation (pg 24, Chord paper)
void FillFingers(string[] entries, int size, bool forward)
         Constructs a finger table for another node
void FillFingersDone(Naanou.LookupService.RemoteNode.FingerFiller finger, Naanou.Common.BasicAddress client)
         Call back from FingerFiller thread that it has completed
bool FillFingersServicing(Naanou.Common.BasicAddress client, bool forward)
         Is this client being serviced already?
void FindSuccessorNodeAsync(string id, Naanou.Common.FindSuccessorResult resultChain)
         Finds the successor node for a key, and returns the result when done via Naanou.LookupService.RemoteNode.FoundSuccessorNode(Naanou.Common.FindSuccessorResult,Naanou.Common.BasicAddress)
void FindSuccessorNodeAsync(string id, Naanou.LookupService.RemoteNode remoteNode, bool random, Naanou.Common.FindSuccessorResult resultChain)
void FoundSuccessorNode(Naanou.Common.FindSuccessorResult result, Naanou.Common.BasicAddress nodeQueried)
         Gets called remotely via Naanou.LookupService.RemoteNode.FindSuccessorNodeAsync(System.String,Naanou.Common.FindSuccessorResult)
void GetKeyAsync(string id, string requestSerial)
         Gets a previously stored item from a key, and returns the result when done via Naanou.LookupService.RemoteNode.GotKey(Naanou.Common.GetKeyResult)
void GetKeyAsync(Naanou.Common.Hash id, Naanou.LookupService.RemoteNode client, string requestSerial)
Naanou.Common.BasicAddress[] GetSuccessorList()
         Gets this nodes successor list
void GotKey(Naanou.Common.GetKeyResult result)
         Gets called from someone else via Naanou.LookupService.RemoteNode.GetKeyAsync(System.String,System.String)
object InitializeLifetimeService()
         Ensure that RemoteNode instance doesn't get destroyed on server-side
System.Collections.ArrayList KeyDump()
         Returns an arraylist of all keys node has stored
void NotifyFingers(Naanou.Common.BasicAddress[] fingers, bool forward)
         Called when the node we requested fingers from has finished
void NotifyPredecessor()
         Called by a remote node who thinks it is our predecessor
void NotifyPredecessorOffline(Naanou.Common.BasicAddress newPredecessor, System.Collections.ArrayList keysToUpgrade)
         A notification by this nodes predecessor that it is going offline
void NotifySuccessor()
         Called by a remote node who thinks it is our better successor
void NotifySuccessorOffline(Naanou.Common.BasicAddress newSuccessor, System.Collections.ArrayList keysToUpgrade)
         A notification by this nodes successor that it is going offline
long Ping(long opaque, string address)
         Ping to see if we are alive and well.
long Ping(long opaque)
         Ping to see if we are alive and well.
void PutKey(string idSerial, Naanou.Common.Search.IKey data, long expire, int authority, int hops)
         Stores a key and associated data value.
void PutKey(string idSerial, Naanou.Common.Search.IKey data, string inserterSerial, long expire, int authority, int hops)
         Puts a key
void PutKeyImpl(string idSerial, Naanou.Common.Search.IKey data, Naanou.Common.Hash inserter, long expire, int authority, int hops)
void QueryAsync(Naanou.Common.Search.SearchQuery query, string requestSerial)
         Performs an asynchronous key query locally.
void QueryProgress(Naanou.Common.Search.SearchResultSet result, bool completed)
         Notication from another node about the progress of a query we peformed
void RandomFindSuccessorNodeAsync(string id, Naanou.Common.FindSuccessorResult resultChain)
bool SuggestPredecessor(Naanou.Common.BasicAddress suggested)
         Someone has a suggestion for a predecessor for us
bool SuggestSuccessor(Naanou.Common.BasicAddress suggested)
         Called when a node has a suggestion for a node

Methods inherited from class System.MarshalByRefObject
CreateObjRef, GetLifetimeService

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

fillFingerWorkers

private System.Collections.ArrayList fillFingerWorkers


node

private Naanou.LookupService.Node node

Constructor Detail

RemoteNode

internal RemoteNode(Naanou.LookupService.Node node)

Constructor

Parameters:
node - Node to link to
Property Detail

Address

public Naanou.Common.BasicAddress Address

Gets the address of this node


AddressNode

private Naanou.LookupService.NodeAddress AddressNode


FingersReady

public bool FingersReady


Network

public string Network

Gets the network this node belongs too


OnCycle

public bool OnCycle

Is the node currently in a cycle


Predecessor

public Naanou.Common.BasicAddress Predecessor

Gets the predecessor of this node


PredecessorNode

internal Naanou.LookupService.NodeAddress PredecessorNode

Predecessor node


Successor

public Naanou.Common.BasicAddress Successor

Gets the successor of this node


SuccessorNode

private Naanou.LookupService.NodeAddress SuccessorNode

Successor node

Method Detail

BackwardsProbe

public Naanou.Common.BasicAddress BackwardsProbe()

Used by Node.StrongFastStabilisation (pg 24, Chord paper)

Returns:

FillFingers

public void FillFingers(string[] entries,
                        int size,
                        bool forward)

Constructs a finger table for another node

Parameters:
entries - Fingers
size - Size
forward - Is table forward looking

FillFingersDone

protected void FillFingersDone(Naanou.LookupService.RemoteNode.FingerFiller finger,
                               Naanou.Common.BasicAddress client)

Call back from FingerFiller thread that it has completed

Parameters:
finger -
client -

FillFingersServicing

internal bool FillFingersServicing(Naanou.Common.BasicAddress client,
                                   bool forward)

Is this client being serviced already?

Parameters:
client - Client
forward - Is table forward
Returns:
True if client is being serviced

FindSuccessorNodeAsync

public void FindSuccessorNodeAsync(string id,
                                   Naanou.Common.FindSuccessorResult resultChain)

Finds the successor node for a key, and returns the result when done via Naanou.LookupService.RemoteNode.FoundSuccessorNode(Naanou.Common.FindSuccessorResult,Naanou.Common.BasicAddress)

Parameters:
id - Key
resultChain - ResultChain to build on

FindSuccessorNodeAsync

private void FindSuccessorNodeAsync(string id,
                                    Naanou.LookupService.RemoteNode remoteNode,
                                    bool random,
                                    Naanou.Common.FindSuccessorResult resultChain)


FoundSuccessorNode

public void FoundSuccessorNode(Naanou.Common.FindSuccessorResult result,
                               Naanou.Common.BasicAddress nodeQueried)

Gets called remotely via Naanou.LookupService.RemoteNode.FindSuccessorNodeAsync(System.String,Naanou.Common.FindSuccessorResult)

Parameters:
result - Result
nodeQueried - Node queried for successor

GetKeyAsync

public void GetKeyAsync(string id,
                        string requestSerial)

Gets a previously stored item from a key, and returns the result when done via Naanou.LookupService.RemoteNode.GotKey(Naanou.Common.GetKeyResult)

Parameters:
id - Key
Returns:
Item

GetKeyAsync

private void GetKeyAsync(Naanou.Common.Hash id,
                         Naanou.LookupService.RemoteNode client,
                         string requestSerial)


GetSuccessorList

public Naanou.Common.BasicAddress[] GetSuccessorList()

Gets this nodes successor list

Returns:
Successor list

GotKey

public void GotKey(Naanou.Common.GetKeyResult result)

Gets called from someone else via Naanou.LookupService.RemoteNode.GetKeyAsync(System.String,System.String)

Parameters:
result - Result

InitializeLifetimeService

public object InitializeLifetimeService()

Ensure that RemoteNode instance doesn't get destroyed on server-side

Returns:

KeyDump

public System.Collections.ArrayList KeyDump()

Returns an arraylist of all keys node has stored

Returns:

NotifyFingers

public void NotifyFingers(Naanou.Common.BasicAddress[] fingers,
                          bool forward)

Called when the node we requested fingers from has finished

Parameters:
fingers - Fingers
forward - Forward fingers? (false if backward)

NotifyPredecessor

public void NotifyPredecessor()

Called by a remote node who thinks it is our predecessor


NotifyPredecessorOffline

public void NotifyPredecessorOffline(Naanou.Common.BasicAddress newPredecessor,
                                     System.Collections.ArrayList keysToUpgrade)

A notification by this nodes predecessor that it is going offline

Parameters:
newPredecessor - Recommended new predecessor to use

NotifySuccessor

public void NotifySuccessor()

Called by a remote node who thinks it is our better successor


NotifySuccessorOffline

public void NotifySuccessorOffline(Naanou.Common.BasicAddress newSuccessor,
                                   System.Collections.ArrayList keysToUpgrade)

A notification by this nodes successor that it is going offline

Parameters:
newSuccessor - Recommended new successor to use

Ping

public long Ping(long opaque,
                 string address)

Ping to see if we are alive and well.

Parameters:
opaque - Opaque value to return
address - Returns the address that the server sees the client as
Returns:
Opaque

Ping

public long Ping(long opaque)

Ping to see if we are alive and well.

Parameters:
opaque - Opaque value to return
Returns:
Opaque

PutKey

public void PutKey(string idSerial,
                   Naanou.Common.Search.IKey data,
                   long expire,
                   int authority,
                   int hops)

Stores a key and associated data value.

Parameters:
authority - Authority (use -1 for no automatic key caching)
expire - Expiry
idSerial - Key's id serial
hops - Hops
data - Data

PutKey

public void PutKey(string idSerial,
                   Naanou.Common.Search.IKey data,
                   string inserterSerial,
                   long expire,
                   int authority,
                   int hops)

Puts a key

Parameters:
idSerial - Id
data - Data
inserterSerial - Inserter
expire - Expiry ticks
authority - Authority level (use -1 for no automatic key caching)
hops - Hops taken

PutKeyImpl

private void PutKeyImpl(string idSerial,
                        Naanou.Common.Search.IKey data,
                        Naanou.Common.Hash inserter,
                        long expire,
                        int authority,
                        int hops)


QueryAsync

public void QueryAsync(Naanou.Common.Search.SearchQuery query,
                       string requestSerial)

Performs an asynchronous key query locally.

Parameters:
query - Query to perform

QueryProgress

public void QueryProgress(Naanou.Common.Search.SearchResultSet result,
                          bool completed)

Notication from another node about the progress of a query we peformed

Parameters:
result - Current result set
completed - Has query been completed

RandomFindSuccessorNodeAsync

public void RandomFindSuccessorNodeAsync(string id,
                                         Naanou.Common.FindSuccessorResult resultChain)


SuggestPredecessor

public bool SuggestPredecessor(Naanou.Common.BasicAddress suggested)

Someone has a suggestion for a predecessor for us

Parameters:
suggested - Suggestion
Returns:
True if predecessor was accepted

SuggestSuccessor

public bool SuggestSuccessor(Naanou.Common.BasicAddress suggested)

Called when a node has a suggestion for a node

Parameters:
suggested - Suggested successor
Returns:
True if successor was accepted