Bedrock.SystemKeys.ShardMetadata (bedrock v0.5.3)
View SourceFlatBuffer schema for shard metadata.
The shard tag is encoded in the key path (\xff/system/shards/{tag}),
not in this value. Genealogy fields (parents, children) will be added
later when implementing splits.
Fields
start_key- Start of key range (inclusive)end_key- End of key range (exclusive)born_at- Version when shard was createdended_at- Version when shard was split/merged (0 = active)
Example
# Encode
binary = ShardMetadata.to_binary(%{
start_key: "",
end_key: "m",
born_at: 100,
ended_at: 0
})
# Decode
{:ok, metadata} = ShardMetadata.read(binary)
Summary
Functions
Checks if the shard is still active (not split/merged)
Creates a new shard metadata binary
Functions
Checks if the shard is still active (not split/merged)
@spec new(start_key :: binary(), end_key :: binary(), born_at :: non_neg_integer()) :: binary()
Creates a new shard metadata binary