|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.asunder.AsunderCache
public class AsunderCache
| Constructor Summary | |
|---|---|
AsunderCache(Id center,
Environment env,
java.lang.String rootDir,
AsunderConfig config)
|
|
AsunderCache(Id center,
Environment env,
java.lang.String rootDir,
AsunderConfig config,
AsunderLogger logger)
Creates a new instance of AsunderCache |
|
| Method Summary | |
|---|---|
long |
capacity()
|
int |
getAcceptanceFactor()
|
boolean |
haveContent(DHTContentKey contentKey)
Checks if the content for this key is already stored |
void |
loadContent(DHTContentKey contentKey,
DHTContinuation cmd)
Retrieve content from storage. |
void |
openContentStream(DHTContentKey contentKey,
DHTContinuation cmd)
TODO |
void |
setAcceptanceFactor(int factor)
|
void |
storeContent(DHTContent content,
DHTContinuation cmd)
Non-forcing version of storeContent (follows policies) |
void |
storeContent(DHTContent content,
DHTContinuation cmd,
boolean force)
Write the content to disk |
long |
usage()
|
boolean |
wantContent(DHTContentKey contentKey)
this is a non-deterministic method! Probability of returning true increases as contentKey approaches center |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsunderCache(Id center,
Environment env,
java.lang.String rootDir,
AsunderConfig config)
throws java.io.IOException
java.io.IOException
public AsunderCache(Id center,
Environment env,
java.lang.String rootDir,
AsunderConfig config,
AsunderLogger logger)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setAcceptanceFactor(int factor)
public int getAcceptanceFactor()
public long capacity()
public long usage()
public boolean wantContent(DHTContentKey contentKey)
wantContent in interface DHTCachecontentKey - key for the content to potentially store
public boolean haveContent(DHTContentKey contentKey)
contentKey - the key to check for
public void storeContent(DHTContent content,
DHTContinuation cmd,
boolean force)
content - the content to storeforce - whether to save the content regardless of policiescmd - command to run on completion
public void storeContent(DHTContent content,
DHTContinuation cmd)
storeContent in interface DHTCache
public void loadContent(DHTContentKey contentKey,
DHTContinuation cmd)
loadContent in interface DHTCachecontenKey - the key of the content to retrievecmd - command to run on completion
public void openContentStream(DHTContentKey contentKey,
DHTContinuation cmd)
openContentStream in interface DHTCache
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||