orbit-db-store icon indicating copy to clipboard operation
orbit-db-store copied to clipboard

Create basic implementation for _addOperationBatch

Open ptoner opened this issue 5 years ago • 5 comments

I was trying to use the "batchPut" function in orbit-db-docstore but noticed that this method wasn't implemented yet.

Rebuilding the index seemed like it was probably the most expensive part, so I saved it for the last operation. I wasn't sure if there were any other intended optimizations. I wasn't sure what to do the with "batchOperation" variable that is passed in. I'm also not sure if "_localHeads" should be set every iteration or just the last one.

ptoner avatar Apr 28 '19 14:04 ptoner

Hey @ptoner, if you're still interested in getting this in I'd love to help. It would be great to have tests, might you be able to write them?

aphelionz avatar May 11 '20 15:05 aphelionz

Yea I'm still into it. It's been so long that I forgot that I actually included code, ha. What kinds of tests would we need? I still don't know the answers to my original questions.

ptoner avatar May 14 '20 13:05 ptoner

I see - @haadcode looks like Git blames you :laughing: https://github.com/orbitdb/orbit-db-store/commit/77490af21fbacc4e598691e26c10579e14d54671

What did you have in mind for these arguments or this function in general? See @ptoner 's ruminations in the OP

aphelionz avatar May 16 '20 16:05 aphelionz

It was a long time ago and afaik we don't use _addBatchOperation() anywhere. More generally, as this was never implemented, feel free to implement it the best possible way, including the signature of the function.

That is to say, I don't know (can't remember) what the batchOperation variable is :)

On high level it makes sense that we would set _localHeads as the very last thing, only once.

Does that answer your questions?

haadcode avatar May 18 '20 05:05 haadcode

Yes that does help. I'll try to put together some tests for this soon. Thanks!

ptoner avatar Jun 01 '20 19:06 ptoner