Campustream 1.0
A social network MQP for WPI
HashRing Class Reference
Inheritance diagram for HashRing:
IDistributionStrategy IDistributionStrategy KetamaPureRing KetamaPureRing

Public Member Functions

 __construct ($replicas=self::DEFAULT_REPLICAS)
 add ($node, $weight=null)
 remove ($node)
 generateKey ($value)
 get ($key)
 __construct ($replicas=self::DEFAULT_REPLICAS)
 add ($node, $weight=null)
 remove ($node)
 generateKey ($value)
 get ($key)

Data Fields

const DEFAULT_REPLICAS = 128
const DEFAULT_WEIGHT = 100
 $_ring
 $_ringKeys
 $_ringKeysCount
 $_replicas

Protected Member Functions

 addNodeToRing (&$ring, $node, $totalNodes, $replicas, $weightRatio)
 wrapAroundStrategy ($upper, $lower, $ringKeysCount)
 addNodeToRing (&$ring, $node, $totalNodes, $replicas, $weightRatio)
 wrapAroundStrategy ($upper, $lower, $ringKeysCount)

Detailed Description

Definition at line 1906 of file predis.php.


Constructor & Destructor Documentation

__construct ( replicas = self::DEFAULT_REPLICAS)

Definition at line 1911 of file predis.php.

__construct ( replicas = self::DEFAULT_REPLICAS)

Definition at line 1911 of file predis.php.


Member Function Documentation

add ( node,
weight = null 
)

Implements IDistributionStrategy.

Definition at line 1916 of file predis.php.

add ( node,
weight = null 
)

Implements IDistributionStrategy.

Definition at line 1916 of file predis.php.

addNodeToRing ( &$  ring,
node,
totalNodes,
replicas,
weightRatio 
) [protected]

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 1976 of file predis.php.

addNodeToRing ( &$  ring,
node,
totalNodes,
replicas,
weightRatio 
) [protected]

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 1976 of file predis.php.

generateKey ( value)

Implements IDistributionStrategy.

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 1986 of file predis.php.

generateKey ( value)

Implements IDistributionStrategy.

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 1986 of file predis.php.

get ( key)

Implements IDistributionStrategy.

Definition at line 1990 of file predis.php.

get ( key)

Implements IDistributionStrategy.

Definition at line 1990 of file predis.php.

remove ( node)

Implements IDistributionStrategy.

Definition at line 1923 of file predis.php.

remove ( node)

Implements IDistributionStrategy.

Definition at line 1923 of file predis.php.

wrapAroundStrategy ( upper,
lower,
ringKeysCount 
) [protected]

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 2016 of file predis.php.

wrapAroundStrategy ( upper,
lower,
ringKeysCount 
) [protected]

Reimplemented in KetamaPureRing, and KetamaPureRing.

Definition at line 2016 of file predis.php.


Field Documentation

$_replicas

Definition at line 1909 of file predis.php.

$_ring

Definition at line 1909 of file predis.php.

$_ringKeys

Definition at line 1909 of file predis.php.

$_ringKeysCount

Definition at line 1909 of file predis.php.

const DEFAULT_REPLICAS = 128

Reimplemented in KetamaPureRing.

Definition at line 1907 of file predis.php.

const DEFAULT_WEIGHT = 100

Definition at line 1908 of file predis.php.


The documentation for this class was generated from the following files: