-
Notifications
You must be signed in to change notification settings - Fork 66
collection: generate ordered uris for crated resources #169
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkralik
reviewed
Dec 14, 2021
Danielius1922
commented
Dec 14, 2021
Danielius1922
commented
Dec 14, 2021
Danielius1922
commented
Dec 14, 2021
jkralik
approved these changes
Dec 14, 2021
Danielius1922
commented
Dec 14, 2021
jkralik
reviewed
Dec 14, 2021
712625b
to
f61fa23
Compare
jkralik
approved these changes
Dec 15, 2021
1128663
to
67fb89f
Compare
3fef8bb
to
d470a4f
Compare
jkralik
approved these changes
Dec 16, 2021
ondrejtomcik
approved these changes
Dec 16, 2021
For created resources in the collection create uris with the format "${collection uri}/{index}", where index is the lowest numerical value not used by some other resource in the collection. If such uri cannot be used then fallback to the original randomly generated uri.
Each collections keeps a list of owned resources (links). Default uri for a resource in a collection is in the format "${collection uri}/${index}", where index is a unique integer value. When a new resource is generated a unique index value must be found. We also want index to be the lowest possible value. For an unordered list this would require an O(n^2) algorithm. To enable the use of an O(n) algorithm we keep the list with links ordered primarily by uri length and secondarily by uri value.
Use this header to add compiler specific code without breaking compilation on all platforms.
Segfault occured with collections, create and resource observations enabled. After adding cca 25 resources the payload became so large that it was larger than maximal allowed size (OC_MAX_APP_DATA_SIZE). However, error handling was not done, so the -1 returned by oc_rep_get_encoded_payload_size was casted to size_t and interpreted as payload size (4GB in this case).
d470a4f
to
f240ec7
Compare
WAvdBeek
approved these changes
Jan 14, 2022
will be merged on monday (17 Jan 2022 - afternoon) if the previous merge passes the CTT |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.