Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions aerospike_helpers/expressions/bitwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,14 @@ def __init__(
bit_offset (int): Bit index of where to start operation.
bit_size (int): Number of bits to be operated on.
value (int): Integer value or expression for value to add.
action (int): An aerospike bit overflow action. See
:ref:`Bitwise overflow actions <aerospike_bitwise_overflow>`.
action (aerospike.constant): Action taken if an overflow/underflow occurs.
Action must be one of the following:

- :data:`aerospike.BIT_OVERFLOW_FAIL`
- :data:`aerospike.BIT_OVERFLOW_SATURATE`
- :data:`aerospike.BIT_OVERFLOW_WRAP`

See :ref:`Bitwise Overflow <aerospike_bitwise_overflow>` for more information.
bin (TypeBinName): A :class:`~aerospike_helpers.expressions.base.BlobBin` expression.

:return: resulting blob with the bits operated on.
Expand Down Expand Up @@ -492,8 +498,14 @@ def __init__(
bit_offset (int): Bit index of where to start operation.
bit_size (int): Number of bits to be operated on.
value (int): Integer value or expression for value to add.
action (int): An aerospike bit overflow action. See
:ref:`Bitwise overflow actions <aerospike_bitwise_overflow>`.
action (aerospike.constant): Action taken if an overflow/underflow occurs.
Action must be one of the following:

- :data:`aerospike.BIT_OVERFLOW_FAIL`
- :data:`aerospike.BIT_OVERFLOW_SATURATE`
- :data:`aerospike.BIT_OVERFLOW_WRAP`

See :ref:`Bitwise Overflow <aerospike_bitwise_overflow>` for more information.
bin (TypeBinName): A :class:`~aerospike_helpers.expressions.base.BlobBin` expression.

:return: resulting blob with the bits operated on.
Expand Down
15 changes: 14 additions & 1 deletion aerospike_helpers/operations/bitwise_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ def bit_add(bin_name: str, bit_offset, bit_size, value, sign, action, policy=Non
value (int): The value to be added.
sign (bool): True: treat value as signed, False: treat value as unsigned.
action (aerospike.constant): Action taken if an overflow/underflow occurs.
Action must be one of the following.

- :data:`aerospike.BIT_OVERFLOW_FAIL`
- :data:`aerospike.BIT_OVERFLOW_SATURATE`
- :data:`aerospike.BIT_OVERFLOW_WRAP`

See :ref:`Bitwise Overflow <aerospike_bitwise_overflow>` for more information.
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.

Returns:
Expand Down Expand Up @@ -586,7 +593,13 @@ def bit_subtract(bin_name: str, bit_offset, bit_size, value, sign, action, polic
bit_size (int): How many bits of value to subtract.
value (int): The value to be subtracted.
sign (bool): True: treat value as signed, False: treat value as unsigned.
action (aerospike.constant): Action taken if an overflow/underflow occurs.
action (aerospike.constant): Action taken if an overflow/underflow occurs. Action must be one of the following:

- :data:`aerospike.BIT_OVERFLOW_FAIL`
- :data:`aerospike.BIT_OVERFLOW_SATURATE`
- :data:`aerospike.BIT_OVERFLOW_WRAP`

See :ref:`Bitwise Overflow <aerospike_bitwise_overflow>` for more information.
policy (dict): The :ref:`bit_policy <aerospike_bit_policies>` dictionary. default: None.

Returns:
Expand Down
Loading