CN109408474B - File creation method and client - Google Patents

File creation method and client Download PDF

Info

Publication number
CN109408474B
CN109408474B CN201811334277.2A CN201811334277A CN109408474B CN 109408474 B CN109408474 B CN 109408474B CN 201811334277 A CN201811334277 A CN 201811334277A CN 109408474 B CN109408474 B CN 109408474B
Authority
CN
China
Prior art keywords
target file
entry corresponding
directory entry
metadata server
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811334277.2A
Other languages
Chinese (zh)
Other versions
CN109408474A (en
Inventor
王帅阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811334277.2A priority Critical patent/CN109408474B/en
Publication of CN109408474A publication Critical patent/CN109408474A/en
Application granted granted Critical
Publication of CN109408474B publication Critical patent/CN109408474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a file creating method and a client, wherein the method comprises the following steps: after a client receives a creation request of a target file, detecting whether a directory item corresponding to the target file exists in a local directory; if the local directory has a directory entry corresponding to the target file, detecting whether the directory entry corresponding to the target file is valid; and if the directory entry corresponding to the target file is invalid, sending a request for creating the target file to a metadata server so that the metadata server can create the target file. By the method, the client and the metadata server only need to interact once to complete file creation. Therefore, the file creating speed is improved, and the consumption of network resources is reduced.

Description

File creation method and client
Technical Field
The present application relates to the field of computer technologies, and in particular, to a file creation method and a client.
Background
In the process of creating a file by a client, the client will firstly check whether the file has already been created, and may determine whether a directory entry corresponding to the file is cached in a local directory by querying, and if so, consider that the file has already been created. However, in some cases, the directory entry in the local directory may be cached incompletely, that is, each file that has been created in the local target is not cached by one directory entry, in this case, for the currently created text, the client does not know whether the file has been created, at this time, the client must send a file query request (lookup request) to the metadata server to determine whether the file has been created, and if not, the file creation is performed again.
Therefore, in the process of creating the file, if the directory entry cache of the local target is incomplete, the client firstly sends a file query request to the metadata server and then sends a file creation request to the metadata server, so that the client and the metadata server need to interact twice to complete file creation, the file creation speed is reduced, and network resources are consumed.
Disclosure of Invention
The embodiment of the present application mainly aims to provide a file creation method and a client, which can not only increase the speed of file creation, but also reduce the consumption of network resources.
The file creation method provided by the embodiment of the application is applied to a client, and comprises the following steps:
after a client receives a creation request of a target file, detecting whether a directory item corresponding to the target file exists in a local directory;
if the local directory has a directory entry corresponding to the target file, detecting whether the directory entry corresponding to the target file is valid;
and if the directory entry corresponding to the target file is invalid, sending a request for creating the target file to a metadata server so that the metadata server can create the target file.
Optionally, after detecting whether a directory entry corresponding to the target file exists in the local directory, the method further includes:
and if the directory entry corresponding to the target file does not exist in the local directory, sending a request for creating the target file to a metadata server so that the metadata server can create the target file.
Optionally, the detecting whether the directory entry corresponding to the target file is valid includes:
judging whether the directory entry corresponding to the target file meets a first condition and a second condition, wherein the first condition is that the directory entry corresponding to the target file is linked with the index node of the target file, and the second condition is that the directory entry corresponding to the target file is not cached overtime;
if yes, determining that the directory entry corresponding to the target file is valid;
if not, determining that the directory entry corresponding to the target file is invalid.
Optionally, after detecting whether the directory entry corresponding to the target file is valid, the method further includes:
and if the directory entry corresponding to the target file is valid, generating a first notification message that the target file is created.
Optionally, after sending the request for creating the target file to the metadata server, the method further includes:
receiving a second notification message returned by the metadata server;
wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
Optionally, after sending the request for creating the target file to the metadata server, the method further includes:
receiving a third notification message returned by the metadata server;
the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
Optionally, after receiving the third notification message returned by the metadata server, the method further includes:
and creating a directory entry corresponding to the target file in the local directory by using the index node information of the target file.
The embodiment of the present application provides a client, where the client includes:
the first detection unit is used for detecting whether a directory entry corresponding to a target file exists in a local directory or not after a client receives a creation request of the target file;
a second detecting unit, configured to detect whether a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file exists in the local directory;
and the first sending request unit is used for sending a request for creating the target file to a metadata server if the directory entry corresponding to the target file is invalid, so that the metadata server creates the target file.
Optionally, the client further includes:
a second sending request unit, configured to send, after detecting whether a directory entry corresponding to the target file exists in a local directory, a request for creating the target file to a metadata server if the directory entry corresponding to the target file does not exist in the local directory, so that the metadata server creates the target file.
Optionally, the second detecting unit includes:
a determining subunit, configured to determine whether a directory entry corresponding to the target file meets a first condition and a second condition, where the first condition is that the directory entry corresponding to the target file is linked with an index node of the target file, and the second condition is that the directory entry corresponding to the target file is not cached overtime;
a determining subunit, configured to determine that a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file satisfies a first condition and a second condition; and if the directory entry corresponding to the target file does not meet the first condition and the second condition, determining that the directory entry corresponding to the target file is invalid.
Optionally, the client further includes:
and the message generating unit is used for generating a first notification message that the target file is created if the directory entry corresponding to the target file is valid after detecting whether the directory entry corresponding to the target file is valid.
Optionally, the client further includes:
the second message receiving unit is used for receiving a second notification message returned by the metadata server after sending the request for creating the target file to the metadata server; wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
Optionally, the client further includes:
a third message receiving unit, configured to receive a third notification message returned by the metadata server after sending the request for creating the target file to the metadata server; the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
Optionally, the client further includes:
and the directory entry creating unit is used for creating a directory entry corresponding to the target file in the local directory by using the index node information of the target file after receiving the third notification message returned by the metadata server.
Therefore, the embodiment of the application has the following beneficial effects:
according to the file creation method and the client, after the client receives a creation request of a target file, the client detects a local directory of the client. Namely: the client detects whether a directory entry corresponding to the target file exists in a local directory of the client, and if the directory entry corresponding to the target file exists in the local directory, the client detects whether the directory entry corresponding to the target file is valid. When the client detects the directory entry corresponding to the target file of the client and determines that the directory entry is invalid, the client sends a request for creating the target file to the metadata server so that the metadata server can create the target file. Therefore, when the client detects the local directory of the client and determines that the directory entry corresponding to the target file is invalid, the client sends a request for creating the target file to the metadata server, so that the metadata server creates the target file. Therefore, the client and the metadata server only need to interact once to complete file creation. Therefore, the file creating speed is improved, and the consumption of network resources is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a file creating method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another file creation method according to an embodiment of the present application;
fig. 3 is a schematic composition diagram of a client according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The scheme of the embodiment of the application can be applied to a file creation scene of a distributed file system.
In a distributed file system, in order to facilitate a client to perform a retrieval operation on a file in a metadata server, a local directory corresponding to the file in the metadata server is cached in the client. The local directory should include directory entries (entries) corresponding to all files in the metadata server, where a directory entry corresponding to a file is an entry corresponding to the file and composed of basic information such as a file name, a physical address, and a file creation time of the file. However, in an actual scenario, since the number of files stored in the metadata server may reach as many as tens of thousands, and the cache resource of the client is limited, a situation that the cache of the target entry in the local directory of the client is incomplete often occurs, that is, all created files in the metadata server are not cached in the local directory of the client correspondingly for one directory entry.
In the process of creating a file by a client, the client will firstly check whether the file has already been created, and may determine whether a directory entry corresponding to the file is cached in a local directory by querying, and if so, consider that the file has already been created. However, if the target entry cache in the local directory of the client is incomplete, the client does not know whether the file has been created for the currently created text, and at this time, the client must send a file query request (lookup request) to the metadata server to determine whether the file has been created, and if not, then create the file.
Therefore, in the process of creating the file, if the target item cache of the local target is incomplete, the client firstly sends a file query request to the metadata server and then sends a file creation request to the metadata server, so that the client and the metadata server need to interact twice to complete file creation, the file creation speed is reduced, and network resources are consumed.
Based on the problems in the prior art, the embodiments of the present application provide a method for creating a file, so as to solve the problems in the prior art.
Example one
Referring to fig. 1, the figure shows a flowchart of a file creation method provided in an embodiment of the present application, where the embodiment may be used for a client, and includes the following steps S101 to S103:
s101: and after the client receives the creation request of the target file, detecting whether a directory entry corresponding to the target file exists in the local directory.
In this embodiment, when a user needs to create a certain file, the file is used as a target file, and the user can input a creation request of the target file to the client. After receiving the creation request of the target file, the client may preliminarily determine whether the target file has been created in the metadata server. That is, the client may detect whether a directory entry corresponding to the target file exists in its local directory.
S102: and if the local directory has the directory entry corresponding to the target file, detecting whether the directory entry corresponding to the target file is valid.
In this embodiment, if the client detects that the directory entry corresponding to the target file exists in the local directory, the client needs to determine whether the target file cache corresponding to the directory entry exists, so that the client may further detect whether the directory entry corresponding to the target file is valid.
S103: and if the directory entry corresponding to the target file is invalid, sending a request for creating the target file to a metadata server so that the metadata server can create the target file.
In this embodiment, if the client detects that the directory entry corresponding to the target file is invalid, it indicates that the cache target file corresponding to the directory entry does not exist. Thus, the client may send a request to the metadata server to create a target file in order for the metadata server to create the target file.
To sum up, in the file creating method provided in the embodiment of the present application, after the client receives a creating request of the target file, the client first detects its own local directory. Namely: the client detects whether a directory entry corresponding to the target file exists in a local directory of the client, and if the directory entry corresponding to the target file exists in the local directory, the client detects whether the directory entry corresponding to the target file is valid. When the client detects the directory entry corresponding to the target file of the client and determines that the directory entry is invalid, the client sends a request for creating the target file to the metadata server so that the metadata server can create the target file. Therefore, when the client detects the local directory of the client and determines that the directory entry corresponding to the target file is invalid, the client sends a request for creating the target file to the metadata server, so that the metadata server creates the target file. Therefore, the client and the metadata server only need to interact once to complete file creation. Therefore, the file creating speed is improved, and the consumption of network resources is reduced.
Example two
Referring to fig. 2, the flowchart illustrates another file creation method provided in an embodiment of the present application, which may be used for a client in a distributed file system, and includes the following steps S201 to S207:
s201: after receiving a creation request of a target file, a client detects whether a directory entry corresponding to the target file exists in a local directory, if so, step S202 is executed, and if not, step S203 is executed.
In this embodiment, after receiving a request for creating a target file input by a user, the client may detect whether a directory entry corresponding to the target file exists in the local directory to determine whether the target file has been created in the metadata server. If yes, go to step S202, otherwise go to step S203.
S202: and judging whether the directory entry corresponding to the target file meets a first condition and a second condition, wherein the first condition is that the directory entry corresponding to the target file is linked with the index node of the target file, and the second condition is that the target entry corresponding to the target file is not cached overtime, if so, executing the steps S204-S205, and if not, executing the step S206.
In this embodiment, as described above, after it is detected that the directory entry corresponding to the target file exists in the local directory, it may be detected whether the directory entry corresponding to the target file is valid.
In an implementation manner of the embodiment of the present application, a method for detecting whether a directory entry corresponding to a target file is valid may be: judging whether the directory entry corresponding to the target file meets a first condition and a second condition, wherein the first condition is that the directory entry corresponding to the target file is linked with the index node of the target file, and the second condition is that the target entry corresponding to the target file is not cached overtime. If yes, steps S204-S205 are executed, otherwise, step S206 is executed.
In this embodiment, if the directory entry corresponding to the target file is valid, two conditions need to be satisfied at the same time, and the first condition is that the directory entry corresponding to the target file needs to be linked with the inode of the target file. In an actual scenario, each file has an index node (inode) for locating the file, which includes organization and management information of the file, and only the directory entry corresponding to the file is linked with the index node of the file, so that the directory entry corresponding to the file can be linked to the index node of the file by clicking the directory entry corresponding to the file, and then a specific storage location of the file can be located, and operations such as opening the file are completed. Therefore, it is necessary to determine whether the directory entry corresponding to the target file is linked with the inode of the target file to determine that the directory entry corresponding to the target file is valid. In addition, the second condition is that the target item corresponding to the target file is not cached overtime. This is because in a practical scenario, directory entries cached at the client have time-sensitive limitations. Therefore, it is necessary to determine whether the target entry corresponding to the target file is cached overtime to determine that the directory entry corresponding to the target file is valid. Determining whether the directory entry corresponding to the target file satisfies the first condition and the second condition at the same time, if yes, performing steps S204-S205, and if no, performing step S206.
S203: sending a request to a metadata server to create the target file, such that the metadata server creates the target file.
In an implementation manner of the embodiment of the present application, after detecting whether a directory entry corresponding to the target file exists in a local directory, if the directory entry corresponding to the target file does not exist in the local directory, a request for creating the target file is sent to a metadata server, so that the metadata server creates the target file.
In this embodiment, if it is detected that there is no directory entry corresponding to the target file in the local directory, two cases causing the result are: the first case is that no target file is created in the metadata server; the second situation is that the directory entry cache of the client local directory is incomplete, and the directory entry of the target file is not cached in the local directory. For either of the two scenarios, the client sends a request to the metadata server to create the target file. If the target file is not created in the metadata server, the client sends a request for creating the target file to the metadata server, so that the metadata server can create the target file conveniently.
S204: and determining that the directory entry corresponding to the target file is valid.
In this embodiment, when it is determined that the directory entry corresponding to the target file satisfies the first condition and the second condition at the same time, it may be determined that the directory entry corresponding to the target file is valid.
S205: a first notification message that the target file has been created is generated.
In an implementation manner of this embodiment, after detecting whether a directory entry corresponding to a target file is valid, the method further includes: and if the directory entry corresponding to the target file is valid, generating a first notification message that the target file is already created.
In this embodiment, if it is determined that the directory entry corresponding to the target file is valid, that is, it may be determined that the target file has been created in the metadata server, the client may generate a first notification message for notifying the user that the target file has been created.
In a specific implementation scenario, a first notification message generated by a client may be sent to an upper layer application, and the upper layer application notifies a user of the first notification message. The upper layer application may be a function module on the upper layer of the function module for determining validity of the directory entry corresponding to the target file, and is used for interacting with a user.
S206: determining that the directory entry corresponding to the target file is invalid, and executing step S203.
In this embodiment, when it is determined that the directory entry corresponding to the target file does not satisfy the first condition and the second condition at the same time, it may be determined that the directory entry corresponding to the target file is invalid. In this case, step S203 is executed as described in step S103 in the first embodiment.
In an implementation manner of the embodiment of the present application, after sending the request for creating the target file to the metadata server, the method further includes: receiving a second notification message returned by the metadata server;
wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
In this embodiment, the client sends the request for creating the target file to the metadata server in two scenarios, where the first scenario is that the client detects that there is no directory entry corresponding to the target file in the local directory; the second situation is that the client detects that the directory entry corresponding to the target file in the local directory is invalid. The first scenario is caused by two situations, namely that no target file is created in the metadata server; the second situation is that the directory entry cache of the client local directory is incomplete, and the directory entry of the target file is not cached in the local directory. The problem that the client detects that the directory entry corresponding to the target file does not exist in the local directory due to incomplete cache of the directory entry of the local directory when the target file is already created in the metadata server and then sends a request for creating the target file to the metadata server is solved. Therefore, after the client sends a request for creating the target file to the metadata server, the metadata server receives the request for creating the target file sent by the client and inquires whether the target file is created in all files of the metadata server, if the target file is inquired to be created, the metadata server generates a second notification message and sends the second notification message to the client, and the client receives the second notification message sent by the metadata server. Wherein the second notification message is a notification message for notifying the client that the target file has been created.
In an implementation manner of the embodiment of the present application, after sending the request for creating the target file to the metadata server, the method further includes: receiving a third notification message returned by the metadata server;
the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
In this embodiment, after the client sends a request for creating a target file to the metadata server, the metadata server receives the request for creating the target file sent by the client, and queries whether the target file has been created in all files of the metadata server, if it is queried that the target file has not been created, the metadata server creates the target file, generates a third notification message after creation is completed, sends the third notification message to the client, and the client receives the third notification message sent by the metadata server. And the third notification message comprises index node information of the target file.
In an implementation manner of the embodiment of the present application, after receiving the third notification message returned by the metadata server, the method further includes: and creating a target item corresponding to the target file in the local directory by using the index node information of the target file.
In this embodiment, after the client receives the third notification message sent by the metadata server, the target item corresponding to the target file may be created in the local directory by using the index node information of the target file included in the third notification message, so as to perfect the local directory of the client.
To sum up, in the file creating method provided in the embodiment of the present application, after receiving a creating request for a target file, a client first detects whether a directory entry corresponding to the target file exists in a local directory of the client, and if the directory entry corresponding to the target file does not exist in the local directory, the client sends a request for creating the target file to a metadata server; if the directory entry corresponding to the target file exists in the local directory, whether the directory entry corresponding to the target file is valid is detected, and if the directory entry corresponding to the target file is determined to be invalid, the client sends a request for creating the target file to the metadata server so that the metadata server can create the target file. Therefore, when the client determines that the directory entry corresponding to the target file does not exist in the local directory or the directory entry corresponding to the target file is invalid, the client sends a request for creating the target file to the metadata server, so that the metadata server creates the target file. Therefore, the client and the metadata server only need to interact once to complete file creation. Therefore, the file creating speed is improved, and the consumption of network resources is reduced.
EXAMPLE III
Referring to fig. 3, a schematic diagram of a client is shown, the client comprising:
a first detecting unit 301, configured to detect whether a directory entry corresponding to a target file exists in a local directory after a client receives a creation request of the target file;
a second detecting unit 302, configured to detect whether a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file exists in the local directory;
a first sending request unit 303, configured to send a request for creating the target file to a metadata server if the directory entry corresponding to the target file is invalid, so that the metadata server creates the target file.
In an implementation manner provided in this embodiment, the client further includes:
a second sending request unit, configured to send, after detecting whether a directory entry corresponding to the target file exists in a local directory, a request for creating the target file to a metadata server if the directory entry corresponding to the target file does not exist in the local directory, so that the metadata server creates the target file.
In an implementation manner provided in this embodiment, the second detecting unit includes:
a determining subunit, configured to determine whether a directory entry corresponding to the target file meets a first condition and a second condition, where the first condition is that the directory entry corresponding to the target file is linked with an index node of the target file, and the second condition is that the directory entry corresponding to the target file is not cached overtime;
a determining subunit, configured to determine that a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file satisfies a first condition and a second condition; and if the directory entry corresponding to the target file does not meet the first condition and the second condition, determining that the directory entry corresponding to the target file is invalid.
In an implementation manner provided in this embodiment, the client further includes:
and the message generating unit is used for generating a first notification message that the target file is created if the directory entry corresponding to the target file is valid after detecting whether the directory entry corresponding to the target file is valid.
In an implementation manner provided in this embodiment, the client further includes:
the second message receiving unit is used for receiving a second notification message returned by the metadata server after sending the request for creating the target file to the metadata server; wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
In an implementation manner provided in this embodiment, the client further includes:
a third message receiving unit, configured to receive a third notification message returned by the metadata server after sending the request for creating the target file to the metadata server; the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
In an implementation manner provided in this embodiment, the client further includes:
and the directory entry creating unit is used for creating a directory entry corresponding to the target file in the local directory by using the index node information of the target file after receiving the third notification message returned by the metadata server.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A file creation method is applied to a client, and is characterized in that
The method comprises the following steps:
after a client receives a creation request of a target file, detecting whether a directory item corresponding to the target file exists in a local directory;
if the local directory has a directory entry corresponding to the target file, detecting whether the directory entry corresponding to the target file is valid; the detecting whether the directory entry corresponding to the target file is valid includes:
judging whether the directory entry corresponding to the target file meets a first condition and a second condition, wherein the first condition is that the directory entry corresponding to the target file is linked with the index node of the target file, and the second condition is that the directory entry corresponding to the target file is not cached overtime;
if yes, determining that the directory entry corresponding to the target file is valid;
if not, determining that the directory entry corresponding to the target file is invalid;
and if the directory entry corresponding to the target file is invalid, sending a request for creating the target file to a metadata server so that the metadata server can create the target file.
2. The method according to claim 1, wherein after detecting whether a directory entry corresponding to the target file exists in the local directory, the method further comprises:
and if the directory entry corresponding to the target file does not exist in the local directory, sending a request for creating the target file to a metadata server so that the metadata server can create the target file.
3. The method according to claim 1, wherein after detecting whether the directory entry corresponding to the target file is valid, the method further comprises:
and if the directory entry corresponding to the target file is valid, generating a first notification message that the target file is created.
4. The method according to any one of claims 1 to 3, wherein after sending the request for creating the target file to the metadata server, further comprising:
receiving a second notification message returned by the metadata server;
wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
5. The method according to any one of claims 1 to 3, wherein after sending the request for creating the target file to the metadata server, further comprising:
receiving a third notification message returned by the metadata server;
the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
6. The method according to claim 5, wherein after receiving the third notification message returned by the metadata server, further comprising:
and creating a directory entry corresponding to the target file in the local directory by using the index node information of the target file.
7. A client, the client comprising:
the first detection unit is used for detecting whether a directory entry corresponding to a target file exists in a local directory or not after a client receives a creation request of the target file;
a second detecting unit, configured to detect whether a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file exists in the local directory; the second detection unit includes:
a determining subunit, configured to determine whether a directory entry corresponding to the target file meets a first condition and a second condition, where the first condition is that the directory entry corresponding to the target file is linked with an index node of the target file, and the second condition is that the directory entry corresponding to the target file is not cached overtime;
a determining subunit, configured to determine that a directory entry corresponding to the target file is valid if the directory entry corresponding to the target file satisfies a first condition and a second condition; if the directory entry corresponding to the target file does not meet the first condition and the second condition, determining that the directory entry corresponding to the target file is invalid;
and the first sending request unit is used for sending a request for creating the target file to a metadata server if the directory entry corresponding to the target file is invalid, so that the metadata server creates the target file.
8. The client of claim 7, further comprising:
a second sending request unit, configured to send, after detecting whether a directory entry corresponding to the target file exists in a local directory, a request for creating the target file to a metadata server if the directory entry corresponding to the target file does not exist in the local directory, so that the metadata server creates the target file.
9. The client of claim 7, further comprising:
and the message generating unit is used for generating a first notification message that the target file is created if the directory entry corresponding to the target file is valid after detecting whether the directory entry corresponding to the target file is valid.
10. The client according to any one of claims 7 to 9, wherein the client further comprises:
the second message receiving unit is used for receiving a second notification message returned by the metadata server after sending the request for creating the target file to the metadata server; wherein the second notification message is sent by the metadata server after querying that the target file has been created, and the second notification message is a notification message that the target file has been created.
11. The client according to any one of claims 7 to 9, wherein the client further comprises:
a third message receiving unit, configured to receive a third notification message returned by the metadata server after sending the request for creating the target file to the metadata server; the third notification message is sent by the metadata server after inquiring that the target file is not created and the target file is successfully created, and the third notification message includes the index node information of the target file.
12. The client of claim 11, further comprising:
and the directory entry creating unit is used for creating a directory entry corresponding to the target file in the local directory by using the index node information of the target file after receiving the third notification message returned by the metadata server.
CN201811334277.2A 2018-11-09 2018-11-09 File creation method and client Active CN109408474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811334277.2A CN109408474B (en) 2018-11-09 2018-11-09 File creation method and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811334277.2A CN109408474B (en) 2018-11-09 2018-11-09 File creation method and client

Publications (2)

Publication Number Publication Date
CN109408474A CN109408474A (en) 2019-03-01
CN109408474B true CN109408474B (en) 2021-11-19

Family

ID=65472446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811334277.2A Active CN109408474B (en) 2018-11-09 2018-11-09 File creation method and client

Country Status (1)

Country Link
CN (1) CN109408474B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046001B (en) * 2019-12-28 2023-03-14 浪潮电子信息产业股份有限公司 Method, device and equipment for creating files in batch and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150394A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Distributed file system metadata management method facing to high-performance calculation
CN103179185A (en) * 2012-12-25 2013-06-26 中国科学院计算技术研究所 Method and system for creating files in cache of distributed file system client
CN104021137A (en) * 2014-04-21 2014-09-03 中国科学院计算技术研究所 Method and system for opening and closing file locally through client side based on catalogue authorization
CN104516967A (en) * 2014-12-25 2015-04-15 国家电网公司 Electric power system mass data management system and use method thereof
CN104753966A (en) * 2013-12-25 2015-07-01 明博教育科技有限公司 Resource file inquiry method and system based on server and client caches
CN107197050A (en) * 2017-07-27 2017-09-22 郑州云海信息技术有限公司 The method and system that file writes in a kind of distributed memory system
CN108241710A (en) * 2016-12-27 2018-07-03 中移(苏州)软件技术有限公司 A kind of file creating method, device and file polling method, apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9870368B2 (en) * 2014-10-27 2018-01-16 Cohesity, Inc. Concurrent access and transactions in a distributed file system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179185A (en) * 2012-12-25 2013-06-26 中国科学院计算技术研究所 Method and system for creating files in cache of distributed file system client
CN103150394A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Distributed file system metadata management method facing to high-performance calculation
CN104753966A (en) * 2013-12-25 2015-07-01 明博教育科技有限公司 Resource file inquiry method and system based on server and client caches
CN104021137A (en) * 2014-04-21 2014-09-03 中国科学院计算技术研究所 Method and system for opening and closing file locally through client side based on catalogue authorization
CN104516967A (en) * 2014-12-25 2015-04-15 国家电网公司 Electric power system mass data management system and use method thereof
CN108241710A (en) * 2016-12-27 2018-07-03 中移(苏州)软件技术有限公司 A kind of file creating method, device and file polling method, apparatus
CN107197050A (en) * 2017-07-27 2017-09-22 郑州云海信息技术有限公司 The method and system that file writes in a kind of distributed memory system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Pmfs中目录项索引的实现;杨顺 等;《计算机应用》;20170510;第37卷(第5期);全文 *
Poster: Distributed Metadata Management for Exascale Parallel File System;Keiji Yamamoto et al.;《IEEE Xplore》;20130411;全文 *

Also Published As

Publication number Publication date
CN109408474A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
US10250526B2 (en) Method and apparatus for increasing subresource loading speed
US11586506B2 (en) System and method for indexing image backups
US10489476B2 (en) Methods and devices for preloading webpages
RU2494554C2 (en) Targeted queries using oma dm protocol
RU2436152C2 (en) Significant changes search notifications
EP2579167A1 (en) Method for active information push and server therefor
JP6266588B2 (en) Synchronizing local and remote data
CN107147748B (en) File uploading method and device
US20150127838A1 (en) Page Operation Processing Method and Apparatus, and Terminal
CN109558378A (en) File management method, device, equipment and storage medium
CN105354195B (en) Information searching method and device
CN110795395A (en) File deployment system and file deployment method
CN112182014A (en) Database query method, device, equipment and storage medium
CN114328029B (en) Backup method and device of application resources, electronic equipment and storage medium
KR102114532B1 (en) Information operation
CN111382206B (en) Data storage method and device
CN109408474B (en) File creation method and client
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
US11205049B2 (en) Method for managing semantic information on M2M/IoT platform
CN101626365A (en) Directory server and system and method for realizing LDAP extended operation
CN115129733A (en) Method, device and equipment for recording and inquiring bank data change history
JP2005190221A (en) Cache control unit, its method, and computer program
CN107154927A (en) Message processing method and device
CN102402614B (en) Cross-domain data analysis method and system for directory service
CN102236665A (en) Page loading method and page loading device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant