ChunkIterator::SEQUENTIAL_WRITE


#1

Is there a difference between

and

Or should they behave the same way?

Thanks


#2

Hello,
ChunkIterator::SEQUENTIAL_WRITE
is an optimization.

It means that you guarantee you will write the chunk in the order of increasing coordinates. Formally, you will write the chunk using a series of setPosition calls like
setPosition(Coordinates c0)

setPosition(Coordinates c1)

setPosition(Coordinates cn)

c0 could be any valid position in the chunk.
c1 must be greater than c0
cn must be greater than cn-1 for all n
Where “greater than” is defined by struct CoordinatesLess (Metadata.h). In exchange, the chunk is written much quicker.

If, instead you do not specify SEQUENTIAL_WRITE, you can write out the chunk in any order, but the method flush will take longer.