Cross-segment support.
Clarify locking
Check for need to decode/encode cross-segments on restart
Fix some cross-segment check blocks bugs and simplify dataBlocks + crossSegmentCheckBlocks -> blocksForDecode()
Include the total number of data blocks and check blocks in the basic settings, and check it on startup.
Write completeViaTruncation flag.
Write total cross-check blocks.
Keep cross-check blocks separately to the main blocks: Either after the data and check blocks *for a segment* if not completing via truncation, or after ALL the data blocks if we are. This is essential for truncation to work.
Heavy logging to see if this does anything.
Actually enable cross-segment, ooops
Fix NPE
This was correct in the code it was copied from :|
Fix bugs
Bugfix - actually use tryDecode, don't start decoding if already decoding.
Fix array bug
Fix calculation of locations
Pass in DiskCheckingRAFFactory from ClientContext, use it when creating files for complete-via-truncate, don't just cast the provided factory as it won't be the right type if non-persistent.
File was way too long! We only need to store the downloaded blocks for each segment i.e. at most the number of data blocks for that segment (they won't necessarily all be data blocks). Now the download tempfile is only slightly bigger than the content. This also fixes a hash error with completion via truncation.
Fix NPE in decoding
Fix bogus key comparison