US 12,298,934 B2
Method and device for local random readahead of file in distributed file system
Shuaiyang Wang, Suzhou Jiangsu (CN); Wenpeng Li, Suzhou Jiangsu (CN); and Duan Zhang, Suzhou Jiangsu (CN)
Assigned to INSPUR SUZHOU INTELLIGENT TECHNOLOGY CO., LTD., Jiangsu (CN)
Appl. No. 17/928,347
Filed by INSPUR SUZHOU INTELLIGENT TECHNOLOGY CO., LTD., Suzhou Jiangsu (CN)
PCT Filed Jan. 22, 2021, PCT No. PCT/CN2021/073356
§ 371(c)(1), (2) Date Nov. 29, 2022,
PCT Pub. No. WO2021/238252, PCT Pub. Date Dec. 2, 2021.
Claims priority of application No. 202010474760.1 (CN), filed on May 29, 2020.
Prior Publication US 2023/0214354 A1, Jul. 6, 2023
Int. Cl. G06F 16/00 (2019.01); G06F 16/13 (2019.01); G06F 16/182 (2019.01)
CPC G06F 16/134 (2019.01) [G06F 16/182 (2019.01)] 16 Claims
OG exemplary drawing
 
1. A method for local random readahead of a file in a distributed file system, comprising:
creating a readahead structure pointer in an operation handle of a file;
in response to reading of the file, accessing and updating information in the readahead structure pointer, and determining whether the reading is local random reading; and
performing readahead in a case where the reading is local random reading, the number of instances of continuous reading in the updated information is greater than 1, and a current reading position is greater than or equal to a readahead trigger position in the updated information;
wherein the information in the readahead structure pointer comprises: a last reading end position, a last readahead end position, a last readahead size, the number of instances of sequential reading, a data amount of sequential reading, a local random reading window, a maximum readahead size, and the readahead trigger position;
wherein in response to reading of the file, accessing and updating information in the readahead structure pointer comprises:
where a current reading position is the same as the last reading end position, adding 1 to the number of instances of sequential reading, and adding a preset length to the data amount of sequential reading;
wherein in response to reading of the file, determining whether the reading is local random reading comprises:
where the current reading position is different from the last reading end position, determining whether a data amount that differs between a current reading offset and the last reading end position is within one random window, the one random window being the local random reading window; and
in response to where the data amount that differs between the current reading offset and the last reading end position is within the one random window, determining the current reading to be local random reading.