A file reading method and apparatus
By cached part of the index data into memory when the file is read, the performance reduction problem caused by frequent access to metadata in the local file system is solved, and the read and write performance of the storage cluster is improved.
Patent Information
- Application Number
- CN202010563616.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-19
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2040-06-19
AI Technical Summary
Frequent metadata access of existing local file systems leads to degradation of performance, especially when concurrent access operations are large, frequent disk IO access causes IO queues, affecting the read and write performance of the storage cluster.
When reading a file, some of the index data is cached into memory, reducing the number of IO access to disk, quickly locate the file position through the first index data in memory, and combining the second index data in disk for file reading.
By reducing the number of disk accesses and reducing the level of directory indexes, the access performance of the local file system is improved and the read and write performance of the storage cluster is improved.
Smart Images

Figure CN111782590B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed storage technology, and in particular to a file reading method and device. Background Art
[0002] With the rapid development of technologies such as high-definition video, image processing, and video surveillance, user data capacity is increasing, and user requirements for the read and write performance of stored data are also increasing simultaneously. When purchasing storage products, users often have clear performance requirements to meet business needs. In many business scenarios, storage performance is not just a matter of speed; it can even affect the normal operation of the business itself. Take file digitization as an example. After archives and libraries digitize paper books, they store them on storage servers. As more and more digitized books are stored, the capacity of the storage cluster will continue to grow. At the same time, with a large number of users accessing them concurrently, poor read and write performance and high read and write latency in the storage cluster will reduce user friendliness and hinder the advancement of digitization. Therefore, improving the read and write performance of the storage cluster is crucial.
[0003] The local file system, as a component of distributed storage, directly manages disks. The performance of the local file system directly affects the performance of the entire distributed file system. Therefore, an efficient local file system is critical to distributed storage.
[0004] Currently, mainstream local file systems rely on directory indexing technology to traverse directories layer by layer, performing multiple read operations to locate and read target files. However, when these multiple read operations require disk access, they result in a large number of disk access operations. When the number of concurrent access operations is large, frequent disk I / O operations lead to frequent access to local file system metadata, resulting in I / O queues and ultimately degrading local file system performance. Summary of the Invention
[0005] The embodiments of the present application provide a file reading method and device to solve the problem in the prior art that frequent access to local file system metadata leads to reduced local file system performance.
[0006] The specific technical solutions provided in the embodiments of this application are as follows:
[0007] In a first aspect, the present application provides a file reading method, which is applied to a storage server in a distributed storage system, wherein first index data is stored in a memory of the storage server and second index data is stored in a disk of the storage server, and the method comprises:
[0008] Upon receiving a file reading instruction, determining a file to be read, and determining first index data corresponding to the file to be read from the memory according to the file to be read;
[0009] Determining second index data corresponding to the file to be read from the disk according to the first index data corresponding to the file to be read;
[0010] The file to be read is read from the disk according to the second index data corresponding to the file to be read.
[0011] Optionally, the method further includes:
[0012] When initializing the local file system, determining at least one level of target index data that can be cached in the memory based on the size of the memory and the size of the index data of each level stored in the disk;
[0013] Obtain the at least one level target index data from the disk and cache the at least one level target index data in the memory, wherein the at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
[0014] Optionally, the step of determining at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk includes:
[0015] Determining a size of the memory available for caching the first index data according to a size of the memory and a preset ratio available for caching the first index data;
[0016] Based on the size of the index data of each level stored in the disk and the size of the memory that can be used to cache the first index data, determine at least one level of target index data that can be cached in the memory, wherein the size of the at least one level of target index data is less than or equal to the size of the memory that can be used to cache the first index data.
[0017] Optionally, the at least one level target index data is level one index data;
[0018] The steps of obtaining the at least one first-level target index data from the disk and caching the at least one first-level target index data in the memory include:
[0019] Traverse the disk node where the root directory is located to obtain the data block set corresponding to the first-level index;
[0020] The data in the data block set is read, and the read data in the data block set is cached in the memory.
[0021] In a second aspect, the present application provides a file reading device, which is applied to a storage server in a distributed storage system, wherein the memory of the storage server stores first index data, and the disk of the storage server stores second index data, and the device includes:
[0022] a first determining unit, configured to determine a file to be read upon receiving a file reading instruction, and determine first index data corresponding to the file to be read from the memory according to the file to be read;
[0023] a second determining unit, configured to determine, from the disk, second index data corresponding to the file to be read according to the first index data corresponding to the file to be read;
[0024] A reading unit is configured to read the file to be read from the disk according to the second index data corresponding to the file to be read.
[0025] Optionally, the device further comprises:
[0026] a third determining unit, which, when initializing the local file system, determines at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk;
[0027] A cache unit is used to obtain the at least one level target index data from the disk and cache the at least one level target index data in the memory, wherein the at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
[0028] Optionally, when determining at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk, the third determining unit is specifically configured to:
[0029] Determining a size of the memory available for caching the first index data according to a size of the memory and a preset ratio available for caching the first index data;
[0030] Based on the size of the index data of each level stored in the disk and the size of the memory that can be used to cache the first index data, determine at least one level of target index data that can be cached in the memory, wherein the size of the at least one level of target index data is less than or equal to the size of the memory that can be used to cache the first index data.
[0031] Optionally, the at least one level target index data is level one index data;
[0032] When obtaining the at least one level target index data from the disk and caching the at least one level target index data in the memory, the cache unit is specifically configured to:
[0033] Traverse the disk node where the root directory is located to obtain the data block set corresponding to the first-level index;
[0034] The data in the data block set is read, and the read data in the data block set is cached in the memory.
[0035] In a third aspect, the present application provides a computing device, the computing device comprising:
[0036] a memory for storing program instructions;
[0037] The processor is used to call the program instructions stored in the above-mentioned memory and execute any one of the methods in the above-mentioned first aspect according to the obtained program.
[0038] In a fourth aspect, the present application provides a computer storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any one of the methods in the first aspect.
[0039] The beneficial effects of this application are as follows:
[0040] To sum up, the file reading method provided by the present application determines the file to be read when receiving a file reading instruction, and determines the first index data corresponding to the file to be read from the memory based on the file to be read; determines the second index data corresponding to the file to be read from the disk based on the first index data corresponding to the file to be read; and reads the file to be read from the disk based on the second index data corresponding to the file to be read.
[0041] By adopting the file reading method provided in this application, the department index file is cached in the memory during the local file initialization process, which reduces the number of IO accesses to the disk and the level of the directory index, thereby improving the local file system access performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of a file reading method provided in an embodiment of the present application;
[0043] Figure 2 A flowchart of a method for caching first index data into a memory provided in an embodiment of the present application;
[0044] Figure 3 A schematic structural diagram of a file reading device provided in an embodiment of the present application;
[0045] Figure 4 A schematic structural diagram of another file reading device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] First, in the embodiments of this application, the term "and" is simply used to describe the relationship between related objects, indicating that three possible relationships exist. For example, A and B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0048] When the present application mentions ordinal numbers such as "first", "second", "third" or "fourth", unless the context clearly indicates an order, it should be understood that they are merely used for distinction.
[0049] The scheme of the present application will be described in detail below through specific examples. Of course, the present application is not limited to the following examples.
[0050] Currently, mainstream local file systems all use directory indexing technology to traverse directories layer by layer and eventually find the file location for file reading.
[0051] For example, to search for the / etc / passwd file, the specific processing steps are as follows:
[0052] Step 1: Locate the disk node (inode) of the root directory. In the local file system, the inode number of the root directory is fixed to 2 (some local file systems have a root directory inode number of 3, but here we use inode 2 as an example).
[0053] Step 2: Get the content in inode2 and know that the specific data of the root directory is stored in data block 100. The next step is to read the content of block 100 from the disk.
[0054] Step 3: Traverse the contents of block 100, which are directory entries, and find the one corresponding to etc. Assume that the inode of etc is 10.
[0055] Step 4: Locate the inode of the etc directory file and find that the specific data of the etc directory is stored in block 200. The next step is to read the contents of block 200.
[0056] Step 5: Traverse the contents of block 200, which are also directory entries one by one, and find the one corresponding to the passwd file. Assume that the inode of passwd is 30.
[0057] Step 6: Locate the inode of the passwd file and find that the specific content of the passwd file is stored in block 300.
[0058] At this point, we have found the specific location of the passwd file on the disk, which is block 300.
[0059] Step 7: Read the contents of block 300. The file reading process is complete.
[0060] That is to say, when reading a file from the storage server, it is necessary to go through multiple levels (such as 3 levels) of indexing to locate the file and then complete the file reading.
[0061] As shown above, the / etc / passwd file read process involves three index reads and three data reads. These six read operations require disk reads in the event of a cache miss, leading to a large number of file accesses and, consequently, disk I / O accesses, which in turn increases disk pressure. As the number of concurrently accessed files increases, these frequent disk I / O accesses can become a performance bottleneck for the local file system. This means that frequent metadata access to the local file system leads to I / O queues, which degrades local file system performance.
[0062] For example, see Figure 1 FIG. 1 is a flow chart of a file reading method provided by the present application. The method is applied to a storage server in a distributed storage system. The first index data is stored in the memory of the storage server, and the second index data is stored in the disk of the storage server. The detailed flow of the file reading method is as follows:
[0063] Step 100: upon receiving a file reading instruction, determining a file to be read, and determining first index data corresponding to the file to be read from the memory based on the file to be read.
[0064] In an embodiment of the present application, before executing step 100, the above-mentioned file reading method may further include the following steps: when initializing the local file system, determining at least one level of target index data that can be cached in the memory based on the size of the above-mentioned memory and the size of the index data of each level stored in the disk; obtaining the above-mentioned at least one level of target index data from the above-mentioned disk, and caching the above-mentioned at least one level of target index data in the above-mentioned memory.
[0065] The at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
[0066] It should be noted that in the embodiment of the present application, all index data for locating each file is stored on the disk of the storage server, and only part of the index data is cached in the memory of the storage server. That is, the first index data is cached in the memory of the storage server, and the first index data and the second index data are stored on the disk of the storage server.
[0067] Preferably, in an embodiment of the present application, when determining at least one level of target index data that can be cached in the memory based on the size of the above-mentioned memory and the size of the index data of each level stored in the disk, a preferred method is to determine the size of the above-mentioned memory that can be used to cache the above-mentioned first index data based on the size of the above-mentioned memory and a pre-set ratio that can be used to cache the first index data; and determine at least one level of target index data that can be cached in the above-mentioned memory based on the size of the index data of each level stored in the above-mentioned disk and the size of the above-mentioned memory that can be used to cache the above-mentioned first index data, wherein the size of the above-mentioned at least one level of target index data is less than or equal to the size of the above-mentioned memory that can be used to cache the above-mentioned first index data.
[0068] That is to say, when the storage server is started and the local file system is initialized, first, based on the capacity of the storage server's own memory (e.g., 3G) and the pre-defined ratio parameter of the memory that can be used to cache the first index data (e.g., 5%), the capacity of the memory that can be used to cache the first index data (3G*5%) is determined; then, based on the size of the various levels of index data (assuming that they include the first-level index, the second-level index, and the third-level index) stored on the disk of the storage server and the capacity of the memory that can be used to cache the first index data determined above, at least one level of index data that can be cached in the memory is determined (e.g., it is determined that the first-level index data can be cached in the memory).
[0069] The following is an example of the at least one level of index data that can be cached in the memory being determined to be a first-level index. In an embodiment of the present application, the at least one level of target index data is a first-level index data. Then, when obtaining the at least one level of target index data from the disk and caching the at least one level of target index data in the memory, a preferred implementation method is to traverse the disk node where the root directory is located, obtain the data block set corresponding to the first-level index, read the data in the data block set, and cache the data in the read data block set in the memory.
[0070] In an embodiment of the present application, the local file system of the storage server includes a multi-level index, that is, the first index data includes a primary index or multi-level index data, and the third index data may also include a primary index or multi-level index data. Below, the local file system includes three-level index data (wherein the primary index data is the first index data, which is cached in the memory of the storage server, and the secondary index data and the tertiary storage data are the second index data, which are stored in the disk of the storage server) as an example for explanation. Then, when executing step 100, when the storage server receives the file read instruction sent by the user client, it parses the file read instruction and determines the file to be read by the user client this time. Then, the storage server determines the primary index data corresponding to the file to be read from the primary index stored in the memory based on the file to be read.
[0071] Step 110: Determine second index data corresponding to the file to be read from the disk according to the first index data corresponding to the file to be read.
[0072] In an embodiment of the present application, the storage location of the second-level index data corresponding to a file can be determined based on the first-level index data corresponding to the file. Similarly, if the second-level index data is not the last-level index data, the third-level index data corresponding to the file can also be determined based on the second-level index data corresponding to the file, and so on. Based on the n-1-level index data corresponding to the file, the n-level index data corresponding to the file can be determined, assuming that the n-level index data is the last-level index data.
[0073] Step 120: Read the file to be read from the disk according to the second index data corresponding to the file to be read.
[0074] In an embodiment of the present application, the storage server determines the location of the corresponding second index data on the disk based on the first index data corresponding to the file to be read in the memory, reads the second index data from the disk, and determines the location of the file to be read on the disk based on the read second index data, and finally, reads the file to be read from the disk.
[0075] For example, still taking the example of the first-level index data being cached in the memory of the storage server and the second-level index data and the third-level storage data being stored in the disk of the storage server, when the storage server obtains the first-level index data corresponding to the file to be read from the memory, first, according to the first-level index data corresponding to the file to be read, it determines the first disk node where the second-level index data corresponding to the file to be read is stored, and determines the second-level index data corresponding to the file to be read from the first disk node; then, according to the second-level index data of the file to be read, it determines the second disk node where the third-level index data corresponding to the file to be read is stored, and determines the third-level index data corresponding to the file to be read from the second disk; finally, according to the third-level index data corresponding to the file to be read, it determines the third disk node where the file to be read is stored, and reads the data to be read from the third disk node.
[0076] Below, the above embodiments of the present application are further described using specific application scenarios. Figure 2 FIG. 1 is a detailed flowchart of a method for caching first index data into a memory according to an embodiment of the present application. The method may include the following steps:
[0077] Step 200: The local file system is started.
[0078] Specifically, when the storage server starts, it needs to initialize the local file system.
[0079] Step 210: Get the local memory size and set the cache index level.
[0080] Specifically, the storage server obtains the size of the local memory and sets the level of index data that can be cached to the memory according to the size of the local memory.
[0081] Step 220: Read the root directory index.
[0082] Specifically, the inode disk information of the root directory index is read. In practical applications, the root directory index is usually stored in inode 2.
[0083] Step 230: Determine whether the inode disk block number corresponding to the root directory index is successfully obtained. If so, execute step 240; otherwise, execute step 270.
[0084] Specifically, after reading the inode disk information of the root directory index, the blockid information corresponding to the root directory index is obtained, the root directory index data is obtained, and then step 240 is executed.
[0085] Step 240: Get the block id corresponding to the root directory index.
[0086] The block corresponding to the root directory index stores the first-level index item, that is, the blockid information corresponding to the first-level index is maintained. According to the block id information corresponding to each first-level index, the first-level index data in the block corresponding to each first-level index is read.
[0087] Step 250 : Determine whether the first-level index data contained in the block content corresponding to the root directory index is obtained. If so, execute step 260 ; otherwise, execute step 270 .
[0088] Step 260: Cache the first-level index data into the memory.
[0089] Step 270: The local file system fails to load.
[0090] Based on the above embodiments, see Figure 3 FIG. 1 is a schematic diagram of the structure of a file reading device provided by the present application, wherein the device is applied to a storage server in a distributed storage system, wherein the memory of the storage server stores first index data, and the disk of the storage server stores second index data, and wherein the device includes:
[0091] The first determining unit 30 is configured to determine a file to be read upon receiving a file reading instruction, and determine first index data corresponding to the file to be read from the memory according to the file to be read;
[0092] A second determining unit 31 is configured to determine, from the disk, second index data corresponding to the file to be read according to the first index data corresponding to the file to be read;
[0093] The reading unit 32 is configured to read the file to be read from the disk according to the second index data corresponding to the file to be read.
[0094] Optionally, the device further comprises:
[0095] a third determining unit, which, when initializing the local file system, determines at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk;
[0096] A cache unit is used to obtain the at least one level target index data from the disk and cache the at least one level target index data in the memory, wherein the at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
[0097] Optionally, when determining at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk, the third determining unit is specifically configured to:
[0098] Determining a size of the memory available for caching the first index data according to a size of the memory and a preset ratio available for caching the first index data;
[0099] Based on the size of the index data of each level stored in the disk and the size of the memory that can be used to cache the first index data, determine at least one level of target index data that can be cached in the memory, wherein the size of the at least one level of target index data is less than or equal to the size of the memory that can be used to cache the first index data.
[0100] Optionally, the at least one level target index data is level one index data;
[0101] When obtaining the at least one level target index data from the disk and caching the at least one level target index data in the memory, the cache unit is specifically configured to:
[0102] Traverse the disk node where the root directory is located to obtain the data block set corresponding to the first-level index;
[0103] The data in the data block set is read, and the read data in the data block set is cached in the memory.
[0104] Further, see Figure 4 As shown, the present application also provides another file reading device, which includes a memory 40 and a processor 41, wherein:
[0105] Memory 40, for storing program instructions;
[0106] The processor 41 is configured to call the program instructions stored in the memory 40 and execute any one of the above method embodiments according to the obtained program.
[0107] Furthermore, the present application provides a computer storage medium, which stores computer-executable instructions. The computer-executable instructions are used to enable the computer to execute any of the above method embodiments.
[0108] To sum up, the file reading method provided by the present application determines the file to be read when receiving a file reading instruction, and determines the first index data corresponding to the file to be read from the memory based on the file to be read; determines the second index data corresponding to the file to be read from the disk based on the first index data corresponding to the file to be read; and reads the file to be read from the disk based on the second index data corresponding to the file to be read.
[0109] By adopting the file reading method provided in this application, the department index file is cached in the memory during the local file initialization process, which reduces the number of IO accesses to the disk and the level of the directory index, thereby improving the local file system access performance.
[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0114] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0115] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application also intends to include such modifications and variations.
Claims
1. A file reading method, characterized in that: The method is applied to a storage server in a distributed storage system, wherein the memory of the storage server stores first index data, and the disk of the storage server stores second index data, and the method includes: Upon receiving a file reading instruction, determining a file to be read, and determining first index data corresponding to the file to be read from the memory according to the file to be read; Determining second index data corresponding to the file to be read from the disk according to the first index data corresponding to the file to be read; Reading the file to be read from the disk according to the second index data corresponding to the file to be read; The method further comprises: When initializing the local file system, determining at least one level of target index data that can be cached in the memory based on the size of the memory and the size of the index data of each level stored in the disk; Obtain the at least one level target index data from the disk and cache the at least one level target index data in the memory, wherein the at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
2. The method according to claim 1, wherein The step of determining at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk includes: Determining a size of the memory available for caching the first index data according to a size of the memory and a preset ratio available for caching the first index data; Based on the size of the index data of each level stored in the disk and the size of the memory that can be used to cache the first index data, determine at least one level of target index data that can be cached in the memory, wherein the size of the at least one level of target index data is less than or equal to the size of the memory that can be used to cache the first index data.
3. The method according to claim 1, wherein The at least one level target index data is the first level index data; The steps of obtaining the at least one first-level target index data from the disk and caching the at least one first-level target index data in the memory include: Traverse the disk node where the root directory is located to obtain the data block set corresponding to the first-level index; The data in the data block set is read, and the read data in the data block set is cached in the memory.
4. A file reading device, characterized in that: The device is applied to a storage server in a distributed storage system, wherein the memory of the storage server stores first index data, and the disk of the storage server stores second index data, and the device includes: a first determining unit, configured to determine a file to be read upon receiving a file reading instruction, and determine first index data corresponding to the file to be read from the memory according to the file to be read; a second determining unit, configured to determine, from the disk, second index data corresponding to the file to be read according to the first index data corresponding to the file to be read; a reading unit, configured to read the file to be read from the disk according to second index data corresponding to the file to be read; The device further comprises: a third determining unit, which, when initializing the local file system, determines at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk; A cache unit is used to obtain the at least one level target index data from the disk and cache the at least one level target index data in the memory, wherein the at least one level target index data is the first index data, and the other level index data in the disk except the at least one level target index data is the second index data.
5. The device according to claim 4, characterized in that When determining at least one level of target index data that can be cached in the memory according to the size of the memory and the size of the index data of each level stored in the disk, the third determining unit is specifically configured to: Determining a size of the memory available for caching the first index data according to a size of the memory and a preset ratio available for caching the first index data; Based on the size of the index data of each level stored in the disk and the size of the memory that can be used to cache the first index data, determine at least one level of target index data that can be cached in the memory, wherein the size of the at least one level of target index data is less than or equal to the size of the memory that can be used to cache the first index data.
6. The device according to claim 4, characterized in that The at least one level target index data is the first level index data; When obtaining the at least one level target index data from the disk and caching the at least one level target index data in the memory, the cache unit is specifically configured to: Traverse the disk node where the root directory is located to obtain the data block set corresponding to the first-level index; The data in the data block set is read, and the read data in the data block set is cached in the memory.
7. A computing device, characterized in that The computing device comprises: a memory for storing program instructions; A processor is configured to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 3 according to the obtained program.
8. A computer storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Efficient metadata memory access method in distributed file system
CN102024020A