class documentation

class _FilterHints(object):

View In Hierarchy

Class for filter analytics.

When filters are used, the user of the Query class usually doesn't know exactly which items will be necessary for building the result. It therefore has to prepare and compute the input data for potentially returning everything.

There are two ways to optimize this. The first, and simpler, is to assign each field a group of data, so that the caller can determine which computations are necessary depending on the data groups requested. The list of referenced groups must also be computed for fields referenced in the filter.

The second is restricting the items based on a primary key. The primary key is usually a unique name (e.g. a node name). This class extracts all referenced names from a filter. If it encounters any filter condition which disallows such a list to be determined (e.g. a non-equality filter), all names will be requested.

The end-effect is that any operation other than qlang.OP_OR and qlang.OP_EQUAL will make the query more expensive.

Method __init__ Initializes this class.
Method NoteBinaryOp Called when handling a binary operation.
Method NoteLogicOp Called when handling a logic operation.
Method NoteUnaryOp Called when handling an unary operation.
Method ReferencedData Returns all kinds of data referenced by the filter.
Method RequestedNames Returns all requested values.
Method _NeedAllNames Changes internal state to request all names.
Instance Variable _allnames Undocumented
Instance Variable _datakinds Undocumented
Instance Variable _namefield Undocumented
Instance Variable _names Undocumented
def __init__(self, namefield):

Initializes this class.

Parameters
namefield:stringField caller is interested in
def NoteBinaryOp(self, op, datakind, name, value):

Called when handling a binary operation.

Parameters
op:stringOperator
datakindUndocumented
name:stringLeft-hand side of operator (field name)
valueRight-hand side of operator
def NoteLogicOp(self, op):

Called when handling a logic operation.

Parameters
op:stringOperator
def NoteUnaryOp(self, op, datakind):

Called when handling an unary operation.

Parameters
op:stringOperator
datakindUndocumented
def ReferencedData(self):

Returns all kinds of data referenced by the filter.

def RequestedNames(self):

Returns all requested values.

Returns None if list of values can't be determined (e.g. encountered non-equality operators).

Returns
listUndocumented
def _NeedAllNames(self):

Changes internal state to request all names.

_allnames: bool =

Undocumented

_datakinds: set =

Undocumented

_namefield =

Undocumented

_names: list =

Undocumented