Beruflich Dokumente
Kultur Dokumente
Problems?
What Problems?
Problem Overview
Compression Efficient Compaction True Random Access Range/Slice Deletes Corruption Recovery
Compression
Efficient Compaction
Must be calculated at write time Doesnt always fit in memory (wide rows)
Range/Slice Deletes
Corruption Recovery
Solutions?
674 + 2319: A Holistic Approach
Solution Overview
Compression Efficient Compaction True Random Access Range/Slice Deletes Corruption Recovery
Compression
CounterColumnType
Monday, July 11, 2011
default: LZF
Efficient Compaction
Configurable size (64k default) Never larger than memory (unless a column is)
One-pass compaction
Range/Slice Deletes
Range/Slice metadata
Corruption Recovery
Scan for MAGIC (not implemented!) Request repair from replica (not implemented!) Fail noisily (totally implemented!)
Block Example
key1
name1
value1
name2
value2
key2
name1
value1
Block Example
key1
name1
value1
name2
value2
key2
name1
value1
The Block
Read a column:
The Chunk
Entries for a particular level of a tree Entry enum byte per entry (next slide) Values at a level are all the same AbstractType
Type compressed
Entry Enum
true: lazily decode value, timestamps false: skip entry by bumping positions
Block Example:
Key Chunk
enums values clientts localts
Monday, July 11, 2011
Block Example:
Name Chunk
enums values clientts localts
Monday, July 11, 2011
Block Example:
Name Chunk
enums values clientts localts
Monday, July 11, 2011
Block Example:
Value Chunk
enums values clientts localts
Monday, July 11, 2011
byte[ ] MAGIC; // magic resync value int length; // length of encoded content ByteBuffer content; // encoded content
Decoded content:
ByteBuffer enums; // enums for entries ByteBuffer[ ] values; // values for level long[ ] clientTS; // client timestamps Bitset clientTSNulls; // bit per client ts int[ ] localTS; // local timestamps Bitset localTSNulls; // bit per local ts
0. Use promoted index file to find block for col. 1. Seek directly to block in data file 2. Decode key, name, value chunks
Current Status
Current Status
Wide row support finished June 24th Narrow row support finished July 9th Ready for wider testing! Remaining issues for #647 + #2319
Reversed slices are stubbed Scrub is stubbed Two to three streaming stubs
Future Optimizations
Find with value/name X (not implemented) 1. Scan to first block 2. Decode only value/name chunk 3. Hit?
Compaction Path
Compact without decoding (not implemented) 0. Synchronize blocks across files 1. Decode key chunk 2. Any keys / ranges intersecting?
Narrow row type optimization (not implemented) Split columns with defined validators into separate chunks
thats it!
Questions ?
Monday, July 11, 2011