Skip to main content

SortedMap

reboot.std.collections.sorted_map


Standard library collection that may be larger than memory, and which is efficiently mapped to Reboot's underlying storage.

Frequently used to create indexes of other types, but can also be used to efficiently store large collections of primitive values.

SortedMap

A larger than memory map, sorted by its keys. Supports batch insertion and removal, and sorted range queries.

Keys are strings, and values are bytes. You can efficiently use a SortedMap as a (sorted) set by storing empty values.

Insert

rpc Insert(InsertRequest) InsertResponse

Insert a batch of entries into the SortedMap.

Remove

rpc Remove(RemoveRequest) RemoveResponse

Remove a batch of keys from the SortedMap.

Range

rpc Range(RangeRequest) RangeResponse

Read a range of data within the SortedMap.

The start_key is inclusive, and the end_key is exclusive. If the start or end are unset, then the range is unbounded in that direction.

The limit argument is required, to avoid exhausting memory in the client or server.

Messages

Entry

See Range.

FieldTypeDescription
keystringThe key of an entry.
valuebytesThe value of an entry.

InsertRequest

See Insert.

FieldTypeDescription
entriesmap InsertRequest.EntriesEntryThe entries to insert.

InsertRequest.EntriesEntry

FieldTypeDescription
keystringnone
valuebytesnone

InsertResponse

See Insert.

RangeRequest

See Range.

FieldTypeDescription
oneof _start_key.start_keyoptional stringThe start key to scan from (inclusive). If not specified, the range is unbounded at the start.
oneof _end_key.end_keyoptional stringThe end key to scan to (exclusive). If not specified, the range is unbounded at the end.
limituint32The limit of entries to be returned. Must be specified, and non-zero.

RangeResponse

See Range.

FieldTypeDescription
entriesrepeated EntryResponses are in key order. We cannot use protobuf's map because it does not preserve insertion order.

RemoveRequest

See Remove.

FieldTypeDescription
keysrepeated stringThe keys to remove.

RemoveResponse

See Remove.