github.com/dolthub/dolt/go@v0.40.5-0.20240520175717-68db7794bea6/serial/prolly.fbs (about)

     1  // Copyright 2021 Dolthub, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  namespace serial;
    16  
    17  enum ItemType : uint8 {
    18    Unknown,
    19    TupleFormatAlpha = 1,
    20  }
    21  
    22  table ProllyTreeNode {
    23    // sorted array of key items
    24    key_items:[ubyte] (required);
    25    // items offets for |key_items|
    26    // first offset is 0, last offset is len(key_items)
    27    key_offsets:[uint16] (required);
    28    // item type for |key_items|
    29    key_type:ItemType;
    30  
    31    // array of values items, ordered by paired key
    32    value_items:[ubyte];
    33    // item offsets for |value_items|
    34    // first offset is 0, last offset is len(value_items)
    35    value_offsets:[uint16];
    36    // item type for |value_items|
    37    value_type:ItemType;
    38    // offsets for each address (if any) in |value_items|
    39    // (eg value tuples containing out-of-line BLOB addresses)
    40    value_address_offsets:[uint16];
    41  
    42    // array of chunk addresses
    43    //  - subtree addresses for internal prolly tree nodes
    44    //  - value addresses for AddressMap leaf nodes
    45    address_array:[ubyte];
    46  
    47    // array of varint encoded subtree counts
    48    // see: go/store/prolly/message/varint.go
    49    subtree_counts:[ubyte];
    50    // total count of prolly tree
    51    tree_count:uint64;
    52    // prolly tree level, 0 for leaf nodes
    53    tree_level:uint8;
    54  }
    55  
    56  // KEEP THIS IN SYNC WITH fileidentifiers.go
    57  file_identifier "TUPM";
    58  
    59  root_type ProllyTreeNode;