update_commit_file.md

November 28, 2023 · View on GitHub

A update commit file has name <timestamped_name>.upd and is located here:

my_array                              # array folder
   |_ ....
   |_ __commits                       # array commits folder
         |_ <timestamped_name>.upd    # update commit file
         |_ ...

There may be multiple such files in the array commits folder. Each update commit file contains a tile with a serialized update condition, which is a tree of nodes followed by update values, which is a list of values. Each node for the condition can be a value node or expression node. Expression nodes have the following on disk format:

FieldTypeDescription
Node typeuint8_t0 for expression node
Combination opuint8_tAND(0), OR(1), NOT(2)
Num childrenuint64_t[]Number of child nodes
Children 1NODEchildren 1
Children NNODEChildren N

Value nodes have the following on disk format:

FieldTypeDescription
Node typeuint8_t1 for value node
Opuint8_tLT(0), LE(1), GT(2), GE(3), EQ(4), NE(5)
Field name sizeuint32_tSize of the field name
Field name valueuint8_t[]Field name value
Value sizeuint64_tValue size
Value contentuint8_t[]Value

Update values are serialized in the following format:

FieldTypeDescription
Number of valuesuint64_tNumber of values N
Field name size 1uint64_tSize of the field name for the first update value
Field name value 1uint8_t[]Field name value for the first update value
Value size 1uint64_tValue size for first update value
Value content 1uint8_t[]Value for first update value
Field name size Nuint64_tSize of the field name for update value N
Field name value Nuint8_t[]Field name value for update value N
Value size Nuint64_tValue size for update value N
Value content Nuint8_t[]Value for update value N