Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
eeffcefd
Commit
eeffcefd
authored
Feb 18, 2008
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lock tree, range tree documentation.
git-svn-id:
file:///svn/tokudb@2331
c7de825b-a66e-492c-adef-691d508d4ae1
parent
e085cb5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
69 deletions
+74
-69
src/range_tree/rangetree.h
src/range_tree/rangetree.h
+74
-69
No files found.
src/range_tree/rangetree.h
View file @
eeffcefd
...
...
@@ -30,8 +30,6 @@ typedef struct __toku_point toku_point;
/** \brief Range with value
Represents a range of data with an associated value.
Parameters are never modified on failure with the exception of
buf and buflen.
*/
typedef
struct
{
toku_point
*
left
;
/**< Left end-point */
...
...
@@ -39,6 +37,9 @@ typedef struct {
DB_TXN
*
data
;
/**< Data associated with the range */
}
toku_range
;
/** \brief Parameters are never modified on failure with the exception of
buf and buflen.
*/
struct
__toku_range_tree
;
/** Export the internal representation to a sensible name */
...
...
@@ -62,7 +63,7 @@ int toku_rt_get_allow_overlaps(toku_range_tree* tree, BOOL* allowed);
\param ptree Points to the new range tree if create is successful
\param end_cmp User provided function to compare end points.
Return value conforms to cmp in qsort(3).
It must be commutative
.
It is assumed to define a total order
.
\param data_cmp User provided function to compare data values.
Return value conforms to cmp in qsort(3).
\param allow_overlaps Whether ranges in this range tree are permitted
...
...
@@ -84,11 +85,14 @@ int toku_rt_create(toku_range_tree** ptree,
/**
Destroys and frees a range tree.
\param tree The range tree to close.
\return
- 0: Success.
- EINVAL: If tree is NULL.
*/
int
toku_rt_close
(
toku_range_tree
*
tree
/**< The range tree to free */
);
int
toku_rt_close
(
toku_range_tree
*
tree
);
/**
Finds ranges in the range tree that overlap a query range.
...
...
@@ -103,9 +107,10 @@ int toku_rt_close(toku_range_tree* tree /**< The range tree to free */);
NOTE: buf must have been dynamically allocated i.e. via
malloc(3), calloc(3), etc.
The buffer will not be modified unless it is too small.
\param buflen A pointer to the lenf
th of the buffer.
\param buflen A pointer to the current leng
th of the buffer.
If the buffer is increased, then buflen will be updated.
\param numfound The number of ranges found. This will necessarily be <= k.
\param numfound The number of ranges found. This will necessarily be <= k
unless k == 0.
If k != 0 && numfound == k, there may be additional
ranges that overlap the queried range but were skipped
to accomodate the request of k.
...
...
@@ -114,8 +119,8 @@ int toku_rt_close(toku_range_tree* tree /**< The range tree to free */);
- 0: Success.
- EINVAL: If any pointer argument is NULL. If range.data != NULL.
If buflen == 0.
- Other exit codes may be forwarded from underlying system calls but only
if buf is
not large enough.
- Other exit codes may be forwarded from underlying system calls if buf is
not large enough.
Growth direction: It may be useful in the future to add an extra out
parameter to specify whether more elements exist in the tree that overlap
...
...
@@ -134,8 +139,8 @@ int toku_rt_find(toku_range_tree* tree,toku_range* query, u_int32_t k,
\return
- 0: Success.
- EINVAL: If any pointer argument is NULL.
- EDOM:
If the exact range (left, right, and data) already
exists in the tree.
- EDOM:
If an equivalent range (left, right, and data according to
end_cmp and data_cmp) already
exists in the tree.
If an overlapping range exists in the tree and
allow_overlaps == FALSE.
- Other exit codes may be forwarded from underlying system calls.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment