C# Class StopGuessing.Controllers.DistributedBinomialLadderFilterController

Exibir arquivo Open project: Microsoft/StopGuessing Class Usage Examples

Protected Properties

Property Type Description
FilterClient StopGuessing.Clients.DistributedBinomialLadderFilterClient
NumberOfBitsPerShard int
SecretSaltToPreventAlgorithmicComplexityAttacks string
ShardsByIndex FilterArray>.Dictionary

Public Methods

Method Description
DistributedBinomialLadderFilterController ( DistributedBinomialLadderFilterClient distributedBinomialLadderFilterClient, int numberOfBitsPerShard, string secretSaltToPreventAlgorithmicComplexityAttacks ) : System.Collections.Generic

Construct the controller (server) for requests to this host for its shards of the binomial ladder filter.

Protected Methods

Method Description
GetShard ( int shardNumber ) : FilterArray

Get the fitler array that stores a shard based on the shard number.

GetShard ( string element ) : FilterArray

Get the fitler array that stores a shard associated with a given element.

Private Methods

Method Description
AssignRandomBit ( [ shardNumber, [ valueToAssign ) : void
DistributedStepAsync ( [ element, [ heightOfLadderInRungs ) : int
GetHeight ( [ element, [ heightOfLadderInRungs = null ) : int

Method Details

DistributedBinomialLadderFilterController() public method

Construct the controller (server) for requests to this host for its shards of the binomial ladder filter.
public DistributedBinomialLadderFilterController ( DistributedBinomialLadderFilterClient distributedBinomialLadderFilterClient, int numberOfBitsPerShard, string secretSaltToPreventAlgorithmicComplexityAttacks ) : System.Collections.Generic
distributedBinomialLadderFilterClient StopGuessing.Clients.DistributedBinomialLadderFilterClient A client used by this server to access the servers hosting other shards of the filter.
numberOfBitsPerShard int The number of bits that each shard should contain.
secretSaltToPreventAlgorithmicComplexityAttacks string /// A secret used to salt the filter's hash functions so as to prevent attacks that might try to find collisions in the small space we are hashing to.
return System.Collections.Generic

GetShard() protected method

Get the fitler array that stores a shard based on the shard number.
protected GetShard ( int shardNumber ) : FilterArray
shardNumber int The shard number (index) to get.
return StopGuessing.DataStructures.FilterArray

GetShard() protected method

Get the fitler array that stores a shard associated with a given element.
protected GetShard ( string element ) : FilterArray
element string The element to associate with a shard.
return StopGuessing.DataStructures.FilterArray

Property Details

FilterClient protected_oe property

Since the filter is distributed into shards which are stored on many hosts, we need a client to access the shards of the filter that are stored on other hosts.
protected DistributedBinomialLadderFilterClient,StopGuessing.Clients FilterClient
return StopGuessing.Clients.DistributedBinomialLadderFilterClient

NumberOfBitsPerShard protected_oe property

The number of bits stored in each shard.
protected int NumberOfBitsPerShard
return int

SecretSaltToPreventAlgorithmicComplexityAttacks protected_oe property

A secret string used to salt hashes so as to prevent algorithmic complexity attacks.
protected string SecretSaltToPreventAlgorithmicComplexityAttacks
return string

ShardsByIndex protected_oe property

The shards of the filter that this host has a (not-necessarily-up-to-date) copy of.
protected Dictionary ShardsByIndex
return FilterArray>.Dictionary