Module common_meta::key

source ·
Expand description

This mod defines all the keys used in the metadata store (Metasrv). Specifically, there are these kinds of keys:

  1. Datanode table key: __dn_table/{datanode_id}/{table_id}

    • The value is a DatanodeTableValue struct; it contains table_id and the regions that belong to this Datanode.
    • This key is primary used in the startup of Datanode, to let Datanode know which tables and regions it should open.
  2. Table info key: __table_info/{table_id}

    • The value is a TableInfoValue struct; it contains the whole table info (like column schemas).
    • This key is mainly used in constructing the table in Datanode and Frontend.
  3. Catalog name key: __catalog_name/{catalog_name}

    • Indices all catalog names
  4. Schema name key: __schema_name/{catalog_name}/{schema_name}

    • Indices all schema names belong to the {catalog_name}
  5. Table name key: __table_name/{catalog_name}/{schema_name}/{table_name}

    • The value is a TableNameValue struct; it contains the table id.
    • Used in the table name to table id lookup.
  6. Flow info key: __flow/info/{flow_id}

    • Stores metadata of the flow.
  7. Flow route key: __flow/route/{flow_id}/{partition_id}

    • Stores route of the flow.
  8. Flow name key: __flow/name/{catalog}/{flow_name}

    • Mapping {catalog}/{flow_name} to {flow_id}
  9. Flownode flow key: __flow/flownode/{flownode_id}/{flow_id}/{partition_id}

    • Mapping {flownode_id} to {flow_id}
  10. Table flow key: __flow/source_table/{table_id}/{flownode_id}/{flow_id}/{partition_id}

    • Mapping source table’s {table_id} to {flownode_id}
    • Used in Flownode booting.
  11. View info key: __view_info/{view_id}

    • The value is a ViewInfoValue struct; it contains the encoded logical plan.
    • This key is mainly used in constructing the view in Datanode and Frontend.

All keys have related managers. The managers take care of the serialization and deserialization of keys and values, and the interaction with the underlying KV store backend.

To simplify the managers used in struct fields and function parameters, we define “unify” table metadata manager: TableMetadataManager and flow metadata manager: FlowMetadataManager. It contains all the managers defined above. It’s recommended to just use this manager only.

The whole picture of flow keys will be like this:

__flow/ info/ {flow_id} route/ {flow_id}/ {partition_id}

name/ {catalog_name} {flow_name}

flownode/ {flownode_id}/ {flow_id}/ {partition_id}

source_table/ {table_id}/ {flownode_id}/ {flow_id}/ {partition_id}

Modules§

Macros§

Structs§

Constants§

Traits§

Type Aliases§