C# 클래스 Brunet.Services.Dht.TableServerData

파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
TimeBetweenCleanup int

보호된 프로퍼티들

프로퍼티 타입 설명
_base_dir string
count int

공개 메소드들

메소드 설명
AddEntry ( Entry entry ) : void

This adds an entry and should only be called if no such entry exists, as it does not look to see if a duplicate entry already exists. This creates a new LinkedList if this is the first entry for the specific key and stores it in the _data hashtable. This increments count.

Because data is stored by non-decreasing end time, we must place this at the correct position, which by starting at the last entry is right after the first entry that has a shorter end time.

CacheEviction ( Object o, EventArgs args ) : void
CacheMiss ( Object o, EventArgs args ) : void
CheckEntries ( ) : void

Deletes any of the expired entries by traversing the entire data store. This is done only once every 24 hours to reduce heavy memory access due to short lived unused entries.

CleanUp ( Object o, EventArgs args ) : void

Called to clean up the disk data left behind by the dht

DeleteExpired ( MemBlock key ) : int

Deletes all expired entries for the specified key. For each entry deleted, count is decremented. This should be called before accessing the data stored in this table.

Dump ( ) : ArrayList

Converts all the entries into Adr compatible types so that they can be sent over BrunetRpc and XmlRpc

GeneratePath ( MemBlock key ) : string

Generates a path given a key.

GeneratePath ( MemBlock key, string &path, string &filename ) : string

Generates a path given a key.

GetEntries ( MemBlock key ) : LinkedList

Retrieves the entries for the specified key.

GetKeys ( ) : LinkedList

Returns the list of keys.

GetKeysBetween ( AHAddress add1, AHAddress add2 ) : LinkedList

Returns a list of keys stored at this node that exist between the two addresses. Such keys returned are the storest path between the two addresses.

RemoveEntry ( MemBlock key, MemBlock value ) : void

This removes an entry from the TableServerData, the current dht does not support deletes, but if the second stage of a put (the remote PutHandler) fails, the entry needs to be deleted from this node.

TableServerData ( ) : System
TableServerData ( Node node ) : System

Creates a new data store for the dht.

TableServerData ( String dir ) : System
UpdateEntry ( MemBlock key, MemBlock value, DateTime end_time ) : void

This should be called if an entry already exists as it will find the entry and update its lease time. If an entry does not exist nothing happens.

비공개 메소드들

메소드 설명
Test0 ( ) : void
Test1 ( ) : void
Test2 ( ) : void

메소드 상세

AddEntry() 공개 메소드

This adds an entry and should only be called if no such entry exists, as it does not look to see if a duplicate entry already exists. This creates a new LinkedList if this is the first entry for the specific key and stores it in the _data hashtable. This increments count.
Because data is stored by non-decreasing end time, we must place this at the correct position, which by starting at the last entry is right after the first entry that has a shorter end time.
public AddEntry ( Entry entry ) : void
entry Entry The data to store.
리턴 void

CacheEviction() 공개 메소드

public CacheEviction ( Object o, EventArgs args ) : void
o Object
args System.EventArgs
리턴 void

CacheMiss() 공개 메소드

public CacheMiss ( Object o, EventArgs args ) : void
o Object
args System.EventArgs
리턴 void

CheckEntries() 공개 메소드

Deletes any of the expired entries by traversing the entire data store. This is done only once every 24 hours to reduce heavy memory access due to short lived unused entries.
public CheckEntries ( ) : void
리턴 void

CleanUp() 공개 메소드

Called to clean up the disk data left behind by the dht
public CleanUp ( Object o, EventArgs args ) : void
o Object Unused.
args System.EventArgs Unused.
리턴 void

DeleteExpired() 공개 메소드

Deletes all expired entries for the specified key. For each entry deleted, count is decremented. This should be called before accessing the data stored in this table.
public DeleteExpired ( MemBlock key ) : int
key Brunet.Util.MemBlock The index to check for expired entries.
리턴 int

Dump() 공개 메소드

Converts all the entries into Adr compatible types so that they can be sent over BrunetRpc and XmlRpc
public Dump ( ) : ArrayList
리턴 System.Collections.ArrayList

GeneratePath() 공개 메소드

Generates a path given a key.
public GeneratePath ( MemBlock key ) : string
key MemBlock The key to generate a path for.
리턴 string

GeneratePath() 공개 메소드

Generates a path given a key.
public GeneratePath ( MemBlock key, string &path, string &filename ) : string
key MemBlock The key to generate a path for.
path string Returns the directory portion of the path.
filename string Returns the filename portion of the path.
리턴 string

GetEntries() 공개 메소드

Retrieves the entries for the specified key.
public GetEntries ( MemBlock key ) : LinkedList
key MemBlock
리턴 LinkedList

GetKeys() 공개 메소드

Returns the list of keys.
public GetKeys ( ) : LinkedList
리턴 LinkedList

GetKeysBetween() 공개 메소드

Returns a list of keys stored at this node that exist between the two addresses. Such keys returned are the storest path between the two addresses.
public GetKeysBetween ( AHAddress add1, AHAddress add2 ) : LinkedList
add1 AHAddress One of the address end points.
add2 AHAddress Another of the address end points.
리턴 LinkedList

RemoveEntry() 공개 메소드

This removes an entry from the TableServerData, the current dht does not support deletes, but if the second stage of a put (the remote PutHandler) fails, the entry needs to be deleted from this node.
public RemoveEntry ( MemBlock key, MemBlock value ) : void
key MemBlock The index the data is stored at.
value MemBlock The data to remove.
리턴 void

TableServerData() 공개 메소드

public TableServerData ( ) : System
리턴 System

TableServerData() 공개 메소드

Creates a new data store for the dht.
public TableServerData ( Node node ) : System
node Node For uncache data, we use the node to alert us to delete the entries as well the address to define a path to store them.
리턴 System

TableServerData() 공개 메소드

public TableServerData ( String dir ) : System
dir String
리턴 System

UpdateEntry() 공개 메소드

This should be called if an entry already exists as it will find the entry and update its lease time. If an entry does not exist nothing happens.
public UpdateEntry ( MemBlock key, MemBlock value, DateTime end_time ) : void
key MemBlock The index to store the value.
value MemBlock The data to store.
end_time DateTime The lease time for the data.
리턴 void

프로퍼티 상세

TimeBetweenCleanup 공개적으로 프로퍼티

The time in seconds between cleanups.
public int TimeBetweenCleanup
리턴 int

_base_dir 보호되어 있는 프로퍼티

The base directory for uncached entries.
protected string _base_dir
리턴 string

count 보호되어 있는 프로퍼티

The total amount of key:value pairs stored.
protected int count
리턴 int