Part of CCNx Sync. More...
Go to the source code of this file.
Data Structures | |
struct | SyncHashCacheHead |
struct | SyncHashCacheEntry |
Enumerations | |
enum | SyncHashState { SyncHashState_local = 1, SyncHashState_remote = 2, SyncHashState_fetching = 4, SyncHashState_covered = 8, SyncHashState_storing = 16, SyncHashState_stored = 32, SyncHashState_marked = 64 } |
Functions | |
struct SyncHashCacheEntry * | SyncHashLookup (struct SyncHashCacheHead *head, const unsigned char *xp, ssize_t xs) |
lookup a full hash in a hash table (raw contents, no tag) | |
struct SyncHashCacheEntry * | SyncHashEnter (struct SyncHashCacheHead *head, const unsigned char *xp, ssize_t xs, enum SyncHashState set) |
based on the raw hash, ensure that a remote cache entry exists ent->state |= set | |
void | SyncHashRemoveEntry (struct SyncHashCacheHead *head, struct SyncHashCacheEntry *ce) |
remove the entry (if present) | |
void | SyncHashClearMarks (struct SyncHashCacheHead *head) |
clear all marks | |
struct SyncHashCacheHead * | SyncHashCacheCreate (struct SyncRootStruct *root, uint32_t mod) |
create a new hash table with the given modulus (mod == 0 uses a default) | |
struct SyncHashCacheHead * | SyncHashCacheFree (struct SyncHashCacheHead *head) |
frees the cache resources caller must ensure no further use of the cache | |
int | SyncCacheEntryFetch (struct SyncHashCacheEntry *ce) |
fetches the cache entry to be eligible, ce != NULL && ce->ncL != NULL && (ce->state & SyncHashState_stored) == 1 | |
int | SyncCacheEntryStore (struct SyncHashCacheEntry *ce) |
stores the cahe entry to the repo to be eligible, ce != NULL && ce->ncL == NULL && (ce->state & SyncHashState_stored) == 0 |
Part of CCNx Sync.
Definition in file SyncHashCache.h.
enum SyncHashState |
Definition at line 28 of file SyncHashCache.h.
int SyncCacheEntryFetch | ( | struct SyncHashCacheEntry * | ce | ) |
fetches the cache entry to be eligible, ce != NULL && ce->ncL != NULL && (ce->state & SyncHashState_stored) == 1
Definition at line 209 of file SyncHashCache.c.
Referenced by cacheEntryForElem(), doComparison(), formatStats(), newNodeCommon(), SyncInterestArrived(), SyncTreeMergeNames(), and UpdateAction().
int SyncCacheEntryStore | ( | struct SyncHashCacheEntry * | ce | ) |
stores the cahe entry to the repo to be eligible, ce != NULL && ce->ncL == NULL && (ce->state & SyncHashState_stored) == 0
Definition at line 176 of file SyncHashCache.c.
Referenced by HeartbeatAction().
struct SyncHashCacheHead* SyncHashCacheCreate | ( | struct SyncRootStruct * | root, | |
uint32_t | mod | |||
) | [read] |
create a new hash table with the given modulus (mod == 0 uses a default)
Definition at line 144 of file SyncHashCache.c.
Referenced by SyncAddRoot().
struct SyncHashCacheHead* SyncHashCacheFree | ( | struct SyncHashCacheHead * | head | ) | [read] |
frees the cache resources caller must ensure no further use of the cache
Definition at line 154 of file SyncHashCache.c.
Referenced by SyncRemRoot().
void SyncHashClearMarks | ( | struct SyncHashCacheHead * | head | ) |
struct SyncHashCacheEntry* SyncHashEnter | ( | struct SyncHashCacheHead * | head, | |
const unsigned char * | xp, | |||
ssize_t | xs, | |||
enum SyncHashState | set | |||
) | [read] |
based on the raw hash, ensure that a remote cache entry exists ent->state |= set
Definition at line 63 of file SyncHashCache.c.
Referenced by ccns_open(), ccns_root_advise_response(), ensureRemoteEntry(), newNodeCommon(), SyncInterestArrived(), SyncRemoteFetchResponse(), SyncRootAdviseResponse(), SyncStartCompareAction(), and UpdateAction().
struct SyncHashCacheEntry* SyncHashLookup | ( | struct SyncHashCacheHead * | head, | |
const unsigned char * | xp, | |||
ssize_t | xs | |||
) | [read] |
lookup a full hash in a hash table (raw contents, no tag)
Definition at line 43 of file SyncHashCache.c.
Referenced by cacheEntryForElem(), ccns_send_root_advise_interest(), CompareAction(), doPreload(), MakeNodeFromNames(), newNodeCommon(), nodeFromNodes(), SyncRemoteFetchResponse(), SyncRootTopEntry(), SyncStartCompareAction(), and SyncTreeWorkerPush().
void SyncHashRemoveEntry | ( | struct SyncHashCacheHead * | head, | |
struct SyncHashCacheEntry * | ce | |||
) |
remove the entry (if present)
Definition at line 106 of file SyncHashCache.c.