CN109117387A - A kind of management method, system and the associated component of inode spatial cache - Google Patents

A kind of management method, system and the associated component of inode spatial cache Download PDF

Info

Publication number
CN109117387A
CN109117387A CN201810934963.7A CN201810934963A CN109117387A CN 109117387 A CN109117387 A CN 109117387A CN 201810934963 A CN201810934963 A CN 201810934963A CN 109117387 A CN109117387 A CN 109117387A
Authority
CN
China
Prior art keywords
inode
caching
spatial cache
file destination
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.)
Granted
Application number
CN201810934963.7A
Other languages
Chinese (zh)
Other versions
CN109117387B (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 CN201810934963.7A priority Critical patent/CN109117387B/en
Publication of CN109117387A publication Critical patent/CN109117387A/en
Application granted granted Critical
Publication of CN109117387B publication Critical patent/CN109117387B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes

Abstract

This application discloses a kind of management methods of inode spatial cache, the management method includes when detecting that file destination is closed, the state of the corresponding inode caching of file destination described in caching is set ageing state by client, and records the duration that the inode caching is in the ageing state;Judge whether the duration is greater than preset value;If so, the inode caching in the client is discharged, so that server-side discharges spatial cache corresponding with inode caching.This method can rationally recycle inode spatial cache and save hardware cost.Disclosed herein as well is a kind of management system of inode spatial cache, a kind of computer readable storage medium and a kind of electronic equipment, have the above beneficial effect.

Description

A kind of management method, system and the associated component of inode spatial cache
Technical field
The present invention relates to data storage management field, in particular to a kind of management method of inode spatial cache, system, A kind of computer readable storage medium and a kind of electronic equipment.
Background technique
When the interaction of the Metadata Service of client and server, inode (index node) that client operates needs It is loaded into the caching of itself, after Metadata Service gets inode data, related inode is also loaded into metadata cache In.But now client after inode end of operation (such as open a file, modify save after close it), still can Hold the inode, the permission of modification only operated to the inode, but not here cleans up inode caching in client. Such benefit can directly have the inode in caching when being access next time, access speed can be fast.But this leads to server-side Also hold the inode in metadata cache always.When the Metadata Service of a server-side docks multiple client, Mei Geke The caching at family end itself may the system of not transfiniting, but the caching inode of Metadata Service is then more and more, all can not always It is cut, there are problems that Metadata Service caches overfill.Get off for a long time, caching is all the more bigger, and hardware cost is high.
Therefore, how rationally recycling inode spatial cache and saving hardware cost is that those skilled in the art need to solve at present Certainly the technical issues of.
Summary of the invention
The purpose of the application is to provide the management method, system, a kind of computer-readable storage of a kind of inode spatial cache Medium and a kind of electronic equipment can rationally recycle inode spatial cache and save hardware cost.
In order to solve the above technical problems, the application provides a kind of management method of inode spatial cache, the management method packet It includes:
When detecting that file destination is closed, shape that client caches the corresponding inode of file destination described in caching State is set as ageing state, and records the duration that the inode caching is in the ageing state;
Judge whether the duration is greater than preset value;
If so, the inode caching in the client is discharged, so that server-side release is cached with the inode Corresponding spatial cache.
Optionally, before detecting that file destination is closed, further includes:
The client opens the file destination, and the inode information of the file destination is loaded onto caching and is obtained The inode caching.
Optionally, after discharging the inode caching in the client, further includes:
To the server-side send caching release information, so as to the server-side according to the caching discharge information release and The inode caches corresponding spatial cache.
Optionally, the server-side is specially metadata server cluster.
Optionally, the duration is specially 10 minutes.
Optionally, further includes:
The spatial cache state of the server-side is obtained, and the preset value is adjusted according to the spatial cache state.
Present invention also provides a kind of management system of inode spatial cache, which includes:
Aging timing module, for when detect file destination close when, file destination described in caching is corresponding The state of inode caching is set as ageing state, and records the duration that the inode caching is in the ageing state;
Judgment module, for judging whether the duration is greater than preset value;
Release module is cached, for discharging the institute in the client when the duration being greater than the preset value Inode caching is stated, so that server-side discharges spatial cache corresponding with inode caching.
Optionally, further includes:
Loading module is cached, the file destination is opened for the client, by the inode information of the file destination It is loaded onto caching and obtains the inode caching.
Present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, the computer Program realizes the step of management method of above-mentioned inode spatial cache executes when executing.
Present invention also provides a kind of electronic equipment, including memory and processor, calculating is stored in the memory Machine program, the processor realize the manager of above-mentioned inode spatial cache when calling the computer program in the memory The step of method executes.
The present invention provides a kind of management methods of inode spatial cache, including when detecting that file destination is closed, visitor The state of the corresponding inode caching of file destination described in caching is set ageing state by family end, and it is slow to record the inode Deposit the duration in the ageing state;Judge whether the duration is greater than preset value;If so, discharging the visitor Inode caching in the end of family, so that server-side discharges spatial cache corresponding with inode caching.
The application is when closing file destination, by the status indication in client with the inode of file destination caching For ageing state, and timing is carried out to the file destination cached there are the inode of ageing state, when inode caching is continuously in When the time of ageing state is more than preset duration, then the inode caching in client is discharged.Due to Metadata Service mechanism Requirement, when inode caching is written in client, the identical inode caching that can be also written in server-side, and if client Inside there is inode buffer service end just must hold identical inode caching.The application is by surpassing the time in ageing state The inode caching release for crossing preset duration, realizes client and periodically trims spatial cache, can guarantee to be cached when server-side The inode that client release can be discharged when slow caches corresponding spatial cache.The application can rationally recycle inode caching Space-saving hardware cost.It is computer-readable that the application additionally provides a kind of management system of inode spatial cache, one kind simultaneously Storage medium and a kind of electronic equipment have above-mentioned beneficial effect, and details are not described herein.
Detailed description of the invention
In ord to more clearly illustrate embodiments of the present application, attached drawing needed in the embodiment will be done simply below It introduces, it should be apparent that, the drawings in the following description are only some examples of the present application, for ordinary skill people For member, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of the management method of inode spatial cache provided by the embodiment of the present application;
Fig. 2 is the flow chart of the management method of another kind inode spatial cache provided by the embodiment of the present application;
Fig. 3 is a kind of structural schematic diagram of the management system of inode spatial cache provided by the embodiment of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Below referring to Figure 1, Fig. 1 is a kind of management method of inode spatial cache provided by the embodiment of the present application Flow chart.
Specific steps may include:
S101: when detecting that file destination is closed, client caches the corresponding inode of file destination described in caching State be set as ageing state, and record the duration that inode caching is in the ageing state;
Wherein, the present embodiment is the recovery method of inode caching when interacting for client with Metadata Service, works as client When the end certain inode of load are cached into the caching of client, identical inode can also be cached and is loaded onto server-side by server-side Caching in, and if client hold always the inode caching, for being consistent property, server-side also must unanimously hold this Caching is until client discharges the caching.
When client opens file destination, the corresponding inode of file destination can be cached into client-cache space, That is inode caching.After file destination is closed, client will continue to hold inode caching, can be with when to access next time Directly there is the inode in the buffer, access speed is very fast.This step is when file destination is closed, the text of target described in caching The state of the corresponding inode caching of part is set as ageing state, and meaning herein, which is to cache inode, stamps a label, After recording file destination closing, the corresponding inode of file destination caches the existing time.
It is understood that setting ageing state for the inode state cached is used only for flag state, have no effect on It is directly cached using the inode in caching when access next time.Specifically, can be by adding one section of word in inode is cached Symbol is for marking the inode to be in ageing state.
Refer in the duration of the ageing state from pass it should be noted that recording inode caching in this step The time between time and current time after closing file destination, file destination is by again during duration record It opens, then inode caching is not at ageing state and stops the timing of duration, then when file destination is closed again Again the calculating prolongeding time since 0.For example, 12:00 file destination is closed, the shape that the inode of file destination is cached at this time State is set as ageing state, and starts timing, under the premise of not reaching the preset value mentioned in S102, if 12:20 target File is opened again, then the ageing state of the inode caching of file destination is eliminated at this time, and stops timing;Work as target File 12:30 is closed again, then sets ageing state for the state of the corresponding inode caching of file destination, and again The duration that the inode caching is in the ageing state is recorded, if file destination does not have in 12:30 to during 12:40 It is opened again, then the duration recorded in 12:40 is 10 minutes, and is not 30 minutes.
S102: judge whether the duration is greater than preset value;If so, into S103;If it is not, then terminating process;
Wherein, ageing state is set in S101 and the purpose for recording ageing state duration is that, when aging shape After the state corresponding duration reaches default, corresponding inode is cached and is discharged.The preset value is the value about the time, in advance If the specific value of value does not limit here, such as can be 10 minutes.
S103: the inode caching in the client is discharged, so as to server-side release and inode caching pair The spatial cache answered.
Wherein, this step is established in S102 it is determined that be under the premise of taking time to have been above preset value, client this When can discharge file destination corresponding inode caching.
It should be noted that server-side can not release immediately identical after client discharges inode caching Inode caching can be found in client when server-side caches overfill to client back-pressure requirement release caching without being somebody's turn to do Inode caching, then server-side release inode is cached.Release caching is required to client back-pressure when slow since server-side is cached It is the customary means of the prior art, therefore the present embodiment can be realized as server-side by dischargeing the inode caching of client The inode held caches reduced purpose.Server-side can be metadata server cluster.
The present embodiment is when closing file destination, by the state mark in client with the inode of file destination caching It is denoted as ageing state, and timing is carried out to the file destination cached there are the inode of ageing state, when inode caches lasting place When the time of ageing state being more than preset duration, then the inode caching in client is discharged.Due to Metadata Service machine The requirement of system, when inode caching is written in client, the identical inode caching that can be also written in server-side, and if client End memory must just hold identical inode caching at inode buffer service end.The present embodiment by will in ageing state when Between be more than that the inode of preset duration caches release, realize client and periodically trim spatial cache, can guarantee when server-side is slow The inode that client release can be discharged when depositing slow caches corresponding spatial cache.The present embodiment can rationally recycle clothes The spatial cache at business end, saves hardware cost.
Fig. 2 is referred to below, and Fig. 2 is the management method of another kind inode spatial cache provided by the embodiment of the present application Flow chart.
Specific steps may include:
S201: the client opens the file destination, and the inode information of the file destination is loaded onto caching Obtain the inode caching.
Wherein, the subject of implementation of the present embodiment is client, and when client load inode caching, server-side can also add Carry inode caching.
S202: when detecting that file destination is closed, client caches the corresponding inode of file destination described in caching State be set as ageing state, and record the duration that inode caching is in the ageing state;
S203: judge whether the duration is greater than preset value;If so, into S204;If it is not, then terminating process;
Wherein, as a preferred embodiment, may exist following operation: obtaining the spatial cache of the server-side State, and the preset value is adjusted according to the spatial cache state.When the spatial cache state of server-side is remaining cache mistake When few, then preset value can suitably be turned down, to accelerate to discharge the speed of inode.
S204: the inode caching in the client is discharged;
S205: caching release information is sent to the server-side, so that the server-side discharges information according to the caching Discharge spatial cache corresponding with inode caching.
As a preferred embodiment, can be actively to server-side after client discharges inode spatial cache Information is discharged when sending caching, so that the server-side is corresponding with inode caching according to caching release information release Spatial cache.
Fig. 3 is referred to, Fig. 3 is a kind of structure of the management system of inode spatial cache provided by the embodiment of the present application Schematic diagram;
The management system may include:
Aging timing module 100, for when detect file destination close when, file destination described in caching is corresponding The state of inode caching is set as ageing state, and records the duration that the inode caching is in the ageing state;
Judgment module 200, for judging whether the duration is greater than preset value;
Release module 300 is cached, for discharging in the client when the duration being greater than the preset value The inode caching, so that server-side discharges spatial cache corresponding with inode caching.
Further, the management system further include:
Loading module is cached, the file destination is opened for the client, by the inode information of the file destination It is loaded onto caching and obtains the inode caching.
Further, the management system further include:
Caching release information sending module, for sending caching release information to the server-side, so as to the server-side Information, which is discharged, according to the caching discharges spatial cache corresponding with inode caching.
Further, the server-side is specially metadata server cluster.
Further, the duration is specially 10 minutes.
Further, the management system further include:
Time regulating module, for obtaining the spatial cache state of the server-side, and according to the spatial cache state Adjust the preset value.
Since the embodiment of components of system as directed is corresponded to each other with the embodiment of method part, the embodiment of components of system as directed is asked Referring to the description of the embodiment of method part, wouldn't repeat here.
The present embodiment is when closing file destination, by the state mark in client with the inode of file destination caching It is denoted as ageing state, and timing is carried out to the file destination cached there are the inode of ageing state, when inode caches lasting place When the time of ageing state being more than preset duration, then the inode caching in client is discharged.Due to Metadata Service machine The requirement of system, when inode caching is written in client, the identical inode caching that can be also written in server-side, and if client End memory must just hold identical inode caching at inode buffer service end.The present embodiment by will in ageing state when Between be more than that the inode of preset duration caches release, realize client and periodically trim spatial cache, can guarantee when server-side is slow The inode that client release can be discharged when depositing slow caches corresponding spatial cache.The present embodiment can rationally recycle clothes The spatial cache at business end, saves hardware cost.
Present invention also provides a kind of computer readable storage mediums, have computer program thereon, the computer program It is performed and step provided by above-described embodiment may be implemented.The storage medium may include: USB flash disk, mobile hard disk, read-only deposit Reservoir (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or The various media that can store program code such as CD.
Present invention also provides a kind of electronic equipment, may include memory and processor, have meter in the memory Calculation machine program may be implemented provided by above-described embodiment when the processor calls the computer program in the memory Step.Certain electronic equipment can also include various network interfaces, the components such as power supply.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration ?.It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.Under the situation not limited more, the element limited by sentence "including a ..." is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.

Claims (10)

1. a kind of management method of inode spatial cache characterized by comprising
When detecting that file destination is closed, client sets the corresponding inode of file destination described in the caching state cached It is set to ageing state, and records the duration that the inode caching is in the ageing state;
Judge whether the duration is greater than preset value;
If so, the inode caching in the client is discharged, so that server-side release is corresponding with inode caching Spatial cache.
2. management method according to claim 1, which is characterized in that before detecting that file destination is closed, further includes:
The client opens the file destination, the inode information of the file destination is loaded onto caching described in obtaining Inode caching.
3. management method according to claim 1, which is characterized in that discharging the inode caching in the client Later, further includes:
To the server-side send caching release information, so as to the server-side according to the caching discharge information discharge with it is described Inode caches corresponding spatial cache.
4. management method according to claim 1, which is characterized in that the server-side is specially metadata server cluster.
5. management method according to claim 1, which is characterized in that the duration is specially 10 minutes.
6. management method according to claim 1, which is characterized in that further include:
The spatial cache state of the server-side is obtained, and the preset value is adjusted according to the spatial cache state.
7. a kind of management system of inode spatial cache characterized by comprising
Aging timing module, for when detecting that file destination is closed, the corresponding inode of file destination described in caching to be delayed The state deposited is set as ageing state, and records the duration that the inode caching is in the ageing state;
Judgment module, for judging whether the duration is greater than preset value;
Release module is cached, for discharging described in the client when the duration being greater than the preset value Inode caching, so that server-side discharges spatial cache corresponding with inode caching.
8. management system according to claim 7, which is characterized in that further include:
Loading module is cached, the file destination is opened for the client, the inode information of the file destination is loaded The inode caching is obtained into caching.
9. a kind of electronic equipment characterized by comprising
Memory, for storing computer program;
Processor is realized when for executing the computer program as inode as claimed in any one of claims 1 to 6 caching is empty Between management method the step of.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes such as inode spatial cache as claimed in any one of claims 1 to 6 when the computer program is executed by processor Management method the step of.
CN201810934963.7A 2018-08-16 2018-08-16 Management method, system and related components of inode cache space Active CN109117387B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810934963.7A CN109117387B (en) 2018-08-16 2018-08-16 Management method, system and related components of inode cache space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810934963.7A CN109117387B (en) 2018-08-16 2018-08-16 Management method, system and related components of inode cache space

Publications (2)

Publication Number Publication Date
CN109117387A true CN109117387A (en) 2019-01-01
CN109117387B CN109117387B (en) 2022-02-18

Family

ID=64853316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810934963.7A Active CN109117387B (en) 2018-08-16 2018-08-16 Management method, system and related components of inode cache space

Country Status (1)

Country Link
CN (1) CN109117387B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066095A1 (en) * 2003-09-23 2005-03-24 Sachin Mullick Multi-threaded write interface and methods for increasing the single file read and write throughput of a file server
US7822758B1 (en) * 2005-04-22 2010-10-26 Network Appliance, Inc. Method and apparatus for restoring a data set
CN106802950A (en) * 2017-01-16 2017-06-06 郑州云海信息技术有限公司 A kind of method of distributed file system small documents write buffer optimization
CN107633014A (en) * 2017-08-17 2018-01-26 深圳市诚壹科技有限公司 A kind of date storage method and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066095A1 (en) * 2003-09-23 2005-03-24 Sachin Mullick Multi-threaded write interface and methods for increasing the single file read and write throughput of a file server
US7822758B1 (en) * 2005-04-22 2010-10-26 Network Appliance, Inc. Method and apparatus for restoring a data set
CN106802950A (en) * 2017-01-16 2017-06-06 郑州云海信息技术有限公司 A kind of method of distributed file system small documents write buffer optimization
CN107633014A (en) * 2017-08-17 2018-01-26 深圳市诚壹科技有限公司 A kind of date storage method and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A. SHETH等: "Data Structure Distribution & Multi-threading of Linux File", 《PROCEEDINGS. FIFTH INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING (CAT. NO. 98EX238)》 *
钱振江等: "微内核架构文件系统的形式化设计与验证方法研究", 《小型微型计算机系统》 *

Also Published As

Publication number Publication date
CN109117387B (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN101673192B (en) Method for time-sequence data processing, device and system therefor
US20070118695A1 (en) Decoupling storage controller cache read replacement from write retirement
CN103024329B (en) A kind of memory management method of monitoring video
US20080279005A1 (en) Managing flash memory program and erase cycles in the time domain
US20150309748A1 (en) Autonomic reclamation processing on sequential storage media
CN104811645B (en) A kind of embedded Video data storage method
CN103078933B (en) A kind of method and apparatus determining data migration time
MX2007001185A (en) Systems, methods, computer readable medium and apparatus for memory management using nvram.
CN107066349A (en) A kind of method and system of cluster file system data protection
CN108920616A (en) A kind of metadata access performance optimization method, system, device and storage medium
CN106648442A (en) Metadata node internal memory mirroring method and device
CN109491589A (en) A kind of delamination process and device based on file content
CN106815124A (en) Journal file treating method and apparatus
CN106648796A (en) Application processing method and device
CN102023821A (en) Disc space management method and system
CN109388624A (en) Distributed document delet method, device, system and computer readable storage medium
CN104079600B (en) File memory method, device, access client and meta data server system
JP2009169688A (en) Storage device, data migration device, and data migration method
CN104636218B (en) Data reconstruction method and device
CN106055372A (en) Method and device for uninstalling application
CN109117387A (en) A kind of management method, system and the associated component of inode spatial cache
CN102156731B (en) Data storage method and device for flash memory
CN105389216A (en) Clipboard data caching method and apparatus and electronic device
CN102141964B (en) Method and device for repeatedly using magnetic tape
CN104050100B (en) A kind of data flow memory management method and system suitable for big data environment

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