ipfs / go-ipld-format

IPLD Node and Resolver interfaces in Go
https://github.com/ipld/ipld
MIT License
64 stars 26 forks source link

Batch should not hardcodes MaxNodes #44

Closed hsanjuan closed 6 years ago

hsanjuan commented 6 years ago

The Batch type hardcodes MaxNodes to a value of 128 because The current implementation of flatfs opens this many file descriptors at the same time for the optimized batch write.

However at this level we should not assume a DAGService is connected to flatfs at all.

IMHO Batch type should not contain hardcoded defaults and should force the user to provide them on the initialize to make it very explicit that it needs to be a reasonable value for the use of that Batch service.