Naanou
Class Indexer

Naanou Indexer. Provides high-level, almost IDictionary type access to underlying Chord protocol, provided by Naanou.LookupService

TODO: Investigate providing full IDictionary support

Field Summary
string cachedIdSerial
long DEFAULT_KEY_EXPIRY
         Default key expiry time
Naanou.RunningStats getStats
Naanou.LookupService.FingerKeyChangeHandler keyChangeHandler
Naanou.KeyStorer keyStorer
Naanou.LookupService.Node node
int ONLINE_WAIT
         Seconds to wait when node has gone online before key publishing etc. starts
Naanou.frmNMain parentForm
bool PRIVATE
Naanou.RunningStats putStats
System.Random random
bool ready
Naanou.frmChordStatus status
Naanou.frmVis visForm

Constructor Summary
Indexer()
        Initializes a new instance of the Indexer class.

Property Summary
Naanou.LookupService.NodeAddress Address
         Gets the address of the indexing service
Naanou.RunningStats GetPerfStats
Naanou.KeyStorer KeyStorer
         Gets key storer
Naanou.LookupService.Node Node
Naanou.frmNMain ParentForm
         Gets or sets the parent form
Naanou.RunningStats PutPerfStats
bool Ready
         Gets a boolean indicating whether the indexing service is available and ready
Naanou.IndexerStats Stats
Naanou.frmChordStatus StatusForm_
         Gets the status form
Naanou.frmVis VisForm

Method Summary
Naanou.RunningStats Get(Naanou.Common.Hash key, Naanou.Common.GotKeyDelegate callback)
         Gets a data value from a key
string GetRequestSerial()
void NodeStart()
void NowOffline()
void NowOnline()
void NowOnlineImpl()
void OnNodeError(Naanou.LookupService.Node sender, Naanou.LookupService.NodeErrorStateArgs e)
void OnNodeStateChange(object sender, System.EventArgs e)
void OnPredecessorChange(Naanou.LookupService.Node node, Naanou.LookupService.AddressChangeArgs e)
void OnSuccessorChange(Naanou.LookupService.Node node, Naanou.LookupService.AddressChangeArgs e)
void OnUserWarning(string message)
int Put(Naanou.Common.Hash key, Naanou.Common.Search.IKey data, long expireIn, int hopCount)
         Puts a key, an a associated data value
int Put(Naanou.Common.Hash key, Naanou.Common.Search.IKey data)
         Puts a key, (with a default key expiry length) and a associated data value
void QueryAsync(Naanou.Common.Search.SearchQuery query, Naanou.Common.QueryProgressDelegate progressDelegate)
void QueryAsync(Naanou.Common.Search.SearchQuery query, Naanou.Common.QueryProgressDelegate progressDelegate, Naanou.Common.BasicAddress address, string requestSerial)
void RestartIndexer()
void ReSyncVis()
void Start()
         Starts the indexing service
void Stop()
         Stops the indexing service

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

Event Summary
System.EventHandler StateChange
         Node state has changed


Field Detail

cachedIdSerial

private string cachedIdSerial


DEFAULT_KEY_EXPIRY

public long DEFAULT_KEY_EXPIRY

Default key expiry time


getStats

private Naanou.RunningStats getStats


keyChangeHandler

private Naanou.LookupService.FingerKeyChangeHandler keyChangeHandler


keyStorer

private Naanou.KeyStorer keyStorer


node

private Naanou.LookupService.Node node


ONLINE_WAIT

private int ONLINE_WAIT

Seconds to wait when node has gone online before key publishing etc. starts


parentForm

private Naanou.frmNMain parentForm


PRIVATE

private bool PRIVATE


putStats

private Naanou.RunningStats putStats


random

private System.Random random


ready

private bool ready


status

private Naanou.frmChordStatus status


visForm

private Naanou.frmVis visForm

Constructor Detail

Indexer

private Indexer()

Initializes a new instance of the Indexer class.

Property Detail

Address

public Naanou.LookupService.NodeAddress Address

Gets the address of the indexing service


GetPerfStats

public Naanou.RunningStats GetPerfStats


KeyStorer

public Naanou.KeyStorer KeyStorer

Gets key storer


Node

public Naanou.LookupService.Node Node


ParentForm

public Naanou.frmNMain ParentForm

Gets or sets the parent form


PutPerfStats

public Naanou.RunningStats PutPerfStats


Ready

public bool Ready

Gets a boolean indicating whether the indexing service is available and ready


Stats

public Naanou.IndexerStats Stats


StatusForm_

public Naanou.frmChordStatus StatusForm_

Gets the status form


VisForm

public Naanou.frmVis VisForm

Method Detail

Get

public Naanou.RunningStats Get(Naanou.Common.Hash key,
                               Naanou.Common.GotKeyDelegate callback)

Gets a data value from a key

Parameters:
key - Key
callback - Callback for get

GetRequestSerial

public string GetRequestSerial()


NodeStart

private void NodeStart()


NowOffline

private void NowOffline()


NowOnline

private void NowOnline()


NowOnlineImpl

private void NowOnlineImpl()


OnNodeError

private void OnNodeError(Naanou.LookupService.Node sender,
                         Naanou.LookupService.NodeErrorStateArgs e)


OnNodeStateChange

private void OnNodeStateChange(object sender,
                               System.EventArgs e)


OnPredecessorChange

private void OnPredecessorChange(Naanou.LookupService.Node node,
                                 Naanou.LookupService.AddressChangeArgs e)


OnSuccessorChange

private void OnSuccessorChange(Naanou.LookupService.Node node,
                               Naanou.LookupService.AddressChangeArgs e)


OnUserWarning

private void OnUserWarning(string message)


Put

public int Put(Naanou.Common.Hash key,
               Naanou.Common.Search.IKey data,
               long expireIn,
               int hopCount)

Puts a key, an a associated data value

Parameters:
key - Key
data - Data
expireIn - How many minutes key is valid for
hopCount - Hop count for put

Put

public int Put(Naanou.Common.Hash key,
               Naanou.Common.Search.IKey data)

Puts a key, (with a default key expiry length) and a associated data value

Parameters:
key - Key
data - Data

QueryAsync

public void QueryAsync(Naanou.Common.Search.SearchQuery query,
                       Naanou.Common.QueryProgressDelegate progressDelegate)


QueryAsync

private void QueryAsync(Naanou.Common.Search.SearchQuery query,
                        Naanou.Common.QueryProgressDelegate progressDelegate,
                        Naanou.Common.BasicAddress address,
                        string requestSerial)


RestartIndexer

private void RestartIndexer()


ReSyncVis

internal void ReSyncVis()


Start

public void Start()

Starts the indexing service


Stop

public void Stop()

Stops the indexing service

Event Detail

StateChange

public System.EventHandler StateChange

Node state has changed