|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.cm.SrdiIndex
public class SrdiIndex
SrdiIndex
Nested Class Summary | |
---|---|
static class |
SrdiIndex.Entry
An entry in the index tables. |
static class |
SrdiIndex.SrdiIndexRecord
an SrdiIndexRecord wrapper |
Constructor Summary | |
---|---|
SrdiIndex(PeerGroup group,
String indexName)
Constructor for the SrdiIndex |
|
SrdiIndex(PeerGroup group,
String indexName,
long interval)
Construct a SrdiIndex and starts a GC thread which runs every "interval" milliseconds |
Method Summary | |
---|---|
void |
add(String primaryKey,
String attribute,
String value,
PeerID pid,
long expiration)
add an index entry |
void |
clear()
Empties the index completely. |
static void |
clearSrdi(PeerGroup group)
Flushes the Srdi directory for a specified group this method should only be called before initialization of a given group calling this method on a running group would have undefined results |
void |
garbageCollect()
Garbage Collect expired entries |
String |
getIndexName()
Returns the name of this srdi index. |
List |
getRecord(String pkey,
String skey,
String value)
retrieves a record |
Vector |
query(String primaryKey)
Query SrdiIndex |
Vector |
query(String primaryKey,
String attribute,
String value,
int threshold)
Query SrdiIndex |
static SrdiIndex.SrdiIndexRecord |
readRecord(Record record)
Reads the content of a record into ArrayList |
void |
remove(PeerID pid)
remove entries pointing to peer id from cache |
void |
run()
Periodic thread for GC |
protected void |
startGC(PeerGroup group,
String indexName,
long interval)
Start the GC thread |
void |
stop()
stop the current running thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SrdiIndex(PeerGroup group, String indexName)
group
- groupindexName
- public SrdiIndex(PeerGroup group, String indexName, long interval)
interval
- the interval at which the gc will run in millisecondsgroup
- group contextindexName
- SrdiIndex nameMethod Detail |
---|
protected void startGC(PeerGroup group, String indexName, long interval)
public String getIndexName()
public void add(String primaryKey, String attribute, String value, PeerID pid, long expiration)
primaryKey
- primary keyattribute
- Attribute String to query onvalue
- value of the attribute stringexpiration
- expiration associated with this entry relative time in
millisecondspid
- peerid referencepublic List getRecord(String pkey, String skey, String value)
pkey
- primary keyskey
- secondary keyvalue
- value
public void remove(PeerID pid)
pid
- peer id to removepublic Vector query(String primaryKey, String attribute, String value, int threshold)
attribute
- Attribute String to query onvalue
- value of the attribute string
public Vector query(String primaryKey)
primaryKey
- primary key
public static SrdiIndex.SrdiIndexRecord readRecord(Record record)
record
- Btree Record
public void clear()
public void garbageCollect()
public void stop()
public void run()
run
in interface Runnable
public static void clearSrdi(PeerGroup group)
group
- group context
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |