Method and system for renaming consecutive keys in a B-tree
First Claim
Patent Images
1. A method of renaming a range of consecutive keys in an original B-tree having a plurality of keys stored therein, comprising:
- excising the range of consecutive keys from the original B-tree, the original B-tree representing a file system, wherein renaming an element of the file system requires the changing of the values of the range of consecutive keys, the excision of the range of consecutive keys converting the original B-tree into a trimmed tree;
balancing the trimmed tree;
storing the range of consecutive keys excised from the original B-tree to form an extracted tree;
renaming the keys of the extracted tree to form a modified extracted tree;
inserting the modified extracted tree into the balanced trimmed tree to form a final B-tree; and
balancing the final B-tree,wherein the original B-tree represents a hierarchical namespace of a file system of a computing device, and the range of consecutive keys belong to a directory of the file system such that the directory is represented as the B-tree, and wherein the changing of the values of the range of consecutive keys is in connection with the directory being renamed,wherein each key in the original B-tree contains a pathname for a file or directory of the file system prior to the renaming of the directory,wherein the excised range of consecutive keys satisfy a range query “
Y/”
≦
v≦
“
Y/∞
”
, wherein “
Y”
represents the element of the file system to be renamed, “
v”
represents keys in the B-tree, and “
∞
”
represents a special character defined to be greater than all characters in a set of alphanumeric symbols used for creating the plurality of keys, andwherein the excising further comprises finding a root node of the extracted tree by traversing the original B-tree and stopping at a node in the original B-tree that has one or more keys that satisfy the range query, moving down from the node along two separate paths including a first path that follows “
Y/” and
a second path that follows “
Y/∞
”
, and continuing until reaching a leaf node along each of the two paths.
2 Assignments
0 Petitions
Accused Products
Abstract
An efficient method for renaming consecutive keys in a B-tree representing a hierarchical namespace, such as a file system, has an estimated time efficiency of O(logN), where N is the number of nodes in the B-tree. All the consecutive keys to be renamed are first excised from the original B-tree to form a trimmed B-tree, and the excised nodes are stored in a separate temporary extracted B-tree. The nodes in extracted B-tree are then renamed, and the renamed extracted B-tree is inserted into the trimmed B-tree to form a final B-tree that contains the renamed keys.
29 Citations
10 Claims
-
1. A method of renaming a range of consecutive keys in an original B-tree having a plurality of keys stored therein, comprising:
-
excising the range of consecutive keys from the original B-tree, the original B-tree representing a file system, wherein renaming an element of the file system requires the changing of the values of the range of consecutive keys, the excision of the range of consecutive keys converting the original B-tree into a trimmed tree; balancing the trimmed tree; storing the range of consecutive keys excised from the original B-tree to form an extracted tree; renaming the keys of the extracted tree to form a modified extracted tree; inserting the modified extracted tree into the balanced trimmed tree to form a final B-tree; and balancing the final B-tree, wherein the original B-tree represents a hierarchical namespace of a file system of a computing device, and the range of consecutive keys belong to a directory of the file system such that the directory is represented as the B-tree, and wherein the changing of the values of the range of consecutive keys is in connection with the directory being renamed, wherein each key in the original B-tree contains a pathname for a file or directory of the file system prior to the renaming of the directory, wherein the excised range of consecutive keys satisfy a range query “
Y/”
≦
v≦
“
Y/∞
”
, wherein “
Y”
represents the element of the file system to be renamed, “
v”
represents keys in the B-tree, and “
∞
”
represents a special character defined to be greater than all characters in a set of alphanumeric symbols used for creating the plurality of keys, andwherein the excising further comprises finding a root node of the extracted tree by traversing the original B-tree and stopping at a node in the original B-tree that has one or more keys that satisfy the range query, moving down from the node along two separate paths including a first path that follows “
Y/” and
a second path that follows “
Y/∞
”
, and continuing until reaching a leaf node along each of the two paths. - View Dependent Claims (2, 3)
-
-
4. A computer-readable storage medium having computer-executable instructions for performing steps for renaming a range of consecutive keys in an original B-tree having a plurality of keys stored therein, comprising:
-
excising the range of consecutive keys from the original B-tree, the original B-tree representing a file system, wherein renaming an element of the file system requires the changing of the values of the range of consecutive keys, the excision of the range of consecutive keys converting the original B-tree into a trimmed tree; balancing the trimmed tree; storing the range of consecutive keys excised from the original B-tree to form an extracted tree; renaming the keys of the extracted tree to form a modified extracted tree; inserting the modified extracted tree into the balanced trimmed tree to form a final B-tree; and balancing the final B-tree, wherein the original B-tree represents a hierarchical namespace of a file system of a computing device, and the range of consecutive keys belong to a directory of the file system such that the directory is represented as the B-tree, and wherein the changing of the values of the range of consecutive keys is in connection with the directory being renamed, wherein each key in the original B-tree contains a pathname for a file or directory of the file system prior to the renaming of the directory, wherein the excised range of consecutive keys satisfy a range query “
Y/”
≦
v≦
“
Y/∞
”
, wherein “
Y”
represents the element of the file system to be renamed, “
v”
represents the keys in the B-tree, and “
∞
”
represents a special character defined to be greater than all characters in a set of alphanumeric symbols used for creating the plurality of keys, andwherein the excising further comprises finding a root node of the extracted tree by traversing the original B-tree and stopping at a node in the original B-tree that has one or more keys that satisfy the range query, moving down from the node along two separate paths including a first path that follows “
Y/” and
a second path that follows “
Y/∞
”
, and continuing until reaching a leaf node along each of the two paths. - View Dependent Claims (5, 6)
-
-
7. A method of modifying a B-tree, wherein the B-tree represents a file system of a computing device, wherein renaming an element of the file system requires the changing of the values of the range of consecutive keys, each key in the B-tree contains a pathname for a file or directory of the file system, the method comprising:
-
excising keys of a directory of the file system being renamed from the B-tree, the directory being represented as the B-tree, the excision of the keys of the directory converting the B-tree into a trimmed tree; balancing the trimmed tree; storing the keys of the directory excised from the B-tree in an extracted tree; changing the values of the keys of the extracted tree to reflect a new name of the directory; inserting the extracted tree with changed values of the keys into the balanced trimmed tree to form a final B-tree; and balancing the final B-tree, wherein the excised keys of the directory satisfy a range query “
Y/”
≦
v≦
“
Y/∞
”
, wherein “
Y”
represents the element of the file system to be renamed, “
v”
represents the keys in the B-tree, and “
∞
”
represents a special character defined to be greater than all characters in a set of alphanumeric symbols used for creating the plurality of keys, andwherein the excising further comprises finding a root node of the extracted tree by traversing the original B-tree and stopping at a node in the original B-tree that has one or more keys that satisfy the range query, moving down from the node along two separate paths including a first path that follows “
Y/” and
a second path that follows “
Y/∞
”
, and continuing until reaching a leaf node along each of the two paths. - View Dependent Claims (8)
-
-
9. A computer-readable storage medium having computer-executable instructions for performing steps for modifying a B-tree, wherein the B-tree represents a file system of a computing device, wherein renaming an element of the file system requires the changing of the values of the range of consecutive keys, each key in the B-tree contains a pathname for a file or directory of the file system, the method comprising:
-
excising keys of a directory of the file system being renamed from the B-tree, the directory being represented as the B-tree, the excision of the keys of the directory converting the B-tree into a trimmed tree; balancing the trimmed tree; storing the keys of the directory excised from the B-tree in an extracted tree; changing the values of the keys of the extracted tree to reflect a new name of the directory; inserting the extracted tree with changed values of the keys into the balanced trimmed tree to form a final B-tree; and balancing the final B-tree, wherein the excised keys of the directory satisfy a range query “
Y/”
≦
v≦
“
Y/∞
”
, wherein “
Y”
represents the element of the file system to be renamed, “
v”
represents the keys in the B-tree, and “
∞
”
represents a special character defined to be greater than all characters in a set of alphanumeric symbols used for creating the plurality of keys, andwherein the excising further comprises finding a root node of the extracted tree by traversing the original B-tree and stopping at a node in the original B-tree that has one or more keys that satisfy the range query, moving down from the node along two separate paths including a first path that follows “
Y/” and
a second path that follows “
Y/∞
”
, and continuing until reaching a leaf node along each of the two paths. - View Dependent Claims (10)
-
Specification