Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: #SDK-822. Nodes on demand #2114

Closed
wants to merge 89 commits into from
Closed

Conversation

alber2510
Copy link
Contributor

No description provided.

Avoid to add nodes in table statecache
With these methods we can load node on demand
Avoid to Db at the end of initsc and updatesc
Keep in memory only ROOTNODE, RUBBISHNODE and INCOMINGNODE
We keep in memory when it's received by putNode command or if its parent is in memory
Avoid to make extra operation with nodes that they are going to be removed immediately
@alber2510 alber2510 changed the title WIP: #552. Nodes on demand WIP: #SDK-822. Nodes on demand Aug 26, 2020
Comment on lines 517 to 521
if (data && size)
{
node.mNode = std::string(static_cast<const char*>(data), size);
nodes[nodeHandle] = node;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if data or size are invalid? Perhaps we should:

Suggested change
if (data && size)
{
node.mNode = std::string(static_cast<const char*>(data), size);
nodes[nodeHandle] = node;
}
if (!data || !size)
{
break;
}
node.mNode = std::string(static_cast<const char*>(data), size);
nodes[nodeHandle] = node;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

std::map<handle, NodeSerialized> nodeMap;
sctable->getChildrenFromNode(node->nodehandle, nodeMap);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we, at least, log a message if the method returns false? (something went wrong)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/db/sqlite.cpp Outdated Show resolved Hide resolved
Refactorize `shareOrLink_t` and fix the case where a folder link can be
taken as an outgoing share
Unused variables, castings from `size_t` to `int` and other minor
changes
@sergiohs84 sergiohs84 closed this Feb 22, 2021
@sergiohs84 sergiohs84 deleted the feature/nodes-on-demand branch February 22, 2021 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants