WO2014019145A1 - 一种元数据的处理方法和装置 - Google Patents

一种元数据的处理方法和装置 Download PDF

Info

Publication number
WO2014019145A1
WO2014019145A1 PCT/CN2012/079443 CN2012079443W WO2014019145A1 WO 2014019145 A1 WO2014019145 A1 WO 2014019145A1 CN 2012079443 W CN2012079443 W CN 2012079443W WO 2014019145 A1 WO2014019145 A1 WO 2014019145A1
Authority
WO
WIPO (PCT)
Prior art keywords
metadata
stored
operations
directory file
file
Prior art date
Application number
PCT/CN2012/079443
Other languages
English (en)
French (fr)
Inventor
何静波
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/079443 priority Critical patent/WO2014019145A1/zh
Priority to CN201280002687.1A priority patent/CN103210389B/zh
Publication of WO2014019145A1 publication Critical patent/WO2014019145A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing metadata.
  • the data processed by the computer storage system includes two types: one is the data used by the user, that is, the data content; the other is the data used by the storage system to manage the data, that is, the metadata.
  • the metadata after the operation needs to be stored on the storage medium.
  • the original metadata can be overwritten with the modified metadata directly on the storage medium at the address where the metadata is stored.
  • this operation can result in a large amount of unnecessary disk I / O (I nput / Output , input / output), which will eventually reduce the efficiency of metadata writing.
  • Embodiments of the present invention provide a method and an apparatus for processing metadata, which can improve the writing efficiency of metadata.
  • An aspect of the present invention provides a method for processing metadata, the method comprising: obtaining a sum of a number of metadata operations stored in a directory file and a number of metadata operations not yet stored in the directory file, and obtaining valid at the same time Number of metadata;
  • the storage is not yet stored
  • the metadata operations to the directory file are continuously stored at the address of the directory file in accordance with the operation timing.
  • Another aspect of the present invention provides a server, where the server includes: a processing unit, configured to obtain a sum of a number of metadata operations stored in the directory file and a number of metadata operations not yet stored in the directory file, and to obtain a valid number of metadata;
  • a storage unit configured to delete when the ratio of the number of metadata operations stored in the directory file and the number of metadata operations not yet stored to the directory file to the number of valid metadata exceeds a set threshold a metadata operation of the directory file storage, wherein the adding operation of the valid metadata is continuously stored at an address of the directory file;
  • the storage unit when the ratio of the number of metadata operations stored in the directory file and the number of metadata operations not yet stored to the directory file and the number of valid metadata does not exceed a set threshold, The metadata operations that have not been stored to the directory file are continuously stored at the address of the directory file in accordance with the operation timing.
  • the metadata processing method and apparatus provided by the embodiments of the present invention, on the one hand, in the disk access, the metadata operation is continuously stored in the directory file address, on the other hand, only the effective element is needed. Data is added to the catalog file by adding operations to add metadata to the catalog file without causing a lot of unnecessary disk I/O. Combining the above two aspects can improve the efficiency of metadata writing.
  • FIG. 1 is a flowchart of a method for processing metadata according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of metadata processing according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of metadata processing according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of a server according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for processing metadata according to an embodiment of the present invention.
  • an embodiment of the present invention provides a method for processing metadata, where the method includes:
  • the metadata operation When a metadata operation is generated, the metadata operation is stored in a catalog file. In the embodiment of the present invention, the metadata operation is continuously stored at the address of the directory file.
  • the metadata operation is generated and not yet stored to the catalog file, the sum of the number of metadata operations already stored in the catalog file and the number of metadata operations that have been generated but not yet stored in the catalog file are obtained.
  • the "effective metadata” refers to metadata that is still meaningful after a metadata operation by the metadata operation.
  • the valid metadata of the metadata M1 after being modified into a ⁇ operation is ⁇ .
  • the metadata M1, M2, after the operation of deleting the M1, the metadata M1 deletion operation is stored in the directory file, that is, "delete ⁇ ", then the metadata M1, M2 is deleted after the M1 operation, and the effective metadata is M2, when reading In the case of metadata, the record is manipulated according to the metadata, and the metadata is considered to have been deleted.
  • the metadata operation includes at least one of a metadata addition operation, a metadata modification operation, or a metadata deletion operation.
  • the directory file provided in the embodiment of the present invention and the following method and device embodiment is used to store metadata operations, and the corresponding metadata can be parsed according to the metadata operation stored in the directory file.
  • the "set threshold" can be set as needed, for example, 200%, 150%, etc., which is not limited by the present invention.
  • the continuously storing the metadata operation that has not been stored in the directory file on the address of the directory file according to the operation sequence specifically includes:
  • the metadata operations that have not been stored in the directory file are successively stored at the address of the directory file in a manner of chasing writes in accordance with the operation timing.
  • the operation timing according to the metadata in the implementation of the present invention refers to the order in which the results of the metadata operations occur.
  • Continuous storage on the address of the directory file in an additional write operation means that the metadata operation is continuously stored at the next address of the address of the last metadata operation stored in the directory file.
  • the metadata operations may include a metadata addition operation, a metadata modification operation, and a metadata deletion operation.
  • a metadata addition operation when the metadata is added, a new metadata addition operation is stored in the directory file, and the added metadata is written into the directory file;
  • a metadata modification operation when the metadata modification operation is performed, a metadata modification operation is stored in the directory file, and The modified metadata is written to the directory file; when a metadata is deleted, a metadata deletion operation is stored in the directory file.
  • the method for processing metadata provided by the embodiment of the present invention on the one hand, in the disk access, the metadata operation is consecutively stored in the directory file; on the other hand, only the effective metadata is needed in the manner of adding operations. Adding operations to a directory file does not result in a lot of unnecessary disk I/O. Combining the above two aspects, the efficiency of writing metadata can be improved.
  • M0, M1, M2, M3, and M4 in FIG. 2 represent metadata.
  • an operation of adding metadata M0 that is, "add M0”
  • the next address of the operation of adding the metadata MG stores the operation of adding the metadata M1, and in the same order, the operations of adding the metadata M2, M3, and M4 are sequentially stored.
  • the metadata M 3 is modified, it is not directly modified to M3 at the position of the metadata M3, but the metadata of the metadata M 3 is modified to M3 in the next address storage after the operation of storing the added metadata M4. Modify the operation, ie "Modify M3,".
  • the sum of the number of metadata operations stored in the directory file and the number of metadata operations not yet stored in the directory file is obtained, and the number of valid metadata is obtained, and the "effective metadata" is in the present
  • metadata that is still meaningful after a metadata operation is performed after the metadata operation.
  • M0 is valid metadata
  • M1 is added and modified to ⁇
  • the final valid metadata is ⁇
  • M2 is added It is deleted again, so it is no longer valid metadata.
  • M3 ", M4, and M5 are valid metadata.
  • the set threshold is, for example, 200%, and performs multiple metadata operations: After modifying M1, M3, M4, deleting M2, and adding M5, the number of stored metadata operations is 1 1 , which has been stored in the directory file.
  • the number of metadata operation records in the file is 8.
  • the number of metadata operations that have not been stored in the directory file is 3, and the effective number of elements According to the number 5, the ratio of the number of metadata operations that satisfy the catalog file storage and the number of metadata operations that have not been stored to the catalog file to the number of valid metadata exceeds the set threshold of 200%.
  • the catalog file is deleted. All the metadata operations are stored, and the adding operation of the valid metadata is stored in the directory file.
  • the operation records stored in the directory file are "add M0”, “add Ml”, “add M2”, “Tianlikou M3”, “Tianlikou M4", “Tampered M3,”, “Delete M2,” “Add M5", “Modify ⁇ ”, “Modify M3”” and “Modify M4,” All Delete, save the valid metadata to the catalog file.
  • valid metadata operations can be stored in the directory file in an additive manner, that is, metadata operations: “Add M0", “Add ⁇ ", “Addition M3,,,,” “Addition M4, " , " Add Likou M5 " store directory files.
  • the read operation can be performed.
  • all the metadata operations are sequentially processed in order of the effective metadata operation in the directory file, and all valid metadata is restored.
  • the specific process is as follows:
  • the metadata operation is continuously stored in the directory file address, and on the other hand, only the addition operation of storing the valid metadata is required, which does not cause a large number of unnecessary disks I / O. Combining the above two aspects can improve the efficiency of metadata writing.
  • an embodiment of the present invention further provides a server 40, where the server 40 may include:
  • the processing unit 41 is configured to obtain a sum of the number of metadata operations stored in the directory file and the number of metadata operations not stored in the directory file, and is used to obtain the number of valid metadata.
  • the "effective metadata” refers to metadata that is still meaningful after a metadata operation by the metadata operation.
  • the valid metadata of the metadata M1 after being modified into a ⁇ operation is ⁇ .
  • the metadata Ml, M2, after being deleted by the Ml operation, is recorded as ⁇ , then the metadata Ml, M2 is deleted after the M1 operation and the effective metadata is M2.
  • the storage unit 42 is configured to delete the directory file when the number of metadata operations stored in the directory file and the number of metadata operations not yet stored in the directory file and the number of valid metadata exceed a set threshold a stored metadata operation for continuously storing the valid metadata at the address of the directory file;
  • the storage unit 42 is configured to: when the ratio of the number of metadata operations stored in the directory file and the number of metadata operations not yet stored to the directory file and the number of valid metadata does not exceed a set threshold, Metadata operations that have not been stored to the catalog file are continuously stored at the address of the catalog file in accordance with the operation timing.
  • the metadata operation in the embodiment of the present invention includes at least one of a metadata addition operation, a metadata modification operation, or a metadata deletion operation.
  • the server provided by the embodiment of the present invention on the one hand, continuously stores the metadata operation at the directory file address, and on the other hand, only needs to store the effective metadata addition operation, and does not cause a large amount of unnecessary disk I/O. Combine the above two aspects, you can improve the writing of metadata effectiveness.
  • the storage unit 42 thereof may be specifically configured to: the sum of the number of metadata operations stored in the directory file and the number of metadata operations not yet stored in the directory file and the number of valid metadata When the ratio does not exceed the set threshold, the metadata operation that has not been stored in the directory file is continuously stored at the address of the directory file in an additional write manner according to the operation timing.
  • Continuous storage on the address of the directory file in an additional write operation means that the metadata operation is continuously stored at the next address of the address of the last metadata operation stored in the directory file.
  • the addition operation of the valid metadata is stored to the catalog file.
  • the read operation can be performed.
  • all metadata operations are sequentially parsed in order of the metadata operations in the directory file to restore all valid metadata.
  • the server embodiment corresponds to the metadata processing method described herein, and the metadata processing method has been described in detail in the foregoing embodiments. Therefore, the related content may refer to the foregoing method embodiments, and details are not described herein.
  • each unit included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be implemented; in addition, the specific name of each functional unit It is also for convenience of distinguishing from each other and is not intended to limit the scope of protection of the present invention.
  • the embodiment of the present invention further provides a distributed file system, where the distributed file system includes the server 40 described in any of the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供一种元数据的处理方法,涉及数据处理技术领域,能够提高元数据的写入效率。所述方法包括:获取目录文件存储的元数据操作的数目和尚未存储到所述目录文件的元数据操作的数目之和,同时获取有效元数据数目;当所述目录文件存储的元数据操作的数目和尚未存储到所述目录文件的元数据操作的数目之和与所述有效元数据数目的比例超过设定的阈值时,删除所述目录文件存储的元数据操作,在所述目录文件的地址上连续存储所述有效元数据的添加操作;否则,将所述尚未存储到所述目录文件的元数据操作按照操作时序在所述目录文件的地址上连续存储。本发明实施例还提供相应的装置。

Description

一种元数据的处理方法和装置 技术领域
本发明涉及数据处理技术领域, 尤其涉及一种元数据的处理方法 和装置。
背景技术
计算机存储系统处理的数据包括两类: 一类是用户使用的数据, 即数据内容; 另一类是存储系统用于管理数据的数据, 即元数据。
当对一个元数据进行操作时, 需要在存储介质上存储该操作后的 元数据。 例如, 当对一个元数据进行修改时, 可以直接在存储介质上存 储该元数据的地址上用修改后的元数据覆盖原来的元数据。但是这样操 作会导致大量不必要的磁盘 I /O (I nput /Out put , 输入 /输出), 最终会 导致降低元数据写入效率。
发明内容
本发明实施例提供一种元数据的处理方法和装置, 能够提高元数 据的写入效率。
为达到上述目的, 本发明的实施例采用如下技术方案:
本发明的一方面, 提供一种元数据的处理方法, 所述方法包括: 获取目录文件存储的元数据操作的数目和尚未存储到所述目录文 件的元数据操作的数目之和, 同时获取有效元数据数目;
当所述目录文件存储的元数据操作的数目和尚未存储到所述目录 文件的元数据操作的数目之和与所述有效元数据数目的比例超过设定 的阈值时, 删除所述目录文件存储的元数据操作,在所述目录文件的地 址上连续存储所述有效元数据的添加操作;
当所述目录文件存储的元数据操作的数目和尚未存储到所述目录 文件的元数据操作的数目之和与所述有效元数据数目的比例未超过设 定的阈值时,将所述尚未存储到所述目录文件的元数据操作按照操作时 序在所述目录文件的地址上连续存储。
本发明另一方面, 提供一种服务器, 所述服务器包括: 处理单元,用于获取目录文件存储的元数据操作的数目和尚未存储 到所述目录文件的元数据操作的数目之和,同时用于获取有效元数据数 目;
存储单元,用于当目录文件存储的元数据操作的数目和尚未存储到 所述目录文件的元数据操作的数目之和与所述有效元数据数目的比例 超过设定的阈值时, 删除所述目录文件存储的元数据操作,在所述目录 文件的地址上连续存储所述有效元数据的添加操作;
或者,
所述存储单元,用于当目录文件存储的元数据操作的数目和尚未存 储到所述目录文件的元数据操作的数目之和与有效元数据数目的比例 未超过设定的阈值时,将所述尚未存储到所述目录文件的元数据操作按 照操作时序在所述目录文件的地址上连续存储。
采用上述技术方案后, 本发明实施例提供的元数据的处理方法和 装置, 一方面, 由于在磁盘访问中, 将元数据操作在目录文件地址连续 地存储, 另一方面, 只需要将有效元数据以添加操作的方式将有效元数 据的添加操作存储到目录文件, 不会导致大量不必要的磁盘 I /O。 结合 上述两个方面, 可以提高元数据的写入效率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种元数据的处理方法的流程图; 图 2为本发明实施例提供的元数据处理的示意图;
图 3为本发明实施例提供的元数据处理的示意图;
图 4为本发明实施例提供的服务器的一结构图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例的技术方案 进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明的一部分 实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技 术人员在没有做出创造性劳动的前提下所获得的所有其它实施例,都属 于本发明保护的范围。
图 1是本发明实施例提供的一种元数据的处理方法的流程图。参照 图 1 , 本发明实施例提供一种元数据的处理方法, 所述方法包括:
1 1、获取目录文件存储的元数据操作的数目和尚未存储到所述目录 文件的元数据操作的数目之和, 同时获取有效元数据数目。
生成元数据操作时, 会将该元数据操作存储到目录文件中。本发明 实施例中, 元数据操作在目录文件的地址上连续存储。 当生成元数据操 作, 尚未存储到目录文件时, 获取目录文件中已经存储的元数据操作的 数目和该已经生成但尚未存储到目录文件中的元数据操作数目之和。
所述 "有效元数据"在本发明实施例中是指, 一个元数据经过元数 据操作之后仍有实际意义的元数据。 例如, 元数据 Ml在经过被修改为 ΜΓ 操作之后的有效元数据为 ΜΓ 。 元数据 Ml、 M2 , 在经过删除 Ml 操作之后, 在目录文件中存储元数据 Ml删除操作, 即 "删除 ΜΓ " , 则元数据 Ml、 M2经过删除 Ml操作后有效元数据为 M2 , 当读取元数据 时, 根据元数据操作记录, 认为该元数据已经删除。
所述元数据操作至少包括元数据添加操作、元数据修改操作或元数 据删除操作中的一种。
本发明实施例以及后面的方法、装置实施例中提供的目录文件用来 存储元数据操作,根据目录文件存储的元数据操作, 可以解析出对应的 元数据。
12、当所述目录文件存储的元数据操作的数目和尚未存储到所述目 录文件的元数据操作的数目之和与所述有效元数据数目的比例超过设 定的阈值时,删除所述目录文件存储的元数据操作, 在所述目录文件的 地址上连续存储所述有效元数据的添加操作。
在本发明实施例中, 所述 "设定的阈值" 可根据需要进行设定, 例 如为 200%、 150%等, 本发明对此不作限定。
1 3、当所述目录文件存储的元数据操作的数目和尚未存储到所述目 录文件的元数据操作的数目之和与所述有效元数据数目的比例未超过 设定的阈值时,将所述尚未存储到所述目录文件的元数据操作按照操作 时序在所述目录文件的地址上连续存储。
进一步地,所述将所述尚未存储到所述目录文件的元数据操作按照 操作时序在所述目录文件的地址上连续存储具体包括:
将所述尚未存储到所述目录文件的元数据操作按照操作时序以追 加写的方式在所述目录文件的地址上连续存储。
本发明实施中按照元数据操作时序是指按照元数据操作结果发生 的先后顺序。
以追加写的方式在目录文件的地址上连续存储是指在目录文件当 前存储的最后一个元数据操作的地址的下一个地址上连续存储元数据 操作。
所述元数据操作可包括元数据添加操作、 元数据修改操作和元数据 删除操作。 其中, 元数据添加操作时, 在目录文件中存储一个新的元数 据添加操作, 并将添加的元数据写入目录文件; 元数据修改操作时, 在 目录文件中存储一个元数据修改操作, 并将修改后的元数据写入目录文 件; 删除一个元数据时, 在目录文件中存储一个元数据删除操作。
本发明实施例提供的元数据的处理方法, 一方面, 由于在磁盘访问 中, 元数据操作是地址连续的存储到目录文件的; 另一方面, 只需要以 添加操作的方式将有效元数据的添加操作存储到目录文件, 不会导致大 量不必要的磁盘 I /O。 结合上述两个方面, 可以提高元数据的写入效率。
下面结合图 2至图 3对本发明实施例进行进一步说明。
首先参照图 2 , 图 2中的 M0、 Ml、 M2、 M3和 M4表示元数据, 由图 2可知,首先,在目录文件存储了添加元数据 M0的操作, 即 "添加 M0" , 然后在存储添加元数据 MG 的操作的下一个地址存储添加元数据 Ml 操 作, 同理依次存储了添加元数据 M2、 M3、 M4操作。 修改元数据 M 3时, 并不直接在元数据 M3 的位置将其修改成 M3, ,而是在存储添加元数据 M4操作之后的下一个地址存储将元数据 M 3修改成 M3, 的元数据修改操 作, 即 "修改 M 3, " 。 删除元数据 M2时, 在存储 "修改 M3, " 的下一 个地址存储删除元数据 M2操作, 即 "删除 M2 " 。 添加元数据 M5时, 在存储 "删除 M2 " 地址的下一个地址存储添加元数据 M5操作, 即存储 "添加 M5 " 。 后续执行多个元数据操作: 修改 Ml、 M3、 M4时, 同理, 在操作添加 M5之后的连续三个地址执行写内容, 存储相应的元数据操 作, 即存储将 Ml修改成 ΜΓ 、 将 M3, 修改成 M3 "和将 M4修改为 M4, 的操作, 分别表示为 "修改 ΜΓ " 、 "修改 M3 " " 和 "修改 M4, " 。 以上描述的元数据操作在目录文件中都是以元数据操作发生的先后时 序依次在目录文件的地址上连续存储的。
在图 2所示过程中,获取目录文件存储的元数据操作的数目和尚未 存储到该目录文件的元数据操作的数目之和, 同时获取有效元数据数 目, 所述 "有效元数据" 在本发明实施例中是指, 一个元数据经过元数 据操作之后仍有实际意义的元数据。 在本发明实施例当中, 元数据 M0 添加之后没有发生任何操作, 则 M0为有效元数据; 元数据 Ml添加后, 又修改为 ΜΓ ,则其最终有效的元数据为 ΜΓ ; 元数据 M2添加后又经 过删除操作, 因此不再是有效的元数据, 同时, M3 "、 M4, 和 M5 为有 效的元数据。当该目录文件存储的元数据操作的数目和尚未存储到该目 录文件的元数据操作的数目之和与有效元数据数目的比例超过设定的 阈值时, 删除该目录文件存储的元数据操作,在该目录文件的地址上连 续存储有效元数据的添加操作。在图 2中,设定的阈值举例而言为 200%, 在执行多个元数据操作: 修改 Ml、 M3、 M4、 删除 M2、 添加 M5后, 存储 的元数据操作的数目为 1 1 , 其中已经存储到目录文件中的元数据操作 记录数为 8 , 经过一次 I /O操作,尚未存储到目录文件的元数据操作数 目为 3 , 有效元数据数目为 5 , 满足目录文件存储的元数据操作数目和 尚未存储到目录文件的元数据操作数目之和与有效元数据数目的比例 超过设定的阈值 2 00% , 此时, 删除该目录文件存储的所有元数据操作, 将有效元数据的添加操作存储到该目录文件。具体到本发明实施例,将 目录文件中存储的操作记录 "添加 M0" 、 "添加 Ml " 、 "添加 M2 " 、 "添力口 M3" 、 "添力口 M4 " 、 "爹改 M3, " 、 "删除 M2, " 、 "添加 M5 " 、 "修改 ΜΓ " 、 "修改 M 3 "" 和 "修改 M4, " 全部删除, 将有 效元数据存储到目录文件。具体地可将有效的元数据操作以添加方式存 储到该目录文件中, 即将元数据操作: "添加 M0" 、 "添加 ΜΓ " 、 "添力口 M3,,,, 、 "添力口 M4, " 、 "添力口 M5 " 存储 目录文件。
存储有效元数据添加操作后, 即可进行读取操作。 在读元数据时, 以有效元数据操作在目录文件中的位置为顺序依次解析所有的元数据 操作, 恢复出所有有效的元数据。 具体过程如下:
按顺序读, 每次读的操作和读完该条记录的结果是:
1、 添力口 M0 M0 2、 添力口 ΜΓ M0、 ΜΓ
3、 添力口 M3" M0、 ΜΓ 、 Μ3"
4、 添力口 M4 ' M0、 ΜΓ 、 Μ3'\
5、 添力口 M5 M0、 ΜΓ 、 Μ3'\ Μ4 ' 、 Μ5
后续过程可依此类推。
如图 2所示, 当进行添加元数据 Μ5操作之后, 即在目录文件存储 "删除 Μ2 " 的下一个地址存储 "添加 Μ5" 操作后, 存储目录文件的服 务器发生重启或者其他操作时, 此时没有尚未存储的元数据操作, 虽然 元数据操作的数目与根据该目录文件存储的元数据操作获取的有效元 数据数目的比例没有达到上述实施例设定的 200% , 但是需要解析出元 数据。 因此, 需要根据目录文件存储的元数据操作记录解析出元数据, 即以元数据操作在目录文件中的位置为顺序依次解析所有的元数据操 作,后面的元数据操作会覆盖前面该元数据操作, 恢复出所有有效的元 数据。 具体过程如下:
按顺序读, 每次读的操作和读完该条记录的结果是:
1、 添力口 Μ0 M0
2、 添力口 Ml M0、 Ml
3、 添力口 M2 M0、 Ml、 M2
4、 添力口 M3 M0、 Ml、 M2、 M3
5、 添力口 M4 M0、 Ml、 M2、 M3、
6、 修改 M3, , 覆盖 M3 M0、 Ml
7、 删除 M2 , 删除 M2对应的元数据 Μ0、 Μ1、 Μ3 ' 、 Μ4
8、 添力口 Μ5 Μ0、 Μ1、 Μ3 ' 、 Μ4、 Μ5。
采用本发明提供的元数据处理方法后, 一方面, 将元数据操作在目 录文件地址连续地存储,另一方面,只需要存储有效元数据的添加操作 , 不会导致大量不必要的磁盘 I /O。 结合上述两个方面, 可以提高元数据 的写入效率。
下面参照图 3 , 由图 3可知, 在第一次磁盘访问中, 通过以追加写 的方式地址连续地存储元数据操作到目录文件, 执行三个元数据操作: 修改 Ml、 Μ3 , 删除 Μ4 , 并且在目录文件存储 "添力。 Μη" 操作的下一个 地址连续存储 "修改 Ml " 、 "修改 M3" 和 "删除 M4" 操作。 在第二次 磁盘访问中, 修改 M0、 M2 , 添力。 Mn+1 , 通过以追加写的方式在目录文 件中地址连续地存储元数据操作, 即在目录文件存储 "删除 M4 " 操作 的下一个地址连续存储 "修改 M0" 、 "修改 M2 "和 "添加 Μη+Γ,操作。 。 其中, 在第一次磁盘访问中, 写了三个元数据, 寻址 1次; 在第二次磁 盘访问中,写了三个元数据,寻址 1次。相比于现有元数据的处理方法, 大大提高了元数据的写速度。
可见, 采用本发明实施例的方案后,将元数据通过修改或者删除而 固化到存储介质中时, 不会导致大量的不连续写操作, 同时也不会导致 大量不必要的磁盘 I /O , 提高了元数据写的效率。
与上述方法实施例相对应, 参照图 4 , 本发明实施例还提供一种服 务器 40 , 所述服务器 40可包括:
处理单元 41 , 用于获取目录文件存储的元数据操作的数目和尚未 存储到所述目录文件的元数据操作的数目之和,同时用于获取有效元数 据数目。
所述 "有效元数据"在本发明实施例中是指, 一个元数据经过元数 据操作之后仍有实际意义的元数据。 例如, 元数据 Ml在经过被修改为 ΜΓ 操作之后的有效元数据为 ΜΓ 。 元数据 Ml、 M2 , 在经过删除 Ml 操作之后, 记为 ΜΓ ,则元数据 Ml、 M2经过删除 Ml操作后有效元数据 为 M2。
存储单元 42 , 用于当目录文件存储的元数据操作的数目和尚未存 储到所述目录文件的元数据操作的数目之和与有效元数据数目的比例 超过设定的阈值时, 删除该目录文件存储的元数据操作,在该目录文件 的地址上连续存储该有效元数据的添加操作;
或者,
存储单元 42 , 用于当该目录文件存储的元数据操作的数目和尚未 存储到所述目录文件的元数据操作的数目之和与有效元数据数目的比 例未超过设定的阈值时,将该尚未存储到所述目录文件的元数据操作按 照操作时序在该目录文件的地址上连续存储。
本发明实施例中的元数据操作至少包括元数据添加操作、 元数据 修改操作或元数据删除操作中的一种。
本发明实施例提供的服务器, 一方面, 将元数据操作在目录文件地 址连续地存储, 另一方面, 只需要存储有效元数据的添加操作, 不会导 致大量不必要的磁盘 I /O。 结合上述两个方面, 可以提高元数据的写入 效率。
在一个实施例中提供的服务器, 其存储单元 42可具体用于: 当目录文件存储的元数据操作的数目和尚未存储到所述目录文件 的元数据操作的数目之和与有效元数据数目的比例未超过设定的阈值 时,将该尚未存储到该目录文件的元数据操作按照操作时序以追加写的 方式在所述目录文件的地址上连续存储。
以追加写的方式在目录文件的地址上连续存储是指在目录文件当 前存储的最后一个元数据操作的地址的下一个地址上连续存储元数据 操作。
这样保证在存储元数据操作时访问目录文件地址的连续性,减少寻 址时间。
将有效元数据的添加操作存储到所述目录文件。从而在有效元数据 添加操作存储后, 即可进行读取操作。 在读有效元数据添加操作时, 以 元数据操作在目录文件中的位置为顺序依次解析所有的元数据操作恢 复出所有有效的元数据。
服务器实施例与本文中所述元数据处理方法相对应, 且前面实施 例已对元数据处理方法进行了详细描述,因而相关内容可参照前面方法 实施例, 在此不作贅述。
值得注意的是, 上述服务器实施例中, 所包括的各个单元只是按 照功能逻辑进行划分的,但并不局限于上述的划分, 只要能够实现相应 的功能即可; 另外, 各功能单元的具体名称也只是为了便于相互区分, 并不用于限制本发明的保护范围。
此外, 本发明实施例还提供一种分布式文件系统, 所述分布式文 件系统中包含有上面任一实施例所述的服务器 40。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步 骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算 机可读存储介质中, 所述存储介质可以是只读存储器、 磁盘或光盘等。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并 不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围 内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应以权利要求的保护范围为准。

Claims

权利 要求 书
1、 一种元数据的处理方法, 其特征在于, 所述方法包括:
获取目录文件存储的元数据操作的数目和尚未存储到所述目录文件 的元数据操作的数目之和, 同时获取有效元数据数目;
当所述目录文件存储的元数据操作的数目和尚未存储到所述目录文 件的元数据操作的数目之和与所述有效元数据数目的比例超过设定的阈 值时, 删除所述目录文件存储的元数据操作, 在所述目录文件的地址上 连续存储所述有效元数据的添加操作;
当所述目录文件存储的元数据操作的数目和尚未存储到所述目录文 件的元数据操作的数目之和与所述有效元数据数目的比例未超过设定的 阈值时, 将所述尚未存储到所述目录文件的元数据操作按照操作时序在 所述目录文件的地址上连续存储。
2、 根据权利要求 1所述的方法, 其特征在于,
所述将所述尚未存储到所述目录文件的元数据操作按照操作时序在 所述目录文件的地址上连续存储具体包括:
将所述尚未存储到所述目录文件的元数据操作按照操作时序以追加 写的方式在所述目录文件的地址上连续存储。
3、 根据权利要求 1所述的方法, 其特征在于, 所述元数据操作至少 包括元数据添加操作、 元数据修改操作或元数据删除操作中的一种。
4、 一种服务器, 其特征在于, 包括:
处理单元, 用于获取目录文件存储的元数据操作的数目和尚未存储 到所述目录文件的元数据操作的数目之和, 同时用于获取有效元数据数 目;
存储单元, 用于当目录文件存储的元数据操作的数目和尚未存储到 所述目录文件的元数据操作的数目之和与所述有效元数据数目的比例超 过设定的阈值时, 删除所述目录文件存储的元数据操作,在所述目录文件 的地址上连续存储所述有效元数据的添加操作;
或者,
所述存储单元, 用于当目录文件存储的元数据操作的数目和尚未存 储到所述目录文件的元数据操作的数目之和与有效元数据数目的比例未 超过设定的阈值时, 将所述尚未存储到所述目录文件的元数据操作按照 操作时序在所述目录文件的地址上连续存储。
5、 根据权利要求 4所述的服务器, 其特征在于, 所述存储单元, 具 体用于:
当目录文件存储的元数据操作的数目和尚未存储到所述目录文件的 元数据操作的数目之和与有效元数据数目的比例未超过设定的阈值时, 将所述尚未存储到所述目录文件的元数据操作按照操作时序以追加写的 方式在所述目录文件的地址上连续存储。
6、 根据权利要求 4所述的服务器, 其特征在于, 所述元数据操作至 少包括元数据添加操作、 元数据修改操作或元数据删除操作中的一种。
PCT/CN2012/079443 2012-07-31 2012-07-31 一种元数据的处理方法和装置 WO2014019145A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/079443 WO2014019145A1 (zh) 2012-07-31 2012-07-31 一种元数据的处理方法和装置
CN201280002687.1A CN103210389B (zh) 2012-07-31 2012-07-31 一种元数据的处理方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/079443 WO2014019145A1 (zh) 2012-07-31 2012-07-31 一种元数据的处理方法和装置

Publications (1)

Publication Number Publication Date
WO2014019145A1 true WO2014019145A1 (zh) 2014-02-06

Family

ID=48756621

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/079443 WO2014019145A1 (zh) 2012-07-31 2012-07-31 一种元数据的处理方法和装置

Country Status (2)

Country Link
CN (1) CN103210389B (zh)
WO (1) WO2014019145A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10641491B2 (en) 2016-03-25 2020-05-05 General Electric Company Cooling of integrated combustor nozzle of segmented annular combustion system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180058327A (ko) * 2016-11-24 2018-06-01 에스케이하이닉스 주식회사 컨트롤러, 메모리 시스템 및 그의 동작 방법
CN110837516A (zh) * 2019-11-07 2020-02-25 恩亿科(北京)数据科技有限公司 数据割接方法、装置、计算机设备和可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281542A (zh) * 2008-05-09 2008-10-08 华为技术有限公司 一种文件存储方法及装置
CN101382948A (zh) * 2008-10-14 2009-03-11 成都市华为赛门铁克科技有限公司 一种文件存储方法、装置和系统
US8082235B1 (en) * 2009-04-09 2011-12-20 Google Inc. Self healing system for inaccurate metadata

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814044B (zh) * 2010-04-19 2013-03-20 中兴通讯股份有限公司 元数据处理方法及装置
CN102567445B (zh) * 2011-10-25 2014-07-02 无锡城市云计算中心有限公司 一种分布式文件系统中保证元数据一致性的方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281542A (zh) * 2008-05-09 2008-10-08 华为技术有限公司 一种文件存储方法及装置
CN101382948A (zh) * 2008-10-14 2009-03-11 成都市华为赛门铁克科技有限公司 一种文件存储方法、装置和系统
US8082235B1 (en) * 2009-04-09 2011-12-20 Google Inc. Self healing system for inaccurate metadata

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10641491B2 (en) 2016-03-25 2020-05-05 General Electric Company Cooling of integrated combustor nozzle of segmented annular combustion system

Also Published As

Publication number Publication date
CN103210389A (zh) 2013-07-17
CN103210389B (zh) 2016-08-10

Similar Documents

Publication Publication Date Title
US9703640B2 (en) Method and system of performing incremental SQL server database backups
JP2006510984A (ja) 事前設定されたバックアップ用dvd−rws
US11227635B2 (en) Recording device, readout device, recording method, recording program, readout method, readout program, and magnetic tape
JP2002354423A5 (zh)
JP5833754B2 (ja) ファイルシステムをクリーニングするための方法及び装置並びにその記憶媒体
US8478933B2 (en) Systems and methods for performing deduplicated data processing on tape
WO2013170702A1 (zh) 基于快照的文件处理方法及具有快照功能的固态硬盘
US11327998B2 (en) Replication between heterogeneous storage systems
CN105302488A (zh) 一种存储系统的数据写入方法及系统
WO2014019145A1 (zh) 一种元数据的处理方法和装置
JP2015090655A (ja) LTFS(LinearTapeFileSystem)によって実現するWORMカートリッジのサポート
US20080313385A1 (en) Process for contiguously streaming data from a content addressed storage system
US9009430B2 (en) Restoration of data from a backup storage volume
TWI431482B (zh) A method of copying data to a plurality of random access storage devices
US9032169B2 (en) Method for high performance dump data set creation
JP2008269520A (ja) 記録装置及び記録方法
KR102003432B1 (ko) 감시 시스템의 영상 관리 장치 및 방법
JP4984677B2 (ja) 情報処理装置
CN102799798A (zh) 一种计算机系统全盘还原环境下写入不还原的方法
Jung et al. Block Link file system supporting fast editing/writing for large-sized multimedia files in multimedia devices
JP2010211880A (ja) ディスクドライブ装置、その制御方法、プログラム、及び、記録媒体
CN1841543B (zh) 记录再生控制装置、内容管理方法以及记录再生装置
US20220114147A1 (en) Information processing apparatus, information processing method, and information processing program
JP2006018426A (ja) データ処理装置及びデータ転送方法
JP2011113626A (ja) 記録再生装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12882392

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12882392

Country of ref document: EP

Kind code of ref document: A1