Class BlockingBitmapCommandsImpl<K>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
-
- io.quarkus.redis.runtime.datasource.BlockingBitmapCommandsImpl<K>
-
- All Implemented Interfaces:
BitMapCommands<K>
,RedisCommands
public class BlockingBitmapCommandsImpl<K> extends AbstractRedisCommandGroup implements BitMapCommands<K>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
-
Constructor Summary
Constructors Constructor Description BlockingBitmapCommandsImpl(RedisDataSource ds, ReactiveBitMapCommands<K> reactive, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
bitcount(K key)
Execute the command BITCOUNT.long
bitcount(K key, long start, long end)
Execute the command BITCOUNT.List<Long>
bitfield(K key, BitFieldArgs bitFieldArgs)
Execute the command BITFIELD.long
bitopAnd(K destination, K... keys)
Execute the command BITOP.long
bitopNot(K destination, K source)
Execute the command BITOP.long
bitopOr(K destination, K... keys)
Execute the command BITOP.long
bitopXor(K destination, K... keys)
Execute the command BITOP.long
bitpos(K key, int bit)
Execute the command BITPOS.long
bitpos(K key, int bit, long start)
Execute the command BITPOS.long
bitpos(K key, int bit, long start, long end)
Execute the command BITPOS.int
getbit(K key, long offset)
Returns the bit value at offset in the string value stored at key.int
setbit(K key, long offset, int value)
Sets or clears the bit at offset in the string value stored at key.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
getDataSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommands
getDataSource
-
-
-
-
Constructor Detail
-
BlockingBitmapCommandsImpl
public BlockingBitmapCommandsImpl(RedisDataSource ds, ReactiveBitMapCommands<K> reactive, Duration timeout)
-
-
Method Detail
-
setbit
public int setbit(K key, long offset, int value)
Description copied from interface:BitMapCommands
Sets or clears the bit at offset in the string value stored at key.- Specified by:
setbit
in interfaceBitMapCommands<K>
- Parameters:
key
- the key.offset
- the offsetvalue
- the value (O or 1)- Returns:
- the original bit value stored at offset, 0 or 1.
-
bitcount
public long bitcount(K key)
Description copied from interface:BitMapCommands
Execute the command BITCOUNT. Summary: Count set bits in a string Group: bitmap Requires Redis 2.6.0- Specified by:
bitcount
in interfaceBitMapCommands<K>
- Parameters:
key
- the key- Returns:
- the number of bits set to 1 in the stored string.
-
bitcount
public long bitcount(K key, long start, long end)
Description copied from interface:BitMapCommands
Execute the command BITCOUNT. Summary: Count set bits in a string Group: bitmap Requires Redis 2.6.0- Specified by:
bitcount
in interfaceBitMapCommands<K>
- Parameters:
key
- the keystart
- the start indexend
- the end index- Returns:
- the number of bits set to 1 in the stored string.
-
bitfield
public List<Long> bitfield(K key, BitFieldArgs bitFieldArgs)
Description copied from interface:BitMapCommands
Execute the command BITFIELD. Summary: Perform arbitrary bitfield integer operations on strings Group: bitmap Requires Redis 3.2.0- Specified by:
bitfield
in interfaceBitMapCommands<K>
- Parameters:
key
- the key- Returns:
- the results from the bitfield commands as described on https://redis.io/commands/bitfield/.
-
bitpos
public long bitpos(K key, int bit)
Description copied from interface:BitMapCommands
Execute the command BITPOS. Summary: Find first bit set or clear in a string Group: bitmap Requires Redis 2.8.7- Specified by:
bitpos
in interfaceBitMapCommands<K>
- Parameters:
key
- the keybit
-1
to look for1
,0
to look for0
- Returns:
- the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero ints, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three ints set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only. However, this behavior changes if you are looking for clear bits and specify a range with both start and end. If no clear bit is found in the specified range, the function returns -1 as the user specified a clear range and there are no 0 bits in that range.
-
bitpos
public long bitpos(K key, int bit, long start)
Description copied from interface:BitMapCommands
Execute the command BITPOS. Summary: Find first bit set or clear in a string Group: bitmap Requires Redis 2.8.7- Specified by:
bitpos
in interfaceBitMapCommands<K>
- Parameters:
key
- the keybit
-1
to look for1
,0
to look for0
start
- the start position- Returns:
- the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero ints, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three ints set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only. However, this behavior changes if you are looking for clear bits and specify a range with both start and end. If no clear bit is found in the specified range, the function returns -1 as the user specified a clear range and there are no 0 bits in that range.
-
bitpos
public long bitpos(K key, int bit, long start, long end)
Description copied from interface:BitMapCommands
Execute the command BITPOS. Summary: Find first bit set or clear in a string Group: bitmap Requires Redis 2.8.7- Specified by:
bitpos
in interfaceBitMapCommands<K>
- Parameters:
key
- the keybit
-true
to look for1
,false
to look for0
start
- the start positionend
- the end position- Returns:
- the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero ints, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three ints set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only. However, this behavior changes if you are looking for clear bits and specify a range with both start and end. If no clear bit is found in the specified range, the function returns -1 as the user specified a clear range and there are no 0 bits in that range.
-
bitopAnd
public long bitopAnd(K destination, K... keys)
Description copied from interface:BitMapCommands
Execute the command BITOP. Summary: Perform a bitwise AND operation between strings Group: bitmap Requires Redis 2.6.0- Specified by:
bitopAnd
in interfaceBitMapCommands<K>
- Parameters:
destination
- the destination keykeys
- the keys- Returns:
- The size of the string stored in the destination key, that is equal to the size of the longest input string.
-
bitopNot
public long bitopNot(K destination, K source)
Description copied from interface:BitMapCommands
Execute the command BITOP. Summary: Perform a bitwise NOT operation between strings Group: bitmap Requires Redis 2.6.0- Specified by:
bitopNot
in interfaceBitMapCommands<K>
- Parameters:
destination
- the destination keysource
- the source key- Returns:
- The size of the string stored in the destination key, that is equal to the size of the longest input string.
-
bitopOr
public long bitopOr(K destination, K... keys)
Description copied from interface:BitMapCommands
Execute the command BITOP. Summary: Perform a bitwise OR operation between strings Group: bitmap Requires Redis 2.6.0- Specified by:
bitopOr
in interfaceBitMapCommands<K>
- Parameters:
destination
- the destination keykeys
- the keys- Returns:
- The size of the string stored in the destination key, that is equal to the size of the longest input string.
-
bitopXor
public long bitopXor(K destination, K... keys)
Description copied from interface:BitMapCommands
Execute the command BITOP. Summary: Perform a bitwise XOR operation between strings Group: bitmap Requires Redis 2.6.0- Specified by:
bitopXor
in interfaceBitMapCommands<K>
- Parameters:
destination
- the destination keykeys
- the keys- Returns:
- The size of the string stored in the destination key, that is equal to the size of the longest input string.
-
getbit
public int getbit(K key, long offset)
Description copied from interface:BitMapCommands
Returns the bit value at offset in the string value stored at key.- Specified by:
getbit
in interfaceBitMapCommands<K>
- Parameters:
key
- the key.offset
- the offset- Returns:
- the bit value stored at offset (0 or 1).
-
-