CN111552438A - Object writing method, device, server and storage medium - Google Patents
Object writing method, device, server and storage medium Download PDFInfo
- Publication number
- CN111552438A CN111552438A CN202010327053.XA CN202010327053A CN111552438A CN 111552438 A CN111552438 A CN 111552438A CN 202010327053 A CN202010327053 A CN 202010327053A CN 111552438 A CN111552438 A CN 111552438A
- Authority
- CN
- China
- Prior art keywords
- directory
- write
- written
- quota
- specified
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Library & Information Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种对象写入的方法、装置、服务器和存储介质。其中,该方法包括:查找出待写入对象指定的写入目录在各上向目录级下的关联目录;如果所述待写入对象的指定写入量小于所述写入目录的剩余许可配额,且小于所述关联目录的剩余许可配额,则将所述待写入对象写入到所述写入目录下。本发明实施例提供的技术方案,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,同时限定写入目录和关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。
The embodiments of the present invention disclose an object writing method, device, server and storage medium. Wherein, the method includes: finding out the associated directories of the write directory specified by the object to be written at each upper directory level; if the specified write amount of the object to be written is less than the remaining permission quota of the write directory , and is less than the remaining permission quota of the associated directory, write the object to be written into the write directory. The technical solution provided by the embodiment of the present invention enables the object to be written to uniformly meet the quota requirements of the specified write directory and each associated directory, preventing the occurrence of satisfying the quota requirements of the write directory and exceeding a certain directory level above In the case of the quota requirements of the associated directory, the remaining permission quota of the write directory and the associated directory can be limited at the same time, which can effectively avoid excessive writing to a single directory by different objects, and improve the adaptability of writing objects in different directories.
Description
技术领域technical field
本发明实施例涉及数据处理技术领域,尤其涉及一种对象写入的方法、装置、服务器和存储介质。Embodiments of the present invention relate to the technical field of data processing, and in particular, to a method, apparatus, server, and storage medium for object writing.
背景技术Background technique
随着多媒体文件存储量的逐渐增加,Ceph作为Linux系统的文件系统备选之一,通常采用Ceph文件系统(Ceph File System,CephFS)来将客户端操作的各类系统文件存储至不同层级的系统目录下,此时多个客户端向CephFS下的系统目录中写入文件,可能会存在某一目录被过度使用而使其他目录空间浪费的问题,因此文件系统中出现目录配额的要求。With the gradual increase in the storage of multimedia files, Ceph, as one of the file system alternatives for Linux systems, usually adopts the Ceph File System (Ceph File System, CephFS) to store various system files operated by clients to systems at different levels directory. At this time, multiple clients write files to the system directory under CephFS. There may be a problem that a certain directory is overused and other directory space is wasted. Therefore, there is a directory quota requirement in the file system.
目前,客户端会采用内核挂载和用户空间文件系统(File System in UserSpace,FUSE)挂载这两种方式来访问CephFS,此时内核挂载时客户端功能会集成到Linux内核里,无法控制CephFS在系统目录下的配额;而FUSE挂载时会直接在FUSE客户端内嵌入相应的配额检查逻辑来控制CephFS下各系统目录的配额,但需要FUSE客户端启动一个用户空间的进程,来提供一个文件访问接口来设置配额,此时系统目录的访问路径较长,导致配额性能较差。At present, the client will access CephFS in two ways: kernel mount and File System in UserSpace (FUSE) mount. At this time, the client function will be integrated into the Linux kernel when the kernel mounts, which cannot be controlled. CephFS quotas in the system directory; while FUSE will directly embed the corresponding quota check logic in the FUSE client to control the quota of each system directory under CephFS, but the FUSE client needs to start a user space process to provide A file access interface is used to set the quota. At this time, the access path of the system directory is long, resulting in poor quota performance.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种对象写入的方法、装置、服务器和存储介质,避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。The embodiments of the present invention provide an object writing method, device, server and storage medium, which avoids excessive writing of different objects to a single directory, and improves the adaptability of object writing in different directories.
第一方面,本发明实施例提供了一种对象写入的方法,该方法包括:In a first aspect, an embodiment of the present invention provides a method for writing an object, the method comprising:
查找出待写入对象指定的写入目录在各上向目录级下的关联目录;Find out the associated directory of the write directory specified by the object to be written under each upper directory level;
如果所述待写入对象的指定写入量小于所述写入目录的剩余许可配额,且小于所述关联目录的剩余许可配额,则将所述待写入对象写入到所述写入目录下。If the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of the associated directory, write the object to be written to the write directory Down.
第二方面,本发明实施例提供了一种对象写入的装置,该装置包括:In a second aspect, an embodiment of the present invention provides an object writing device, the device comprising:
目录查找模块,用于查找出待写入对象指定的写入目录在各上向目录级下的关联目录;The directory search module is used to find out the associated directories of the write directory specified by the to-be-written object at each upper directory level;
对象写入模块,用于如果所述待写入对象的指定写入量小于所述写入目录的剩余许可配额,且小于所述关联目录的剩余许可配额,则将所述待写入对象写入到所述写入目录下。An object writing module, configured to write the to-be-written object if the specified write amount of the to-be-written object is less than the remaining permission quota of the write directory and less than the remaining permission quota of the associated directory into the write directory.
第三方面,本发明实施例提供了一种服务器,该服务器包括:In a third aspect, an embodiment of the present invention provides a server, where the server includes:
一个或多个处理器;one or more processors;
存储装置,用于存储一个或多个程序;a storage device for storing one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明任意实施例所述的对象写入的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the object writing method described in any embodiment of the present invention.
第四方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明任意实施例所述的对象写入的方法。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for writing an object described in any embodiment of the present invention is implemented.
本发明实施例提供的一种对象写入的方法、装置、服务器和存储介质,首先查找出待写入对象当前指定的写入目录在各个上向目录级下的关联目录,只有在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于每一关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,同时限定写入目录和关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。An object writing method, device, server, and storage medium provided by the embodiments of the present invention firstly find out the associated directories in each upper and lower directory level of the writing directory currently specified by the object to be written. Only when the specified write amount of the object is less than the remaining permission quota of the write directory and less than the remaining permission quota of each associated directory, the object to be written will be written to the write directory, so that the objects to be written can be unified Meet the quota requirements of the specified write directory and each associated directory, prevent the situation that the quota requirements of the write directory are met but the quota requirements of an associated directory under the upward directory level are exceeded, and the write directory and the associated directory are limited at the same time. The remaining license quota can effectively avoid excessive writing to a single directory by different objects, and improve the adaptability of writing objects in different directories.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1A为本发明实施例一提供的一种对象写入的方法的流程图;1A is a flowchart of a method for writing an object according to Embodiment 1 of the present invention;
图1B为本发明实施例一提供的对象写入过程的原理示意图;FIG. 1B is a schematic diagram of the principle of an object writing process provided in Embodiment 1 of the present invention;
图2A为本发明实施例二提供的一种对象写入的方法的流程图;2A is a flowchart of a method for writing an object according to Embodiment 2 of the present invention;
图2B为本发明实施例二提供的方法中确定写入目录和各个关联目录的剩余许可配额的原理示意图;2B is a schematic diagram of the principle of determining the remaining license quota of the write directory and each associated directory in the method provided by Embodiment 2 of the present invention;
图3A为本发明实施例三提供的一种对象写入的方法的流程图;3A is a flowchart of a method for writing an object according to Embodiment 3 of the present invention;
图3B为本发明实施例三提供的对象写入过程的原理示意图;3B is a schematic diagram of the principle of an object writing process provided in Embodiment 3 of the present invention;
图4为本发明实施例四提供的一种对象写入的装置的结构示意图;FIG. 4 is a schematic structural diagram of an object writing device according to Embodiment 4 of the present invention;
图5为本发明实施例五提供的一种服务器的结构示意图。FIG. 5 is a schematic structural diagram of a server according to Embodiment 5 of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。此外,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention. Furthermore, the embodiments of the invention and the features of the embodiments may be combined with each other without conflict.
本发明实施例主要针对在现有的CephFS系统中,客户端执行对应的写入操作(如在CephFS系统中写入新的文件、创建新的目录或创建文件软硬链接等)时,由于不同挂载方式下对系统目录设置配额时存在相应配额缺陷,而导致在某一目录下过度写入的问题,直接通过CephFS系统中的元数据服务端(Metadata Server,MDS)来为CephFS系统下的相应目录设置对应的配额信息,无需对客户端做任何改动,进而只有在待写入对象的指定写入量小于当前指定的写入目录的剩余许可配额,且小于该写入目录在各上向目录级下的关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足写入目录和各个关联目录的配额要求,有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。The embodiments of the present invention are mainly aimed at that in the existing CephFS system, when the client performs a corresponding write operation (such as writing a new file, creating a new directory, or creating a file soft and hard link in the CephFS system, etc.), due to different There is a corresponding quota defect when setting quotas on the system directory in the mount mode, which leads to the problem of excessive writing in a certain directory, directly through the metadata server (Metadata Server, MDS) in the CephFS system. The corresponding quota information is set for the corresponding directory, without any changes to the client, and only when the specified write volume of the object to be written is less than the remaining permitted quota of the currently specified write directory, and less than the write directory on each direction. Only when the remaining permission quota of the associated directory at the directory level is used, the object to be written will be written to the write directory, so that the object to be written can uniformly meet the quota requirements of the write directory and each associated directory, and effectively avoid different objects. Overwriting to a single directory improves the adaptability of writing objects in different directories.
实施例一Example 1
图1A为本发明实施例一提供的一种对象写入的方法的流程图,本实施例可适用于在各类文件系统的系统目录下写入任意对象的情况中。本实施例提供的对象写入的方法可以由本发明实施例提供的对象写入的装置来执行,该装置可以通过软件和/或硬件的方式来实现,并集成在执行本方法的服务器中,该服务器可以是文件系统内用于处理各类对象元数据的元数据服务器。FIG. 1A is a flowchart of a method for writing an object according to Embodiment 1 of the present invention. This embodiment is applicable to a situation in which any object is written in a system directory of various file systems. The object writing method provided in this embodiment may be executed by the object writing apparatus provided in this embodiment of the present invention, and the apparatus may be implemented by means of software and/or hardware, and is integrated in the server that executes the method, the The server may be a metadata server within the file system for processing various types of object metadata.
具体的,参考图1A,该方法可以包括如下步骤:Specifically, referring to FIG. 1A , the method may include the following steps:
S110,查找出待写入对象指定的写入目录在各上向目录级下的关联目录。S110: Find out the associated directories of the write directory specified by the to-be-written object at each upper directory level.
具体的,本实施例主要针对客户端在CephFS系统的各个系统目录下执行对应的写入操作,此时待写入对象为客户端在某一目录下指定写入的任一目标,例如新创建的目录、文件和文件软硬链接等;同时,在初始化设置CephFS系统时,会根据不同对象的写入需求预先设置相应的目录级,不同目录级下创建有对应的系统目录,例如CephFS系统下的整个对象存储区域为第一级目录,在第一级目录下创建出多个子目录,作为第二级目录,并在每一第二级目录下再次创建出多个子目录,作为第三级目录,以此类推,使得CephFS系统下的各个目录之间存在对应的上下级关系;此时,客户端可以指示在CephFS系统下的任一特定目录下写入相应对象,该特定目录作为本实施例中的写入目录。Specifically, this embodiment is mainly for the client to perform the corresponding write operation in each system directory of the CephFS system. At this time, the object to be written is any target specified by the client to write in a certain directory, such as a newly created object. At the same time, when the CephFS system is initially set up, the corresponding directory levels will be preset according to the writing requirements of different objects, and corresponding system directories will be created under different directory levels, such as under the CephFS system. The entire object storage area is the first-level directory, and multiple subdirectories are created under the first-level directory as the second-level directory, and multiple subdirectories are created again under each second-level directory as the third-level directory. , and so on, so that there is a corresponding superior-subordinate relationship between each directory under the CephFS system; at this time, the client can instruct to write the corresponding object in any specific directory under the CephFS system, and the specific directory is used as this embodiment. in the write directory.
可选的,客户端在CephFS系统的某一目录下执行对应的写入操作后,MDS服务端首先会分析出客户端本次操作指定的待写入对象,如新创建的目录、文件或者文件软硬链接等,如图1B所示,同时在CephFS系统的各个目录下查找出待写入对象当前指定的写入目录,进而从该写入目录所在的目录级开始,上向依次排查各个目录级,以在该写入目录的每一上向目录级下分别查找出包含有该写入目录的目标目录,作为本实施例中写入目录在各个上向目录级下的关联目录。Optionally, after the client performs a corresponding write operation in a certain directory of the CephFS system, the MDS server will first analyze the object to be written specified by the client in this operation, such as a newly created directory, file or file. Soft and hard links, etc., as shown in Figure 1B, at the same time, find the write directory currently specified by the object to be written in each directory of the CephFS system, and then start from the directory level where the write directory is located, and check each directory upwards in turn. level, so as to find the target directory containing the write directory in each upper directory level of the write directory, as the associated directory of the write directory in each upper directory level in this embodiment.
示例性的,若客户端当前指示在CephFS系统的第三级目录下的某一特定目录下写入一份新文件,此时该新文件为本实施例中的待写入对象,该特定目录为本实施例中的写入目录,在第一级目录和第二级目录下包含有该特定目录的目录为本实施例中的关联目录。Exemplarily, if the client currently instructs to write a new file in a specific directory under the third-level directory of the CephFS system, the new file is the object to be written in this embodiment, and the specific directory As the write directory in this embodiment, the directory containing the specific directory under the first-level directory and the second-level directory is the associated directory in this embodiment.
S120,如果待写入对象的指定写入量小于写入目录的剩余许可配额,且小于关联目录的剩余许可配额,则将待写入对象写入到写入目录下。S120, if the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of the associated directory, write the object to be written into the write directory.
可选的,为了避免客户端在CephFS系统的某个目录下的过度写入,本实施例会预先为不同目录级下的各个目录设定相应的配额,以要求该目录下写入的对象数据量不能超出该目录下设定的配额;此时,不同目录级下的各个目录根据该目录下的配额和已写入的对象数据量会匹配有相应的剩余许可配额,客户端在向某一目录写入相应对象时,首先需要分析当前写入的数据量是否满足对应目录下剩余许可配额的要求,以防止某一目录的过度写入。Optionally, in order to avoid excessive writing by the client in a certain directory of the CephFS system, this embodiment will pre-set corresponding quotas for each directory under different directory levels to require the amount of object data written in the directory. The quota set under the directory cannot be exceeded; at this time, each directory under different directory levels will match the corresponding remaining license quota according to the quota under the directory and the amount of written object data. When writing a corresponding object, it is first necessary to analyze whether the currently written data volume meets the requirements of the remaining license quota in the corresponding directory to prevent excessive writing of a certain directory.
具体的,为了提高不同对象在各个目录下写入的适配性,MDS服务端在查找出待写入对象指定的写入目录在各上向目录级下的关联目录后,首先会计算出待写入对象当前指定的写入目录和所查找出的各个关联目录在当前时刻下的剩余许可配额,此时由于待写入对象指定的写入目录属于各个关联目录下的一个子目录,因此如果后续将待写入对象写入到该写入目录时,会使该写入目录和各个关联目录下已写入的数据量均产生相应的增加量,因此在将待写入对象写入到当前指定的写入目录之前,为了避免某一目录的过度写入,首先分析本次操作的待写入对象的指定写入量,并依次判断该待写入对象的指定写入量是否小于写入目录和各个关联目录的剩余许可配额剩余,也就是判断如果后续将该待写入对象写入到写入目录后,该写入目录和各个关联目录中是否存在某个目录下已写入的数据量超出所设定的配额,使得该目录过度写入对象;如果待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于各个关联目录的剩余许可配额,说明该写入目录和各个关联目录均存在剩余空间来写入该待写入对象,不存在造成某一目录下过度写入的问题,则直接将待写入对象写入到当前指定的写入目录下。Specifically, in order to improve the adaptability of different objects to be written in each directory, the MDS server first calculates the to-be-written after finding out the associated directories of the write directory specified by the object to be written under each upper directory level. The write directory currently specified by the input object and the remaining license quota of each associated directory found at the current moment. At this time, since the write directory specified by the object to be written belongs to a subdirectory under each associated directory, if subsequent When the object to be written is written to the write directory, the amount of data written in the write directory and each associated directory will increase accordingly. Therefore, when the object to be written is written to the currently specified Before writing to the directory, in order to avoid excessive writing to a certain directory, first analyze the specified write volume of the object to be written in this operation, and then judge in turn whether the specified write volume of the object to be written is less than the write directory. and the remaining license quota of each associated directory, that is to say, if the object to be written is subsequently written to the write directory, whether there is an amount of data written in a certain directory in the write directory and each associated directory Exceeds the set quota, causing the directory to overwrite objects; if the specified write volume of the object to be written is less than the remaining permission quota of the write directory, and less than the remaining permission quota of each associated directory, it indicates that the write directory If there is remaining space in each associated directory to write the object to be written, and there is no problem of excessive writing in a certain directory, the object to be written is directly written to the currently specified write directory.
此外,本实施例在依次判断该待写入对象的指定写入量是否小于写入目录和各个关联目录的剩余许可配额剩余时,还存在另一种情况:如果待写入对象的指定写入量大于等于写入目录的剩余许可配额,或者大于等于关联目录的剩余许可配额,则禁止在写入目录下写入待写入对象。In addition, when this embodiment judges in turn whether the specified write amount of the to-be-written object is less than the remaining permission quota remaining in the write directory and each associated directory, there is another situation: if the specified write amount of the to-be-written object is written If the amount is greater than or equal to the remaining license quota of the write directory, or is greater than or equal to the remaining license quota of the associated directory, the object to be written is prohibited from being written in the write directory.
具体的,如果待写入对象的指定写入量大于等于写入目录的剩余许可配额,或者大于等于某一个关联目录的剩余许可配额,说明如果将待写入对象写入到该写入目录下后,会使写入目录或者某一关联目录下已写入的数据量超出所设定的配额,从而造成写入目录或者某一关联目录过度写入的问题,因此此时禁止在当前指定的写入目录下写入该待写入对象,有效避免不同对象对单个目录的过度写入。Specifically, if the specified write volume of the object to be written is greater than or equal to the remaining permission quota of the write directory, or greater than or equal to the remaining permission quota of an associated directory, it means that if the object to be written is written to the write directory After that, the amount of data written to the write directory or an associated directory will exceed the set quota, resulting in the problem of excessive writing to the write directory or an associated directory. The object to be written is written in the write directory, which effectively avoids excessive writing to a single directory by different objects.
本实施例提供的技术方案,首先查找出待写入对象当前指定的写入目录在各个上向目录级下的关联目录,只有在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于每一关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,同时限定写入目录和关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。The technical solution provided by this embodiment firstly finds out the associated directories of the currently specified writing directory of the object to be written in each upper and lower directory level, only if the specified writing amount of the object to be written is less than the remaining amount of the writing directory Only when the permission quota is less than the remaining permission quota of each associated directory, the object to be written will be written to the writing directory, so that the object to be written can uniformly meet the quota of the specified writing directory and each associated directory. requirements, to prevent the situation that the quota requirements of the write directory are met, but the quota requirements of an associated directory under the upward directory level are exceeded. At the same time, the remaining license quota of the write directory and the associated directory can be limited, which can effectively avoid the impact of different objects on a single directory. overwriting, improving the adaptability of object writing in different directories.
实施例二Embodiment 2
图2A为本发明实施例二提供的一种对象写入的方法的流程图,图2B为本发明实施例二提供的方法中确定写入目录和各个关联目录的剩余许可配额的原理示意图。本实施例是在上述实施例的基础上进行优化。具体的,如图2A所示,本实施例对于待写入对象当前指定的写入目录和各个关联目录下的剩余许可配额的具体确定过程进行详细的解释说明。FIG. 2A is a flowchart of a method for writing an object according to Embodiment 2 of the present invention, and FIG. 2B is a schematic diagram of the principle of determining the remaining license quota of a write directory and each associated directory in the method provided by Embodiment 2 of the present invention. This embodiment is optimized on the basis of the above-mentioned embodiment. Specifically, as shown in FIG. 2A , this embodiment provides a detailed explanation for the specific determination process of the write directory currently specified by the object to be written and the remaining license quota under each associated directory.
可选的,如图2A所示,本实施例中可以包括如下步骤:Optionally, as shown in FIG. 2A , this embodiment may include the following steps:
S210,根据目录配额需求预先为指定目录设置对应的配额上限,并实时记录每一目录的最新已写入总量。S210: Set a corresponding upper quota limit for the specified directory in advance according to the directory quota requirement, and record the latest written total amount of each directory in real time.
在本实施例中,MDS服务端在CephFS系统执行任意文件操作的过程中,可以实时监测当前时刻下管理员针对某一目录下的对象写入是否存在相应的目录配额需求,以便随时为指定目录设置对应的配额上限;例如,如果管理员在当前时刻下要求某几个指定目录下的已写入的数据量不能超出某个上限,否则会造成该目录过度写入的问题时,管理员在客户端会相应执行指定目录下的配额触发操作,MDS服务端在检测到该配额触发操作时,会通过解析该配额触发操作确定出当前的目录配额需求,该目录配额需求中携带了本次存在配额要求的指定目录,以及每一指定目录要求的配额上限,因此MDS服务端在确定出当前的目录配额需求中携带的指定目录和各个指定目录对应的配额上限后,分别为每一指定目录均设置对应的配额上限;同时,为了在后续对象写入过程中,准确判断相应目录的剩余许可配额,还会实时记录CephFS系统下每一目录的最新已写入总量,以便准确分析每一目录的剩余许可配额,保证不同对象在各个目录下写入的适配准确性。In this embodiment, when the CephFS system performs any file operation, the MDS server can monitor in real time whether there is a corresponding directory quota requirement for the object written in a certain directory by the administrator at the current moment, so that the specified directory can be written at any time at any time. Set the corresponding quota upper limit; for example, if the administrator requires that the amount of written data in some specified directories at the current moment cannot exceed a certain upper limit, otherwise it will cause the problem of excessive writing of the directory, the administrator will The client will execute the quota trigger operation in the specified directory accordingly. When the MDS server detects the quota trigger operation, it will determine the current directory quota requirement by analyzing the quota trigger operation. The directory quota requirement carries the current existence. The specified directory required by the quota, and the quota upper limit required by each specified directory. Therefore, after determining the specified directory carried in the current directory quota demand and the quota upper limit corresponding to each specified directory, the MDS server will assign the quota to each specified directory. Set the corresponding quota upper limit; at the same time, in order to accurately determine the remaining license quota of the corresponding directory in the subsequent object writing process, the latest written total amount of each directory under the CephFS system will also be recorded in real time, so as to accurately analyze each directory. The remaining license quota of , to ensure the adaptation accuracy of different objects written in each directory.
S220,查找出待写入对象指定的写入目录在各上向目录级下的关联目录。S220: Find out the associated directories of the write directory specified by the to-be-written object at each upper directory level.
S230,针对写入目录和关联目录中的每一目录,根据该目录的配额上限和最新已写入总量确定该目录的剩余许可配额。S230 , for each directory in the write directory and the associated directory, determine the remaining permitted quota of the directory according to the quota upper limit of the directory and the latest total written amount.
可选的,在查找出待写入对象指定的写入目录在各上向目录级下的关联目录后,由于待写入对象指定的写入目录属于各个关联目录下的一个子目录,因此如果后续将待写入对象写入到该写入目录时,会使该写入目录和各个关联目录下已写入的数据量均产生相应的增加量,因此在将待写入对象写入到当前指定的写入目录之前,为了避免某一目录的过度写入,需要分别分析本次操作的待写入对象的指定写入量,与写入目录和各个关联目录中的每一目录的剩余许可配额之间的大小;此时,如图2B所示,本实施例针对待写入对象指定的写入目录和该写入目录在各个上向目录级下的关联目录中的每一目录,首先查找出预先为该目录所设置的配额上限以及该目录下已写入对象占用的最新已写入总量,进而分析该目录下在最新已写入总量的基础上,距离达到该目录的配额上限还剩余的允许对象继续写入的量,作为本实施例中该目录的剩余许可配额,后续通过分许待写入对象的指定写入量与该目录的剩余许可配额之间的大小,判断该目录是否能够继续写入该待写入对象,避免该目录下的过度写入。Optionally, after finding out the associated directories of the write directory specified by the object to be written at each upper directory level, since the write directory specified by the object to be written belongs to a subdirectory under each associated directory, if When the object to be written is subsequently written to the write directory, the amount of data written in the write directory and each associated directory will increase accordingly. Therefore, when the object to be written is written to the current directory Before the specified write directory, in order to avoid excessive writing of a directory, it is necessary to analyze the specified write amount of the object to be written in this operation, and the remaining permission of each directory in the write directory and each associated directory. The size between the quotas; at this time, as shown in FIG. 2B , in this embodiment, for each directory in the write directory specified by the object to be written and the associated directory at each upward directory level, the first Find out the pre-set quota upper limit for the directory and the latest written total amount occupied by the written objects in the directory, and then analyze the distance to reach the quota of the directory on the basis of the latest written total amount in the directory The amount of allowed objects to continue to be written in the upper limit is regarded as the remaining allowed quota of the directory in this embodiment. Subsequently, it is determined by dividing the size between the specified write amount of the object to be written and the remaining allowed quota of the directory. Whether the directory can continue to write the object to be written to avoid excessive writing in the directory.
示例性的,由于在根据目录配额需求预先为指定目录设置对应的配额上限时,可能只单独设定某几个指定目录的配额上限,而对其他目录的配额不作要求,此时本实施例待写入对象当前指定的写入目录和各个关联目录的配额上限可能为空,因此在本实施例中,根据该目录的配额上限和最新已写入总量确定该目录的剩余许可配额,具体可以包括:如果该目录的配额上限为空,则确定该目录的剩余许可配额无上限;如果该目录的配额上限为非空,则将该目录的配额上限和最新已写入总量的差值作为该目录的剩余许可配额。Exemplarily, since when the corresponding quota upper limit is set for a specified directory in advance according to the directory quota requirement, only the quota upper limit of some specified directories may be individually set, and the quota of other directories is not required. The write directory currently specified by the write object and the quota upper limit of each associated directory may be empty. Therefore, in this embodiment, the remaining permission quota of the directory is determined according to the quota upper limit of the directory and the latest total written amount. Including: if the quota upper limit of the directory is empty, it is determined that the remaining license quota of the directory has no upper limit; if the quota upper limit of the directory is not empty, the difference between the quota upper limit of the directory and the latest written total amount is taken as The remaining license quota for this directory.
具体的,针对待写入对象当前指定的写入目录和该写入目录在各个上向目录级下的关联目录中的每一目录,如果该目录的配额上限为空,说明当前对该目录的对象写入量不作要求,因此可以直接确定该目录的剩余许可配额无上限,也就是可以随意写入任意量的对象;而如果该目录的配额上限为非空,说明当前对该目录的对象写入量存在一定的限制要求,此时分析该目录的最新已写入总量,进而将该目录的配额上限和最新已写入总量的差值作为该目录的剩余许可配额,避免该目录所写入的对象数据量超出该目录的配额上限要求;也就是后续在判断待写入对象的指定写入量是否小于写入目录和各个关联目录的剩余许可配额时,直接跳过写入目录和各个关联目录中配额上限为空的目录,仅依次判断待写入对象的指定写入量是否小于写入目录和各个关联目录中配额上限为非空的各个目录下的剩余许可配额。Specifically, for the write directory currently specified by the object to be written and each directory in the associated directory at each upper directory level of the write directory, if the upper limit of the quota of the directory is empty, it means that the current quota for the directory is empty. The amount of object writing is not required, so it can be directly determined that the remaining license quota of the directory has no upper limit, that is, any amount of objects can be written at will; and if the quota upper limit of the directory is non-empty, it means that the objects in the directory are currently being written to. There are certain restrictions on the amount of input. At this time, the latest written total amount of the directory is analyzed, and the difference between the quota upper limit of the directory and the latest written total amount is used as the remaining license quota of the directory, so as to avoid the directory's total amount. The amount of written object data exceeds the quota upper limit of the directory; that is, when determining whether the specified write amount of the object to be written is less than the remaining permitted quota of the write directory and each associated directory, directly skip the write directory and For directories with an empty quota upper limit in each associated directory, only determine whether the specified write volume of the object to be written is less than the write directory and the remaining license quota in each directory with a non-empty quota upper limit in each associated directory.
S240,如果待写入对象的指定写入量小于写入目录的剩余许可配额,且小于关联目录的剩余许可配额,则将待写入对象写入到写入目录下。S240, if the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of the associated directory, write the object to be written into the write directory.
S250,更新写入目录和关联目录的最新已写入总量。S250, update the latest written total amount of the written directory and the associated directory.
可选的,在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于各个关联目录的剩余许可配额,从而将待写入对象写入到写入目录下后,该写入目录和该写入目录在各上向目录级下的关联目录的最新已写入总量会相应增加,因此需要更新该写入目录和所查找出的各个关联目录的最新已写入总量,如在该写入目录和所查找出的各个关联目录下已有的已写入总量的基础上分别加上待写入对象的指定写入量,作为对应目录的最新已写入总量。Optionally, after the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of each associated directory, so that the object to be written is written into the write directory, the The latest written totals of the write directory and the associated directories under the directory level will increase accordingly, so it is necessary to update the latest written totals of the write directory and each associated directory found. For example, add the specified write amount of the object to be written on the basis of the write directory and the existing written total amount of each associated directory found, as the latest written total amount of the corresponding directory. quantity.
S260,如果待写入对象的指定写入量大于等于写入目录的剩余许可配额,或者大于等于关联目录的剩余许可配额,则禁止在写入目录下写入待写入对象。S260, if the specified write amount of the object to be written is greater than or equal to the remaining permission quota of the write directory, or greater than or equal to the remaining permission quota of the associated directory, prohibit writing the object to be written in the write directory.
本实施例提供的技术方案,通过预先为指定目录设置对应的配额上限,来限定待写入对象指定的写入目录和该写入目录在各个上向目录级下的关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,同时在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于每一关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,提高不同目录下对象写入的适配性,同时在将待写入对象写入到该写入目录下后,及时更新写入目录和关联目录的最新已写入总量,以保证写入目录和关联目录的剩余许可配额的准确性,提高对象写入的适配准确度。In the technical solution provided by this embodiment, a corresponding upper limit of quota is set for the specified directory in advance, so as to limit the write directory specified by the object to be written and the remaining permission quota of the associated directory at the upper and lower directory levels of the write directory, It can effectively avoid excessive writing to a single directory by different objects. At the same time, when the specified write volume of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of each associated directory, the to-be-written The input object is written to the write directory, so that the object to be written can uniformly meet the quota requirements of the specified write directory and each associated directory, preventing the occurrence of meeting the quota requirements of the write directory and exceeding the upper directory level. In the case of quota requirements of an associated directory, improve the adaptability of writing objects in different directories, and at the same time, after writing the object to be written into the writing directory, update the latest written directory and associated directory in time. The total amount of writing to ensure the accuracy of the remaining license quota of the written directory and associated directories, and to improve the adaptation accuracy of object writing.
实施例三Embodiment 3
图3A为本发明实施例三提供的一种对象写入的方法的流程图,图3B为本发明实施例三提供的对象写入过程的原理示意图。本实施例是在上述实施例的基础上进行优化。具体的,如图3B所示,本实施例对于对象写入过程中存在的其他处理过程进行详细的解释说明。FIG. 3A is a flowchart of a method for writing an object according to Embodiment 3 of the present invention, and FIG. 3B is a schematic schematic diagram of a principle of writing an object according to Embodiment 3 of the present invention. This embodiment is optimized on the basis of the above-mentioned embodiment. Specifically, as shown in FIG. 3B , in this embodiment, other processing procedures existing in the object writing process are explained in detail.
可选的,如图3A所示,本实施例中可以包括如下步骤:Optionally, as shown in FIG. 3A , this embodiment may include the following steps:
S310,根据不同目录之间的级联状态,生成对应的目录树。S310, according to the cascade state between different directories, generate a corresponding directory tree.
可选的,在初始化设置CephFS系统时,会根据不同对象的写入需求预先设置相应的目录级,不同目录级下创建有对应的系统目录,此时如图3B所示,为了确保各个目录所在目录级之间的关联性,MDS服务端可以通过分析CephFS系统内各个目录之间的级联状态,确定出整体范围下的第一级目录,以及在该第一级目录下所创建出的多个子目录,作为第二级目录,以此类推,根据不同目录之间的级联状态,生成对应的目录树,后续可以直接根据该目录树中各个目录之间的级联情况直观地查找出待写入对象当前指定的写入目录在各个上向目录级下的关联目录,保证关联目录的全面性。Optionally, when the CephFS system is initialized, the corresponding directory levels will be preset according to the writing requirements of different objects, and corresponding system directories will be created under different directory levels. At this time, as shown in Figure 3B, in order to ensure that each directory is located. The correlation between directory levels, the MDS server can determine the first-level directory in the overall scope by analyzing the cascading status between the various directories in the CephFS system, and the multi-level directory created under the first-level directory. A subdirectory is used as the second-level directory, and so on. According to the cascading state between different directories, the corresponding directory tree is generated, and the subsequent directory tree can be directly based on the cascade situation between the various directories in the directory tree. The write directory currently specified by the write object is written to the associated directory under the directory level at each upper level to ensure the comprehensiveness of the associated directory.
S320,接收待写入对象的写入命令。S320: Receive a write command of the object to be written.
具体的,客户端在CephFS系统的某一目录下执行对应的写入操作,会生成对应的写入命令,该写入命令中携带有待写入对象指定的写入目录;MDS服务端在接收到该写入命令后,首先会分析该写入命令指定的待写入对象以及该待写入对象当前指定的写入目录,以便执行相应的对象写入操作。Specifically, when the client performs a corresponding write operation in a certain directory of the CephFS system, a corresponding write command will be generated. The write command carries the write directory specified by the object to be written; the MDS server receives the After the write command, the object to be written specified by the write command and the write directory currently specified by the object to be written are first analyzed, so as to perform a corresponding object write operation.
S330,根据目录树查找出待写入对象指定的写入目录在各上向目录级下的关联目录。S330: Find out, according to the directory tree, the associated directories of the write directory specified by the to-be-written object at each upper directory level.
S340,针对写入目录和关联目录中的每一目录,根据待写入对象的指定写入量中的指定写入对象数量和该目录的剩余许可配额中的剩余许可写入对象数量的第一比对结果,以及待写入对象的指定写入量中的指定写入内存量和该目录的剩余许可配额中的剩余许可写入内存量的第二比对结果,判断待写入对象的指定写入量是否小于该目录的剩余许可配额。S340, for each directory in the write directory and the associated directory, according to the specified number of write objects in the specified write amount of the object to be written and the number of remaining permitted write objects in the remaining permitted quota of the directory, the first The comparison result, and the second comparison result of the specified write memory amount in the specified write amount of the object to be written and the remaining allowable write memory amount in the remaining permitted quota of the directory, determine the specified amount of the object to be written Whether the amount of writes is less than the remaining license quota for this directory.
可选的,在根据目录配额需求预先为指定目录设置对应的配额上限时,可以从对象数量和占用内存量两方面分别设置指定目录的配额,此时在写入目录写入待写入对象之前,也需要从对象数量和占用内存量两方面来判断待写入对象是否满足写入目录和各个关联目录下的配额要求,因此在根据目录树查找出待写入对象指定的写入目录在各上向目录级下的关联目录之后,如图3B所示,针对写入目录和各个关联目录中的每一目录,首先根据该目录下设置的配额上限中包含的对象数量上限和已写入对象总数量,计算该目录的剩余许可配额中的剩余许可写入对象数量,同时根据该目录下设置的配额上限中包含的写入内存量上限和已写入内存总量,计算该目录的剩余许可配额中的剩余许可写入内存量,进而确定出待写入对象的指定写入量中的指定写入对象数量和指定写入内存量,并分别确定待写入对象的指定写入对象数量和该目录的剩余许可写入对象数量的第一比对结果,以及待写入对象的指定写入内存量和该目录的剩余许可写入内存量的第二比对结果,只有在待写入对象的指定写入对象数量小于该目录的剩余许可写入对象数量,且待写入对象的指定写入内存量小于该目录的剩余许可写入内存量时,才可以确定待写入对象的指定写入量小于该目录的剩余许可配额,从而实现不同目录在多维度下的配额要求。Optionally, when setting the corresponding quota upper limit for the specified directory in advance according to the directory quota requirement, you can set the quota of the specified directory in terms of the number of objects and the amount of memory occupied. In this case, before writing to the directory and writing the objects to be written , it is also necessary to judge whether the object to be written meets the quota requirements of the write directory and each associated directory from the two aspects of the number of objects and the amount of memory occupied. After going up to the associated directory under the directory level, as shown in FIG. 3B, for each directory in the write directory and each associated directory, first, according to the upper limit of the number of objects contained in the upper quota limit set under the directory and the written objects Total number, calculate the number of remaining permitted write objects in the remaining permitted quota of the directory, and calculate the remaining permission of the directory according to the upper limit of the amount of written memory and the total amount of written memory included in the upper quota limit set in the directory The remaining allowable write memory amount in the quota, and then determine the specified write object number and the specified write memory amount in the specified write amount of the object to be written, and determine the specified write object number of the to-be-written object and The first comparison result of the number of remaining permitted write objects in the directory, and the second comparison result of the specified write memory amount of the object to be written and the remaining permitted write memory amount of the directory, only when the object to be written The specified number of write objects in the directory is less than the number of remaining permitted write objects in the directory, and the specified write memory of the object to be written is less than the remaining permitted write memory of the directory, the specified write object of the object to be written can be determined The input amount is less than the remaining license quota of the directory, so as to realize the quota requirements of different directories in multiple dimensions.
S350,如果待写入对象的指定写入量小于写入目录的剩余许可配额,且小于关联目录的剩余许可配额,则将待写入对象写入到写入目录下。S350, if the specified write amount of the to-be-written object is less than the remaining permitted quota of the write-in directory and less than the remaining permitted quota of the associated directory, write the to-be-written object into the write directory.
S360,如果待写入对象的指定写入量大于等于写入目录的剩余许可配额,或者大于等于关联目录的剩余许可配额,则禁止在写入目录下写入待写入对象。S360, if the specified write amount of the object to be written is greater than or equal to the remaining permission quota of the write directory, or greater than or equal to the remaining permission quota of the associated directory, prohibit writing the object to be written in the write directory.
本实施例提供的技术方案,从多方面设置不同目录的配额上限,实现不同目录在多维度下的配额要求,在查找出待写入对象当前指定的写入目录在各个上向目录级下的关联目录后,只有在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于每一关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,同时限定写入目录和关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。The technical solution provided by this embodiment sets the upper limit of the quota of different directories from various aspects, realizes the quota requirements of different directories in multiple dimensions, and finds out the currently specified writing directory of the object to be written. After the directory is associated, the object to be written is written to the write directory only when the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of each associated directory. , so that the object to be written can uniformly meet the quota requirements of the specified write directory and each associated directory, and prevent the situation that the quota requirements of the write directory are met but the quota requirements of an associated directory under the upward directory level are exceeded. , while limiting the remaining permission quota of the write directory and the associated directory, which can effectively avoid excessive writing to a single directory by different objects, and improve the adaptability of writing objects in different directories.
实施例四Embodiment 4
图4为本发明实施例四提供的一种对象写入的装置的结构示意图,具体的,如图4所示,该装置可以包括:FIG. 4 is a schematic structural diagram of an object writing device according to Embodiment 4 of the present invention. Specifically, as shown in FIG. 4 , the device may include:
目录查找模块410,用于查找出待写入对象指定的写入目录在各上向目录级下的关联目录;The
对象写入模块420,用于如果待写入对象的指定写入量小于写入目录的剩余许可配额,且小于关联目录的剩余许可配额,则将待写入对象写入到写入目录下。The
本实施例提供的技术方案,首先查找出待写入对象当前指定的写入目录在各个上向目录级下的关联目录,只有在待写入对象的指定写入量既小于写入目录的剩余许可配额,且小于每一关联目录的剩余许可配额时,才将待写入对象写入到该写入目录下,使得待写入对象能够统一满足所指定的写入目录和各个关联目录的配额要求,防止出现满足写入目录的配额要求,而超出上向目录级下某个关联目录的配额要求的情况,同时限定写入目录和关联目录的剩余许可配额,能够有效避免不同对象对单个目录的过度写入,提高不同目录下对象写入的适配性。The technical solution provided by this embodiment firstly finds out the associated directories of the currently specified writing directory of the object to be written in each upper and lower directory level, only if the specified writing amount of the object to be written is less than the remaining amount of the writing directory Only when the permission quota is less than the remaining permission quota of each associated directory, the object to be written will be written to the writing directory, so that the object to be written can uniformly meet the quota of the specified writing directory and each associated directory. requirements, to prevent the situation that the quota requirements of the write directory are met, but the quota requirements of an associated directory under the upward directory level are exceeded. At the same time, the remaining license quota of the write directory and the associated directory can be limited, which can effectively avoid the impact of different objects on a single directory. overwriting, improving the adaptability of object writing in different directories.
本实施例提供的对象写入的装置可适用于上述任意实施例提供的对象写入的方法,具备相应的功能和有益效果。The object writing apparatus provided in this embodiment can be applied to the object writing method provided in any of the foregoing embodiments, and has corresponding functions and beneficial effects.
实施例五Embodiment 5
图5为本发明实施例五提供的一种服务器的结构示意图,如图5所示,该服务器包括处理器50、存储装置51和通信装置52;服务器中处理器50的数量可以是一个或多个,图5中以一个处理器50为例;服务器中的处理器50、存储装置51和通信装置52可以通过总线或其他方式连接,图5中以通过总线连接为例。FIG. 5 is a schematic structural diagram of a server according to Embodiment 5 of the present invention. As shown in FIG. 5 , the server includes a
存储装置51作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本发明任意实施例所述的对象写入的方法对应的程序指令/模块。处理器50通过运行存储在存储装置51中的软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述对象写入的方法。As a computer-readable storage medium, the
存储装置51可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储装置51可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储装置51可进一步包括相对于处理器50远程设置的存储器,这些远程存储器可以通过网络连接至服务器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
通信装置52可用于实现客户端与服务器之间的网络连接或者移动数据连接。The
本实施例提供的一种服务器可用于执行上述任意实施例提供的对象写入的方法,具备相应的功能和有益效果。The server provided in this embodiment can be used to execute the object writing method provided by any of the foregoing embodiments, and has corresponding functions and beneficial effects.
实施例六Embodiment 6
本发明实施例六还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时可实现上述任意实施例中的对象写入的方法。该方法具体可以包括:Embodiment 6 of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for writing an object in any of the foregoing embodiments can be implemented. Specifically, the method may include:
查找出待写入对象指定的写入目录在各上向目录级下的关联目录;Find out the associated directory of the write directory specified by the object to be written under each upper directory level;
如果待写入对象的指定写入量小于写入目录的剩余许可配额,且小于关联目录的剩余许可配额,则将待写入对象写入到写入目录下。If the specified write amount of the object to be written is less than the remaining permission quota of the write directory and less than the remaining permission quota of the associated directory, the object to be written will be written to the write directory.
当然,本发明实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本发明任意实施例所提供的对象写入的方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present invention, the computer-executable instructions of which are not limited to the above-mentioned method operations, and can also perform the object writing method provided by any embodiment of the present invention. related operations in .
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本发明可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be realized by software and necessary general-purpose hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment . Based on such understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in a computer-readable storage medium, such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or CD, etc., including several instructions to make a computer device (which can be a personal computer, A server, or a network device, etc.) executes the methods described in the various embodiments of the present invention.
值得注意的是,上述对象写入的装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that in the above-mentioned embodiment of the object writing device, the units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; , the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention.
以上所述仅为本发明的优选实施例,并不用于限制本发明,对于本领域技术人员而言,本发明可以有各种改动和变化。凡在本发明的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010327053.XA CN111552438B (en) | 2020-04-23 | 2020-04-23 | Method, device, server and storage medium for writing object |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010327053.XA CN111552438B (en) | 2020-04-23 | 2020-04-23 | Method, device, server and storage medium for writing object |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111552438A true CN111552438A (en) | 2020-08-18 |
CN111552438B CN111552438B (en) | 2023-07-28 |
Family
ID=72007634
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010327053.XA Active CN111552438B (en) | 2020-04-23 | 2020-04-23 | Method, device, server and storage medium for writing object |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111552438B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113626404A (en) * | 2021-06-30 | 2021-11-09 | 济南浪潮数据技术有限公司 | Method, device and medium for controlling nested directory quota of distributed file system |
CN114461571A (en) * | 2021-12-24 | 2022-05-10 | 天翼云科技有限公司 | A kind of quota method and device based on network file system |
CN115617747A (en) * | 2022-12-16 | 2023-01-17 | 新华三信息技术有限公司 | File storage method, device and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064639A (en) * | 2012-12-28 | 2013-04-24 | 华为技术有限公司 | Method and device for storing data |
CN104750558A (en) * | 2013-12-31 | 2015-07-01 | 伊姆西公司 | Resource allocation management method and device of hierarchical quota system |
CN105159968A (en) * | 2015-08-25 | 2015-12-16 | 浪潮(北京)电子信息产业有限公司 | Directory management method for file system and client |
CN107562386A (en) * | 2017-09-13 | 2018-01-09 | 郑州云海信息技术有限公司 | A kind of method for writing data and device of distributed storage cluster |
CN109783467A (en) * | 2019-01-12 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of nested directory file number quota setting method of distributed file system |
-
2020
- 2020-04-23 CN CN202010327053.XA patent/CN111552438B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064639A (en) * | 2012-12-28 | 2013-04-24 | 华为技术有限公司 | Method and device for storing data |
CN104750558A (en) * | 2013-12-31 | 2015-07-01 | 伊姆西公司 | Resource allocation management method and device of hierarchical quota system |
CN105159968A (en) * | 2015-08-25 | 2015-12-16 | 浪潮(北京)电子信息产业有限公司 | Directory management method for file system and client |
CN107562386A (en) * | 2017-09-13 | 2018-01-09 | 郑州云海信息技术有限公司 | A kind of method for writing data and device of distributed storage cluster |
CN109783467A (en) * | 2019-01-12 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of nested directory file number quota setting method of distributed file system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113626404A (en) * | 2021-06-30 | 2021-11-09 | 济南浪潮数据技术有限公司 | Method, device and medium for controlling nested directory quota of distributed file system |
CN113626404B (en) * | 2021-06-30 | 2024-02-13 | 济南浪潮数据技术有限公司 | Control method, device and medium for nested directory quota of distributed file system |
CN114461571A (en) * | 2021-12-24 | 2022-05-10 | 天翼云科技有限公司 | A kind of quota method and device based on network file system |
CN115617747A (en) * | 2022-12-16 | 2023-01-17 | 新华三信息技术有限公司 | File storage method, device and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111552438B (en) | 2023-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8751763B1 (en) | Low-overhead deduplication within a block-based data storage | |
CN108460045B (en) | Snapshot processing method and distributed block storage system | |
EP3229142B1 (en) | Read cache management method and device based on solid state drive | |
KR102050725B1 (en) | Computing system and method for managing data in the system | |
CN108733306B (en) | A file merging method and device | |
US10353636B2 (en) | Write filter with dynamically expandable overlay | |
CN111723056B (en) | Small file processing method, device, equipment and storage medium | |
CN112214420B (en) | Data caching method, storage control device and storage equipment | |
CN108121813B (en) | Data management method, device, system, storage medium and electronic equipment | |
WO2018171296A1 (en) | File merging method and controller | |
CN111552438B (en) | Method, device, server and storage medium for writing object | |
CN113704027B (en) | File aggregation compatible method, apparatus, computer device and storage medium | |
CN105677243A (en) | Data writing device and method | |
CN109804359A (en) | For the system and method by write back data to storage equipment | |
CN111198856A (en) | File management method and device, computer equipment and storage medium | |
CN104102695A (en) | Data processing method and smart device in startup process of smart device | |
CN108874930A (en) | File attribute information statistical method, device, system, equipment and storage medium | |
CN111382011B (en) | A file data access method, device and computer-readable storage medium | |
CN113157600A (en) | Space allocation method of shingled hard disk, file storage system and server | |
US9009204B2 (en) | Storage system | |
KR20140042431A (en) | Computing system and method for managing data in the system | |
KR102071072B1 (en) | Method for managing of memory address mapping table for data storage device | |
CN107341227B (en) | File processing method, server and computer readable storage medium | |
CN114546340A (en) | Method, apparatus, device and medium for implementing barrel recycle bin for object storage | |
CN114443583A (en) | Method, device and equipment for arranging fragment space and storage medium |
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 | ||
TR01 | Transfer of patent right |
Effective date of registration: 20241127 Address after: 31a, 15 / F, building 30, maple mall, bangrang Road, Brazil, Singapore Patentee after: Baiguoyuan Technology (Singapore) Co.,Ltd. Country or region after: Singapore Address before: 5-13 / F, West Tower, building C, 274 Xingtai Road, Shiqiao street, Panyu District, Guangzhou, Guangdong 510000 Patentee before: GUANGZHOU BAIGUOYUAN INFORMATION TECHNOLOGY Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |