Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Block serialization/deserialization
Previously, there are 3 sections in a serialized Block: * Name - written by BlockEncodingSerde * e.g. "ARRAY" indicating it's an ArrayBlock * Metadata - written by BlockEncodingFactory * e.g. "INT_ARRAY" indicating the inner Block type of an ArrayBlock * e.g. 4 indicating the entry size of FixedWidthBlock * Data - written by BlockEncoding This 3-section scheme makes things more complicated: * Not recursive - For an ArrayBlock with IntArrayBlock inside, the encoding of IntArrayBlock isn't the same as a stand-alone IntArrayBlock. Specifically, part of it is put in the metadata section, and part of it in the data section. This requires each invididual encoding to handle nested blocks, which introduces both code duplication and complexity. * It is harder to learn and understand the implementations with two interfaces (BlockEncodingFactory and BlockEncoding), which don't have a very clear separation of responsibility, for each Block. This commit solves both problems: * Only a single class (BlockEncoding) is now needed. * A block inside another block now serializes the exact same way as a standalone one. The outer block no longer need to handle any of the details of the inner one. It also resolves the TODO item that replacementBlockForWrite was not respected for nested Blocks.
- Loading branch information
Showing
51 changed files
with
314 additions
and
735 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.