#include "squid.h"
#include "CachePeer.h"
#include "CachePeers.h"
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
#include "peer_sourcehash.h"
#include "PeerSelectState.h"
#include "SquidConfig.h"
#include "Store.h"
#include <cmath>
Go to the source code of this file.
Macros | |
#define | ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
Functions | |
static auto & | SourceHashPeers () |
sourcehash peers ordered by their sourcehash weight More... | |
static void | peerSourceHashRegisterWithCacheManager (void) |
static int | peerSortWeight (const void *a, const void *b) |
void | peerSourceHashInit (void) |
CachePeer * | peerSourceHashSelectParent (PeerSelector *ps) |
static void | peerSourceHashCachemgr (StoreEntry *sentry) |
Variables | |
static OBJH | peerSourceHashCachemgr |
Macro Definition Documentation
◆ ROTATE_LEFT
#define ROTATE_LEFT | ( | x, | |
n | |||
) | (((x) << (n)) | ((x) >> (32-(n)))) |
Definition at line 24 of file peer_sourcehash.cc.
Function Documentation
◆ peerSortWeight()
|
static |
Definition at line 38 of file peer_sourcehash.cc.
References CachePeer::weight.
Referenced by peerSourceHashInit().
◆ peerSourceHashCachemgr()
|
static |
Definition at line 188 of file peer_sourcehash.cc.
References SourceHashPeers(), and storeAppendPrintf().
◆ peerSourceHashInit()
void peerSourceHashInit | ( | void | ) |
Definition at line 46 of file peer_sourcehash.cc.
References assert, CurrentCachePeers(), double, int, PEER_PARENT, peerSortWeight(), peerSourceHashRegisterWithCacheManager(), ROTATE_LEFT, and SourceHashPeers().
Referenced by serverConnectionsOpen().
◆ peerSourceHashRegisterWithCacheManager()
|
static |
Definition at line 131 of file peer_sourcehash.cc.
References peerSourceHashCachemgr, and Mgr::RegisterAction().
Referenced by peerSourceHashInit().
◆ peerSourceHashSelectParent()
CachePeer * peerSourceHashSelectParent | ( | PeerSelector * | ps | ) |
Definition at line 138 of file peer_sourcehash.cc.
References assert, HttpRequest::client_addr, debugs, MAX_IPSTRLEN, peerHTTPOkay(), PeerSelector::request, ROTATE_LEFT, SourceHashPeers(), and Ip::Address::toStr().
Referenced by PeerSelector::selectSomeParent().
◆ SourceHashPeers()
|
static |
Definition at line 28 of file peer_sourcehash.cc.
Referenced by peerSourceHashCachemgr(), peerSourceHashInit(), and peerSourceHashSelectParent().
Variable Documentation
◆ peerSourceHashCachemgr
|
static |
Definition at line 34 of file peer_sourcehash.cc.
Referenced by peerSourceHashRegisterWithCacheManager().