Public Member Functions | |
boolean | insert (ContentObject content, ContentRef ref, long ts, ContentGetter getter, NameEnumerationResponse ner) |
Insert entry for the given ContentObject. | |
void | dumpNamesTree (PrintStream output, int maxNodeLen) |
Dump current names to an output file for debugging. | |
final NameEnumerationResponse | getNamesWithPrefix (Interest interest, ContentName responseName) |
Return all names with a prefix matching the name within the interest for name enumeration. | |
final ContentObject | get (Interest interest, ContentGetter getter) |
Retrieve the data from the store that best matches the given interest. | |
boolean | matchContent (ContentName name) |
Determine if there is data with exactly the given name. | |
Protected Member Functions | |
TreeNode | lookupNode (ContentName name, int count) |
Find the node for the given name. | |
final List< ContentRef > | lookup (ContentName name) |
Return the content objects with exactly the given name. | |
void | dumpRecurse (PrintStream output, TreeNode node, String indent, int maxNodeLen) |
Protected Attributes | |
TreeNode | _root |
Classes | |
interface | ContentGetter |
class | InterestPreScreener |
Prescreen candidates against elements of an interest that we can so we don't need to consider candidates that have no chance of matching. More... | |
class | LeftSearch |
Search for data matching an interest that specifies either the leftmost (canonically smallest) match or doesn't specify a specific way to match data within several pieces of matching data. More... | |
class | RightIterator |
Create an iterator that goes backwards through the candidates for right search. More... | |
class | RightSearch |
Search for data matching an interest in which the rightmost (canonically largest) data among several matching pieces should be returned. More... | |
class | Search |
Implements the generic pieces of both left and right searches. More... | |
class | TreeNode |
TreeNode is the data structure representing one node of a tree which may have children and/or content. More... |
Implements binary tree based algorithms to store and retrieve data based on interests and NameEnumeration
boolean org.ccnx.ccn.impl.repo.ContentTree.insert | ( | ContentObject | content, | |
ContentRef | ref, | |||
long | ts, | |||
ContentGetter | getter, | |||
NameEnumerationResponse | ner | |||
) |
Insert entry for the given ContentObject.
Inserts at a parent with the interest flag set create a NameEnumerationResponse object to send out in response to a name enumeration request that was not answered do to no new information existing. If the interest flag is not set at the parent, a name enumeration response is not written.
content | the data to insert | |
ref | pointer to position of data in the file storage | |
ts | last modification time of the data | |
getter | to retrieve previous content to check for duplication | |
ner | NameEnumerationResponse object to populate if the insert occurs at a parent with the interest flag set |
TreeNode org.ccnx.ccn.impl.repo.ContentTree.lookupNode | ( | ContentName | name, | |
int | count | |||
) | [protected] |
Find the node for the given name.
name | ContentName to search for | |
count | depth to search |
final List<ContentRef> org.ccnx.ccn.impl.repo.ContentTree.lookup | ( | ContentName | name | ) | [protected] |
Return the content objects with exactly the given name.
name | ContentName to lookup |
void org.ccnx.ccn.impl.repo.ContentTree.dumpNamesTree | ( | PrintStream | output, | |
int | maxNodeLen | |||
) |
Dump current names to an output file for debugging.
output | the output file | |
maxNodeLen | max characters to include in a component name in the output |
final NameEnumerationResponse org.ccnx.ccn.impl.repo.ContentTree.getNamesWithPrefix | ( | Interest | interest, | |
ContentName | responseName | |||
) |
Return all names with a prefix matching the name within the interest for name enumeration.
The current implementation of name enumeration in the repository uses the object save dates to determine whether there is new information to send back. If the name matches the incoming interest, the child names are collected from the tree and sent back in a NameEnumerationResponse object. If there is not any new information under the prefix, an interest flag is set. This will trigger a NameEnumerationResponse when a new child is added to the prefix. Interests attempting to enumerate under a prefix that does not exist on the repo are dropped.
interest | the interest to base the enumeration on using the rules of name enumeration |
final ContentObject org.ccnx.ccn.impl.repo.ContentTree.get | ( | Interest | interest, | |
ContentGetter | getter | |||
) |
Retrieve the data from the store that best matches the given interest.
interest | the interest to match | |
getter | used to read a possible match for final matching |
boolean org.ccnx.ccn.impl.repo.ContentTree.matchContent | ( | ContentName | name | ) |
Determine if there is data with exactly the given name.
name | to match, including explicit digest as final component |