Bucket

source: bluebase/ix/bucket.py


class IxPosting(buffer: bytearray)[source]

Bases: LayoutMixin

Layout

Offset

Size

Name

Format

0

4

rid_pid

'<i'

4

4

rid_sid

'<i'

classmethod new(rid: RmRecordId) → Self[source]
property rid: RmRecordIdread-only
size: ClassVar[int] = 8

The total size of the layout, automatically calculated from fields.

class IxBucketHeader(page: PfPage, *, offset: int, limit: int)[source]

Bases: PfPageView, LayoutMixin

Layout

Offset

Size

Name

Format

0

4

posting_count

'<i'

4

4

prev_bid

'<i'

8

4

next_bid

'<i'

NO_PREV_BUCKET: ClassVar[IxBucketId] = -1

previous bucket가 없을 경우 사용하는 상수.

NO_NEXT_BUCKET: ClassVar[IxBucketId] = -1

next bucket가 없을 경우 사용하는 상수.

size: ClassVar[int] = 12

The total size of the layout, automatically calculated from fields.

class IxBucket(page: PfPage)[source]

Bases: object

Variables:
classmethod new(page: PfPage) → Self[source]
property header_offset: intread-only
property header_size: intread-only
property payload_offset: intread-only
property payload_size: intread-only
property posting_size: intread-only
property posting_capacity: intread-only
property posting_count: intread-write
property prev_bid: IxBucketId | Noneread-write
property next_bid: IxBucketId | Noneread-write
property last_pid: IxPostingIdread-only
get_header() → IxBucketHeader[source]
get_posting_offset(pid: IxPostingId) → int[source]
get_posting(pid: IxPostingId) → IxPosting[source]
set_posting(pid: IxPostingId, posting: IxPosting) → None[source]
postings(begin: IxPostingId | None = None, end: IxPostingId | None = None) → Iterator[tuple[IxPostingId, IxPosting]][source]
is_empty() → bool[source]
is_full() → bool[source]
assignmentsearch(rid: RmRecordId) → IxPostingId | None[source]
assignmentinsert(rid: RmRecordId) → None[source]
assignmentdelete(rid: RmRecordId) → None[source]
assignmentunpin() → None[source]