Свойство | Type | Description | |
---|---|---|---|
MaxLadderHeight | int | ||
MinimumCacheFreshnessRequired | System.TimeSpan | ||
NumberOfShards | int | ||
ShardToHostMapping | IDistributedResponsibilitySet |
Свойство | Type | Description | |
---|---|---|---|
CacheOfElementsAtTopOfLadder | DateTime>.FixedSizeLruCache | ||
ShardHashFunction |
Méthode | Description | |
---|---|---|
AssignRandomBit ( int valueToAssign, int shardNumber = null ) : void |
Assign a random element with the binomial ladder filter to either 0 or 1.
|
|
DistributedBinomialLadderFilterClient ( int numberOfShards, int defaultHeightOfLadder, IDistributedResponsibilitySet |
Create a client for a distributed binomial ladder filter
|
|
GetHeightAsync ( string element, int heightOfLadderInRungs = null, System.TimeSpan timeout = null, |
Get the height of an element on its binomial ladder. The height of an element is the number of the H array elements that are associated with it that have value 1.
|
|
GetRandomShardIndex ( ) : int |
Get a random shard index from the set of shards that make up the array elements of the binomial ladder filter.
|
|
GetShardIndex ( string key ) : int |
Get the shard index associated with an element.
|
|
StepAsync ( string key, int heightOfLadderInRungs = null, System.TimeSpan timeout = null, |
The Step operation records the occurrence of an element by increasing the element's height on the binomial ladder. It does this by identify the shard of the filter array associated with the element, fetching the H elements within that shard associated with the element (the element's rungs), and setting one of the elements with value 0 (a rung above the element) to have value 1 (to put it below the element). It then clears two random elements from the entire array (not just the shard). If none of the H rungs associated with an element have value 0, Step will instead set two random elements from within the full array to have value 1.
|
public AssignRandomBit ( int valueToAssign, int shardNumber = null ) : void | ||
valueToAssign | int | The random element will be set to 1 if this parameter is nonzero, and to 0 otherwise. |
shardNumber | int | Optioanlly set this optional value to identify a shard number within to select a random element. /// If not set, this method will choose a shard at random. |
Résultat | void |
public DistributedBinomialLadderFilterClient ( int numberOfShards, int defaultHeightOfLadder, IDistributedResponsibilitySet |
||
numberOfShards | int | The number of shards that the bit array of the binomial ladder filter will be divided into. /// The greater the number of shards, the more evently it can be distributed. However, the number of shards should still /// be a few orders of magnitude smaller than the ladder height. |
defaultHeightOfLadder | int | The default ladder height for elements on the ladder. |
shardToHostMapping | IDistributedResponsibilitySet |
An object that maps each shard number to the host responsible for that shard. |
configurationKey | string | A key used to protect the hashing from algorithmic complexity attacks. /// This key should not be unique to the application using the filter and should not be known to any untrusted /// systems that might control which elements get sent to the filter. If an attacker could submit elements to the filter /// and knew this key, the attacker could arrange for all elements to go to the same shard and in so doing overload that shard. |
mininmumCacheFreshnessRequired | System.TimeSpan | The maximum time that an element should be kept in the cache of elements at the top of their ladder. /// In other words, how long to bound the possible time that an element may still appear to be at the top of its ladder in the cache /// when it is no longer at the top of the ladder based on the filter array. Defaults to one minute. |
Résultat | System |
public GetHeightAsync ( string element, int heightOfLadderInRungs = null, System.TimeSpan timeout = null, |
||
element | string | The element to be measured to determine its height on its binomial ladder. |
heightOfLadderInRungs | int | >If set, use a binomial ladder of this height rather than the default height. /// (Must not be greater than the default height that the binmomial ladder was initialized with. |
timeout | System.TimeSpan | |
cancellationToken | ||
Résultat | Task |
public GetShardIndex ( string key ) : int | ||
key | string | The element to match to a shard index. |
Résultat | int |
public StepAsync ( string key, int heightOfLadderInRungs = null, System.TimeSpan timeout = null, |
||
key | string | The element to take a step for. |
heightOfLadderInRungs | int | If set, use a binomial ladder of this height rather than the default height. /// (Must not be greater than the default height that the binmomial ladder was initialized with.) |
timeout | System.TimeSpan | |
cancellationToken | ||
Résultat | Task |
protected FixedSizeLruCache |
||
Résultat | DateTime>.FixedSizeLruCache |
public TimeSpan,System MinimumCacheFreshnessRequired | ||
Résultat | System.TimeSpan |
protected UniversalHashFunction,StopGuessing.EncryptionPrimitives ShardHashFunction | ||
Résultat |