Ideas For Refactoring coreunix.Adder #3277
Labels
need/analysis
Needs further analysis before proceeding
need/community-input
Needs input from the wider community
topic/commands:add
Topic commands:add
topic/core-api
Topic core-api
In my opinion Currently
coreunix.Adder
is currently trying to do to many things at once. Thecoreunix.Adder
should be simplified to only handle adding of single files. It should not concern it self with pinning (or if the GCLock is held for the matter) or creating directories objects.To handle pinning the GCLock should be held before
coreunix.Add
is called.Add
will then return the hash to add and the caller and it is the caller's job to pin it and release the GCLock.Adding of directory should be handled in a similar fashion. First off, if the code is not there already there should be an easy way to create a directory object from a collection of nodes. Then the add command should add files individually and then create a directory object from from the added files rather than have
coreunix.Adder
build up the directory object.Thoughts? Is This something we should Aim for?
This likely relates to how the refactoring for the core-api (#3173, #3174 and others) is handled.
CC: @whyrusleeping @lgierth.
The text was updated successfully, but these errors were encountered: