Go to the latest version of this document.

# ``twisted`.`protocols`.`htb`.`HierarchicalBucketFilter``

class documentation

`class HierarchicalBucketFilter: (source)`

Known subclasses: `twisted.protocols.htb.FilterByHost`, `twisted.protocols.htb.FilterByServer`

Constructor: `HierarchicalBucketFilter(parentFilter)`

Implements interfaces: `twisted.protocols.htb.IBucketFilter`

View In Hierarchy

Filter things into buckets that can be nested.

Method | `__init__` | Undocumented
Method | `getBucketFor` | Find or create a `Bucket` corresponding to the provided parameters.
Method | `getBucketKey` | Construct a key based on the input parameters to choose a `Bucket`.
Method | `sweep` | Remove empty buckets.
Class Variable | `bucketFactory` | Class of buckets to make.
Class Variable | `sweepInterval` | Seconds between sweeping out the bucket cache.
Instance Variable | `buckets` | Undocumented
Instance Variable | `lastSweep` | Undocumented
Instance Variable | `parentFilter` | Undocumented

def __init__(self, parentFilter=None): (source)

Undocumented

def getBucketFor(self, *a, **kw): (source)
from `twisted.protocols.htb.IBucketFilter`

Find or create a `Bucket` corresponding to the provided parameters.

Any parameters are passed on to `getBucketKey`, from them it decides which bucket you get.

Returns
`Bucket` | Undocumented

def getBucketKey(self, *a, **kw): (source)
overridden in `twisted.protocols.htb.FilterByHost`, `twisted.protocols.htb.FilterByServer`

Construct a key based on the input parameters to choose a `Bucket`.

The default implementation returns the same key for all arguments. Override this method to provide `Bucket` selection.

Returns
Something to be used as a key in the bucket cache.

def sweep(self): (source)

Remove empty buckets.

bucketFactory: `Bucket` = (source)

Class of buckets to make.

sweepInterval: `int` = (source)
overridden in `twisted.protocols.htb.FilterByHost`, `twisted.protocols.htb.FilterByServer`

Seconds between sweeping out the bucket cache.

buckets: `dict` = (source)

Undocumented

lastSweep = (source)

Undocumented

parentFilter = (source)

Undocumented