Good idea.  To be fully future-proof, this could even become:

tOffset* getBlockStarts(dfsFs fs, char* file);

That would permit variable sized-blocks, which could happen, e.g., if we someday support appending to files. Is that overkill?

I like it a lot! (I'm really hoping for record aligned variable sized- blocks :) You need to get a count for the offset array though:

tOffset* getBlockStarts(dfsFS fs, const char *file, int *count);

As far as future-proofing goes, it may be good enough for the near(?) future when we first get variable sized blocks. But longer term if you have variable sized-blocks, you are really talking about extents more than blocks, so you can start talking about sparse files, extent compacting for deleted records and the like. If the future DFS has those features, not only would you need offset and length for a block, but you would probably have an API that supports manipulating blocks.

ben

Reply via email to