Go to the source code of this file.
Functions | |
static struct SyncHashCacheEntry * | localFreeEntry (struct SyncHashCacheEntry *ce) |
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 | SyncCacheEntryStore (struct SyncHashCacheEntry *ce) |
stores the cahe entry to the repo to be eligible, ce != NULL && ce->ncL == NULL && (ce->state & SyncHashState_stored) == 0 | |
int | SyncCacheEntryFetch (struct SyncHashCacheEntry *ce) |
fetches the cache entry to be eligible, ce != NULL && ce->ncL != NULL && (ce->state & SyncHashState_stored) == 1 |
Copyright (C) 2011 Palo Alto Research Center, Inc.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file SyncHashCache.c.
static struct SyncHashCacheEntry* localFreeEntry | ( | struct SyncHashCacheEntry * | ce | ) | [static, read] |
Definition at line 32 of file SyncHashCache.c.
Referenced by SyncHashCacheFree(), and SyncHashRemoveEntry().
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 205 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 172 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 140 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 150 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 62 of file SyncHashCache.c.
Referenced by ensureRemoteEntry(), newNodeCommon(), SyncInterestArrived(), SyncRemoteFetchResponse(), SyncRootAdviseResponse(), and SyncStartCompareAction().
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 42 of file SyncHashCache.c.
Referenced by cacheEntryForElem(), CompareAction(), doPreload(), formatStats(), HeartbeatAction(), MakeNodeFromNames(), newNodeCommon(), nodeFromNodes(), purgeOldEntries(), SyncInterestArrived(), SyncRemoteFetchResponse(), SyncRootTopEntry(), SyncSendRootAdviseInterest(), SyncStartCompareAction(), and SyncTreeWorkerPush().
void SyncHashRemoveEntry | ( | struct SyncHashCacheHead * | head, | |
struct SyncHashCacheEntry * | ce | |||
) |