system.interfaces.indexing.bitmap_indexes module¶
Abstract interface for bitmap indexes.
- class system.interfaces.indexing.bitmap_indexes.BitmapIndex(bit_sequence_type: ~typing.Type[~system.interfaces.bit_sequence.UncompressedBitSequence] = <class 'system.bit_sequences.IntegerBitSequence'>, compression_type: ~typing.Type[~system.interfaces.bit_sequence.CompressedBitSequence] | None = None)[source]¶
Bases:
Index,PointQueryMixIn,RangeQueryMixIn,ABC,GenericAbstract base class for bitmap index structures that allow for efficient filtering.
- put(key: Key, value: Value) None[source]¶
See
Index.put().Not supported by bitmap indexes; raises
NotImplementedError.
- delete(key: Key, value: Value | None = None) None[source]¶
See
Index.delete().Not supported by bitmap indexes; raises
NotImplementedError.
- flush(key: Key | None = None) None[source]¶
See
Index.flush().Not supported by bitmap indexes; raises
NotImplementedError.
- bulkload(data: Iterator[tuple[Key, Value]], key_prefix: str = '') None[source]¶
See
Index.bulkload().Builds the value-to-position and position-to-value maps from the data and fills a per-key bit sequence for every distinct key, then adjusts the number of bits represented by each bit sequence to the number of distinct values seen.
- Parameters:
key_prefix – Reserved for subclasses that key their bit sequences by a prefix; this base implementation does not use it.
- get(key: Key) Iterator[Value][source]¶
See
PointQueryMixIn.get().Yields the values represented by the set bits of the equal bit sequence for the given key.
- get_all_in_range(min_key: Key, max_key: Key) Iterator[Value][source]¶
See
RangeQueryMixIn.get_all_in_range().Yields the values of the intersection (bitwise AND) of the greater-or-equal
min_keyand smaller-or-equalmax_keybit sequences, i.e. the values whose key lies in[min_key, max_key].
- abstractmethod get_number_of_bits() int[source]¶
Return the number of stored bits in this bitmap index. :return: The number of stored bits.
- abstractmethod get_equal(key: Key) BitSequence[source]¶
Get a bit_sequence for all values that are equal the given key. :param key: The key
- get_smaller(key: Key) BitSequence[source]¶
Get a bit_sequence for all values that are smaller than the given key. :param key: The key
- get_smaller_or_equal(key: Key) BitSequence[source]¶
Get a bit_sequence for all values that are smaller or equal than the given key.
- get_greater(key: Key) BitSequence[source]¶
Get a bit_sequence for all values that are greater than the given key.
- get_greater_or_equal(key: Key) BitSequence[source]¶
Get a bit_sequence for all values that are greater than or equal the given attribute value.