MCPcopy Create free account
hub / github.com/apache/kvrocks / GetBitfieldInteger

Function GetBitfieldInteger

src/types/redis_bitmap.cc:770–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770static rocksdb::Status GetBitfieldInteger(const ArrayBitfieldBitmap &bitfield, uint32_t bit_offset,
771 BitfieldEncoding enc, uint64_t *res) {
772 if (enc.IsSigned()) {
773 auto status = bitfield.GetSignedBitfield(bit_offset, enc.Bits());
774 if (!status) {
775 return rocksdb::Status::InvalidArgument();
776 }
777 *res = status.GetValue();
778 } else {
779 auto status = bitfield.GetUnsignedBitfield(bit_offset, enc.Bits());
780 if (!status) {
781 return rocksdb::Status::InvalidArgument();
782 }
783 *res = status.GetValue();
784 }
785 return rocksdb::Status::OK();
786}
787
788static rocksdb::Status CopyBitfieldBytesToSegments(engine::Context &ctx, Bitmap::SegmentCacheStore &store,
789 const ArrayBitfieldBitmap &bitfield, uint32_t byte_offset,

Callers 1

Calls 5

IsSignedMethod · 0.80
GetSignedBitfieldMethod · 0.80
BitsMethod · 0.80
GetValueMethod · 0.80
GetUnsignedBitfieldMethod · 0.80

Tested by

no test coverage detected