CN104239511B - A kind of user's space file system implementation method towards MongoDB - Google Patents

A kind of user's space file system implementation method towards MongoDB Download PDF

Info

Publication number
CN104239511B
CN104239511B CN201410469287.2A CN201410469287A CN104239511B CN 104239511 B CN104239511 B CN 104239511B CN 201410469287 A CN201410469287 A CN 201410469287A CN 104239511 B CN104239511 B CN 104239511B
Authority
CN
China
Prior art keywords
node
field
directory
file
mongodb database
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.)
Expired - Fee Related
Application number
CN201410469287.2A
Other languages
Chinese (zh)
Other versions
CN104239511A (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.)
SHANGHAI WONDERTEK SOFTWARE CO Ltd
Xian Jiaotong University
Original Assignee
SHANGHAI WONDERTEK SOFTWARE CO Ltd
Xian Jiaotong University
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 SHANGHAI WONDERTEK SOFTWARE CO Ltd, Xian Jiaotong University filed Critical SHANGHAI WONDERTEK SOFTWARE CO Ltd
Priority to CN201410469287.2A priority Critical patent/CN104239511B/en
Publication of CN104239511A publication Critical patent/CN104239511A/en
Application granted granted Critical
Publication of CN104239511B publication Critical patent/CN104239511B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • G06F16/212Schema design and management with details for data modelling support
    • 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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2264Multidimensional index structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

The invention discloses a kind of user's space file system implementation method towards MongoDB, comprise the following steps: build the fs.nodes set being used for store files bibliographic structure information and node metadata information, do you create MongoDB again? GridFS storage file, simultaneously at establishment MongoDB? automatically generate in the process of GridFS storage file and gather for the fs.files set of storage file metadata information and the fs.chunks for store file data information, gathered by fs.nodes in the establishment of Linux file system and MongoDB database realizing node and delete procedure, fs.files set and fs.chunks set associative, concrete, directory node and fs.nodes gather interrelated, Archive sit and fs.nodes gather, fs.files set and fs.chunks set element interrelated, set membership between node and node determined by the link structure of fs.nodes, the present invention supports directory operation, and have that to take storage space few, read-write efficiency advantages of higher.

Description

A kind of user's space file system implementation method towards MongoDB
Technical field
The invention belongs to cloud field of storage, relate to a kind of user's space file system implementation method, be specifically related to a kind of user's space file system implementation method towards MongoDB.
Background technology
Under the historical background of large data, storage problem becomes the focus of academia and industrial community again, and traditional techniques and methods has been difficult to tackle the new challenge brought by the sharp increase of data volume.Cloud stores just in this context in the conceptive extension of cloud computing and the new concept of development out one, refer to by functions such as cluster application, gridding technique or distributed file systems, various dissimilar memory device a large amount of in network is gathered collaborative work by application software, a system of data storage and Operational Visit function is externally provided jointly.Beyond the clouds, various memory device is got up (for MongoDB cluster server) by application integration management, the stores service that user uses terminal (PC, mobile phone etc.) to be provided by internet access high in the clouds.
User's space file system (FilesysteminUserspace is called for short FUSE) refers to completely in the file system that User space realizes.It facilitates developer's file system that easily customization is new under the prerequisite of not touching kernel.
In industrial community, the user's space file system realized based on FUSE is existing a lot, and more well-known has ExpanDrive, GlusterFS, SSHFS etc.
ExpanDrive: be a very practical net dish and cloud service save file management software, the file during user's localization managerial grid dish or cloud can be allowed to store, allows the operations such as file modification, download and deletion become very simple.
GlusterFS: be a large scale file system.It is the combination on various different storage server, and these servers are accessed RDMA by Ethernet or infinite bandwidth technology Infiniband and remote direct memory and merged mutually, final formed a large parallel file system network.
SSHFS: the host resource that SSH can be connected to, in the middle of the file system being mapped to the machine, then user can operate as operation local file, and the file of reality is changed and will be transferred in the middle of distance host by SSH.
In academia, pertinent literature has document 1 and document 2, wherein, document 1 be Deng Hongtao at Jianghan University's journal, the Study on processing method of tree information in the relational database that Vol.38No.2, Jun.2010 deliver; Document 2 is built for Wang, Fang Hongying, Chen Changchuan at Chongqing Normal University's journal, the tree storage policy based on database of a kind of improvement that Vol.24No.4, Oct.2007 deliver.Document 1 describes the concept and characteristics of tree, discuss the relation table structural design scheme of tree structure information in database, compare the multiple disposal route of tree information in relational database, give the table structure adopting auto correlation to map, and in conjunction with recurrence CTE Discussion on Technology the concrete methods of realizing of tree information in relational database.Document 2 discusses the general tree of how to deposit compression in relational database management system, and while safeguarding mass data, reduces data redundancy.The inventive method to the weak point supporting non-relational database, proposes the method storing tree in non-relational database MongoDB for above-mentioned document.
GridFS-Fuse is to a local User space file system by high in the clouds MongoDBGridFS database instance carry.The exploitation that PaulRosania in 2009 attempts it, in announced issue version illustrates, point out that the current unsolved problem of GridFS-Fuse is: do not support directory operation and read-write efficiency to be verified.
Summary of the invention
The object of the invention is to the shortcoming overcoming above-mentioned prior art, provide a kind of user's space file system implementation method towards MongoDB, this implementation method supports directory operation, and has and occupy little space, read-write efficiency advantages of higher.
For achieving the above object, user's space file system implementation method towards MongoDB of the present invention is towards the user's space file system implementation method of MongoDB, it is characterized in that, comprise the following steps: build the fs.nodes set being used for store files bibliographic structure information and node metadata information, recycling MongoDBGridFS storage file, automatically generate in the process utilizing MongoDBGridFS storage file simultaneously and gather for the fs.files set of storage file metadata information and the fs.chunks for store file data information, gathered by fs.nodes in the establishment of Linux file system and MongoDB database realizing node and delete procedure, fs.files set and fs.chunks set associative, concrete, directory node and fs.nodes gather interrelated, Archive sit and fs.nodes gather, fs.files set and fs.chunks gather interrelated, the link structure that set membership between node and node is gathered by fs.nodes determined.
The implication of each field in described fs.nodes set is as follows:
_ id field: for recording the globally unique identifier ID of node, type is Object_id, gives tacit consent to automatic assignment by mongoDB;
Name field: for recording the title of node, type is character string;
Type field: for recording the type of node, type is integer;
Depth field: for recording the degree of depth of node place tree construction, type is integer;
Abs_path field: for recording the absolute path title of node, be the path of root node to present node, type is character string;
Parent_id: for recording the father node ID of node, type is Object_id;
Meta_data: for recording the metadata information of node, type is BSON;
Wherein, each field meanings of meta_data is as follows:
File_id field: for log file ID, type is Object_id, and wherein, when node is file, then file_id field is effective; When node is catalogue, then file_id field is invalid;
Mode field: for recording node visit pattern, type is integer;
Uid field: for recording user id, type is integer;
Gid field: for recording group id, type is integer;
Nlink field: for recording node linking number, type is integer, and when node is file, then nlink field is the linking number of this node; When node is catalogue, then the sub-directory number of nlink field for comprising under this catalogue;
Atime field: for recording the node last access time;
Mtime field: for recording the last modification time of node;
Ctime field: for recording the last status modifier time.
The establishment of described node comprises the establishment of Archive sit and the establishment of directory node.
The establishment of described Archive sit comprises the following steps:
Check whether the required Archive sit created is empty file node, when described Archive sit is empty file node, then close MongoDB database, when described Archive sit is not empty file node, then Linux file system is connected MongoDB database, and in MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required establishment, when having there is this Archive sit in MongoDB database, then close MongoDB database, when there is not this Archive sit in MongoDB database, then create MongoDBGridFS object, by described MongoDBGridFS object by the content of Archive sit write MongoDB database, and obtain file ID, when successfully not obtaining file ID, then directly close MongoDB database, when successfully obtaining file ID, the absolute path name of father node is then calculated according to current absolute path title, and obtain father node ID by the absolute path name inquiry of father node, when the absolute path name inquiry not by father node obtains father node ID, then directly close MongoDB database, when the absolute path name inquiry successfully passing father node obtains father node ID, then fill the value of each field in fs.nodes set, and by this node city MongoDB database, when successfully by this node city MongoDB database time, then complete the establishment of Archive sit, when can not by this node city MongoDB database time, then directly close MongoDB database.
The establishment of described directory node comprises the following steps:
Search whether there is this directory node according to the absolute path title of the directory node of required establishment, when there is this directory node, then close MongoDB database, when there is not this directory node, the absolute path name of father node is then calculated according to current absolute path title, when father node is root directory, then the father node ID of current directory node is set to NULL, then fill the value of each field in present node fs.nodes set, more just this directory node is inserted in MongoDB database;
When father node is not root directory, then obtain father node ID by the absolute path name inquiry of father node, and revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then closing MongoDB database, when successfully revising the value of linking number field in father node, then the father node ID of current directory node being set to NULL, then fill the value of each field in present node fs.nodes set, more just this directory node is inserted in MongoDB database.
The deletion of described node comprises the deletion of Archive sit and the deletion of directory node.
The deletion of described Archive sit comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required deletion, when there is not this Archive sit, then close MongoDB database, when there is this Archive sit, then from fs.nodes set, delete this Archive sit, when this Archive sit can not be deleted from fs.nodes set, then directly close MongoDB database, when success deletes this Archive sit from fs.nodes set, then create MongoDBGridFS object, from MongoDB database, the fileinfo corresponding to this Archive sit is deleted by this MongoDBGridFS object.
The deletion of described directory node comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this directory node according to the absolute path title of the directory node of required deletion.When there is not this directory node, then close MongoDB database, when there is this directory node, then calculate the father node absolute path title of this directory node, when the father node absolute path name of this directory node is called root directory, then close MongoDB database, when the father node absolute path title of directory node is not root directory, then revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then close MongoDB database, when successfully revising the value of linking number field in father node, then for all child nodes of present node, according to sub-node type, the Step1-Step6 that Step1-Step5 in recursive call deleted file node or recursive call deltree in node.
The present invention has following beneficial effect:
User's space file system implementation method towards MongoDB of the present invention is gathered interrelated by directory node and fs.nodes, Archive sit and fs.nodes gather, fs.files set and fs.chunks set element interrelated, set membership between node and node determined by the link structure of fs.nodes, thus realize deletion and the establishment of node, and it is few to take storage space, search efficiency is high, gathered by fs.nodes and not only have recorded internodal incidence relation, also have recorded the metadata information of node self simultaneously, with respectively incidence relation between node is compared with to node Metadata design table, save the storage space shared by link field, for the feature of file system distinctive locating file or catalogue step by step by path, this structure can save again the time of reading inquiry intermediate node metadata information well, thus raising search efficiency.
Accompanying drawing explanation
Fig. 1 is the corresponding relation figure in the process of establishment and deletion of node in the present invention;
Fig. 2 is the process flow diagram creating Archive sit in the present invention;
Fig. 3 is that the present invention creaties directory the process flow diagram of node;
Fig. 4 is the process flow diagram of deleted file node of the present invention;
Fig. 5 is that the present invention deltrees the process flow diagram of node.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail:
With reference to figure 1, user's space file system implementation method towards MongoDB of the present invention comprises the following steps: build the fs.nodes set being used for store files bibliographic structure information and node metadata information, recycling MongoDBGridFS storage file, automatically generate in the process utilizing MongoDBGridFS storage file simultaneously and gather for the fs.files set of storage file metadata information and the fs.chunks for store file data information, gathered by fs.nodes in the establishment of Linux file system and MongoDB database realizing node and delete procedure, fs.files set and fs.chunks set associative, concrete, directory node and fs.nodes gather interrelated, Archive sit and fs.nodes gather, fs.files set and fs.chunks set element interrelated, the link structure that set membership between node and node gathers interior element by fs.nodes determined.
The mapping of tree-shaped document directory structure in MongoDB database, fs.files set and fs.chunks set is generated during MongoDBGridFS storage file, be respectively used to storage file metadata information and file data information, wherein the definition of fs.files set and the interior each field of fs.chunks set is respectively as described in table 1 and table 2:
Table 1
Table 2
Field name Value Types Length (byte) Explanation File File
_id Object_id 12 Block id ×
files_id Object_id 12 File id ×
n int 4 Block number ×
data BinData 256*1024 Data ×
The implication of each field in described fs.nodes set is as follows:
_ id field: for recording the globally unique identifier ID of node, type is Object_id, gives tacit consent to automatic assignment by mongoDB;
Name field: for recording the title of node, type is character string;
Type field: for recording the type of node, type is integer;
Depth field: for recording the degree of depth of node place tree construction, type is integer;
Abs_path field: for recording the absolute path title of node, be the path of root node to present node, type is character string;
Parent_id: for recording the father node ID of node, type is Object_id;
Meta_data: for recording the metadata information of node, type is BSON;
Wherein, each field meanings of meta_data is as follows:
File_id field: for log file ID, type is Object_id, and wherein, when node is file, then file_id field is effective; When node is catalogue, then file_id field is invalid;
Mode field: for recording node visit pattern, type is integer;
Uid field: for recording user id, type is integer;
Gid field: for recording group id, type is integer;
Nlink field: for recording node linking number, type is integer, and when node is file, then nlink field is the linking number of this node; When node is catalogue, then the sub-directory number of nlink field for comprising under this catalogue;
Atime field: for recording the node last access time;
Mtime field: for recording the last modification time of node;
Ctime field: for recording the last status modifier time.
The establishment of described node comprises the establishment of Archive sit and the establishment of directory node.
With reference to figure 2, the establishment of described Archive sit comprises the following steps:
Check whether the required Archive sit created is empty file node, when described Archive sit is empty file node, then close MongoDB database, when described Archive sit is not empty file node, then Linux file system is connected MongoDB database, and in MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required establishment, when having there is this Archive sit in MongoDB database, then close MongoDB database, when there is not this Archive sit in MongoDB database, then create MongoDBGridFS object, by described MongoDBGridFS object by the content of Archive sit write MongoDB database, and obtain file ID, when successfully not obtaining file ID, then directly close MongoDB database, when successfully obtaining file ID, the absolute path name of father node is then calculated according to current absolute path title, and obtain father node ID by the absolute path name inquiry of father node, when the absolute path name inquiry not by father node obtains father node ID, then directly close MongoDB database, when the absolute path name inquiry successfully passing father node obtains father node ID, then fill the value of each field in fs.nodes set, and by this node city MongoDB database, when successfully by this node city MongoDB database time, then complete the establishment of Archive sit, when can not by this node city MongoDB database time, then directly close MongoDB database.
With reference to figure 3, the establishment of described directory node comprises the following steps:
Search whether there is this directory node according to the absolute path title of the directory node of required establishment, when there is this directory node, then close MongoDB database, when there is not this directory node, the absolute path name of father node is then calculated according to current absolute path title, when father node is root directory, then the father node ID of current directory node is set to NULL, then fill the value of each field in present node fs.nodes set, more just this directory node is inserted in MongoDB database;
When father node is not root directory, then obtain father node ID by the absolute path name inquiry of father node, and revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then closing MongoDB database, when successfully revising the value of linking number field in father node, then the father node ID of current directory node being set to NULL, then fill the value of each field in present node fs.nodes set, more just this directory node is inserted in MongoDB database.
The deletion of described node comprises the deletion of Archive sit and the deletion of directory node.
With reference to figure 4, the deletion of described Archive sit comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required deletion, when there is not this Archive sit, then close MongoDB database, when there is this Archive sit, then from fs.nodes set, delete this Archive sit, when this Archive sit can not be deleted from fs.nodes set, then directly close MongoDB database, when success deletes this Archive sit from fs.nodes set, then create MongoDBGridFS object, from MongoDB database, the fileinfo corresponding to this Archive sit is deleted by this MongoDBGridFS object.
With reference to figure 5, the deletion of described directory node comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this directory node according to the absolute path title of the directory node of required deletion.When there is not this directory node, then close MongoDB database, when there is this directory node, then calculate the father node absolute path title of this directory node, when the father node absolute path name of this directory node is called root directory, then close MongoDB database, when the father node absolute path title of directory node is not root directory, then revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then close MongoDB database, when successfully revising the value of linking number field in father node, then for all child nodes of present node, according to sub-node type, the Step1-Step6 that Step1-Step5 in recursive call deleted file node or recursive call deltree in node.

Claims (2)

1. the user's space file system implementation method towards MongoDB, it is characterized in that, comprise the following steps: build the fs.nodes set being used for store files bibliographic structure information and node metadata information, recycling MongoDBGridFS storage file, automatically generate in the process utilizing MongoDBGridFS storage file simultaneously and gather for the fs.files set of storage file metadata information and the fs.chunks for store file data information, gathered by fs.nodes in the establishment of Linux file system and MongoDB database realizing node and delete procedure, fs.files set and fs.chunks set associative, concrete, directory node and fs.nodes gather interrelated, Archive sit and fs.nodes gather, fs.files set and fs.chunks gather interrelated, the link structure that set membership between node and node is gathered by fs.nodes determined,
The establishment of described node comprises the establishment of Archive sit and the establishment of directory node;
The establishment of described Archive sit comprises the following steps:
Check whether the required Archive sit created is empty file node, when described Archive sit is empty file node, then close MongoDB database, when described Archive sit is not empty file node, then Linux file system is connected MongoDB database, and in MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required establishment, when having there is this Archive sit in MongoDB database, then close MongoDB database, when there is not this Archive sit in MongoDB database, then create MongoDBGridFS object, by described MongoDBGridFS object by the content of Archive sit write MongoDB database, and obtain file ID, when successfully not obtaining file ID, then directly close MongoDB database, when successfully obtaining file ID, the absolute path name of father node is then calculated according to current absolute path title, and obtain father node ID by the absolute path name inquiry of father node, when the absolute path name inquiry not by father node obtains father node ID, then directly close MongoDB database, when the absolute path name inquiry successfully passing father node obtains father node ID, then fill the value of each field in fs.nodes set, and by this node city MongoDB database, when successfully by this node city MongoDB database time, then complete the establishment of Archive sit, when can not by this node city MongoDB database time, then directly close MongoDB database,
The establishment of described directory node comprises the following steps:
Search whether there is this directory node according to the absolute path title of the directory node of required establishment, when there is this directory node, then close MongoDB database, when there is not this directory node, then calculate the absolute path name of father node according to current absolute path title, when father node is root directory, then the father node ID of current directory node is set to NULL, then fill the value of each field in present node fs.nodes set, then this directory node is inserted in MongoDB database;
When father node is not root directory, then obtain father node ID by the absolute path name inquiry of father node, and revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then closing MongoDB database, when successfully revising the value of linking number field in father node, then the father node ID of current directory node being set to NULL, then fill the value of each field in present node fs.nodes set, then this directory node is inserted in MongoDB database;
The deletion of described node comprises the deletion of Archive sit and the deletion of directory node;
The deletion of described Archive sit comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this Archive sit according to the absolute path title of the Archive sit of required deletion, when there is not this Archive sit, then close MongoDB database, when there is this Archive sit, then from fs.nodes set, delete this Archive sit, when this Archive sit can not be deleted from fs.nodes set, then directly close MongoDB database, when success deletes this Archive sit from fs.nodes set, then create MongoDBGridFS object, from MongoDB database, the fileinfo corresponding to this Archive sit is deleted by this MongoDBGridFS object,
The deletion of described directory node comprises the following steps:
Linux file system is connected MongoDB database, search whether there is this directory node according to the absolute path title of the directory node of required deletion, when there is not this directory node, then close MongoDB database, when there is this directory node, then calculate the father node absolute path title of this directory node, when the father node absolute path name of this directory node is called root directory, then close MongoDB database, when the father node absolute path title of directory node is not root directory, then revise the value of linking number field in father node, when the value of linking number field in father node can not be revised, then close MongoDB database,
When successfully revising the value of linking number field in father node, then for all child nodes of present node, according to sub-node type, the delete step of recursive call Archive sit or the delete step of recursive call directory node.
2. the user's space file system implementation method towards MongoDB according to claim 1, is characterized in that, the implication of each field in described fs.nodes set is as follows:
_ id field: for recording the globally unique identifier ID of node, type is Object_id, gives tacit consent to automatic assignment by mongoDB;
Name field: for recording the title of node, type is character string;
Type field: for recording the type of node, type is integer;
Depth field: for recording the degree of depth of node place tree construction, type is integer;
Abs_path field: for recording the absolute path title of node, be the path of root node to present node, type is character string;
Parent_id: for recording the father node ID of node, type is Object_id;
Meta_data: for recording the metadata information of node, type is BSON;
Wherein, each field meanings of meta_data is as follows:
File_id field: for log file ID, type is Object_id, and wherein, when node is file, then file_id field is effective; When node is catalogue, then file_id field is invalid;
Mode field: for recording node visit pattern, type is integer;
Uid field: for recording user id, type is integer;
Gid field: for recording group id, type is integer;
Nlink field: for recording node linking number, type is integer, and when node is file, then nlink field is the linking number of this node; When node is catalogue, then the sub-directory number of nlink field for comprising under this catalogue;
Atime field: for recording the node last access time;
Mtime field: for recording the last modification time of node;
Ctime field: for recording the last status modifier time.
CN201410469287.2A 2014-09-15 2014-09-15 A kind of user's space file system implementation method towards MongoDB Expired - Fee Related CN104239511B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410469287.2A CN104239511B (en) 2014-09-15 2014-09-15 A kind of user's space file system implementation method towards MongoDB

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410469287.2A CN104239511B (en) 2014-09-15 2014-09-15 A kind of user's space file system implementation method towards MongoDB

Publications (2)

Publication Number Publication Date
CN104239511A CN104239511A (en) 2014-12-24
CN104239511B true CN104239511B (en) 2016-03-30

Family

ID=52227570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410469287.2A Expired - Fee Related CN104239511B (en) 2014-09-15 2014-09-15 A kind of user's space file system implementation method towards MongoDB

Country Status (1)

Country Link
CN (1) CN104239511B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980618B (en) * 2016-01-15 2021-03-26 航天信息股份有限公司 File storage method and system based on MongoDB distributed cluster architecture
CN106027562B (en) * 2016-07-08 2019-08-13 中国银联股份有限公司 A kind of file network mapping method and device
CN107766355B (en) * 2016-08-17 2021-07-16 腾讯科技(深圳)有限公司 Hierarchical data management method, hierarchical data management system and instant messaging system
CN107807932B (en) * 2016-09-08 2021-11-16 腾讯科技(深圳)有限公司 Hierarchical data management method and system based on path enumeration
CN108268609B (en) * 2017-12-29 2022-01-28 星潮闪耀移动网络科技(中国)有限公司 File path establishing and accessing method and device
CN110377598B (en) * 2018-04-11 2023-04-07 西安邮电大学 Multi-source heterogeneous data storage method based on intelligent manufacturing process
CN113672562B (en) * 2020-05-14 2024-01-16 抖音视界有限公司 Data deleting method, device, equipment and storage medium
CN113065774A (en) * 2021-04-06 2021-07-02 中国电建集团成都勘测设计研究院有限公司 Water conservancy and hydropower engineering investigation and design result management method
CN113377721B (en) * 2021-07-02 2023-03-24 电信科学技术第五研究所有限公司 File table design method for storing files in database
JP2024530433A (en) * 2021-07-26 2024-08-21 ラシドヴィッチ アベノフ、マラト System and method for orchestrating sales of goods and services through random decisions among users - Patents.com

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216850A (en) * 2008-01-11 2008-07-09 清华大学 File systems accessing register dynamic collection method
CN101382953A (en) * 2008-09-19 2009-03-11 中兴通讯股份有限公司 Interface system for accessing file system in user space and file reading and writing method
CN102609464A (en) * 2012-01-16 2012-07-25 北京亿赞普网络技术有限公司 Method and device for associative table query of MONGODB shards
CN103207919A (en) * 2013-04-26 2013-07-17 北京亿赞普网络技术有限公司 Method and device for quickly inquiring and calculating MangoDB cluster
CN103383660A (en) * 2013-04-01 2013-11-06 华为终端有限公司 Method and device for realizing functions of cache partition of Android system as well as terminal equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216850A (en) * 2008-01-11 2008-07-09 清华大学 File systems accessing register dynamic collection method
CN101382953A (en) * 2008-09-19 2009-03-11 中兴通讯股份有限公司 Interface system for accessing file system in user space and file reading and writing method
CN102609464A (en) * 2012-01-16 2012-07-25 北京亿赞普网络技术有限公司 Method and device for associative table query of MONGODB shards
CN103383660A (en) * 2013-04-01 2013-11-06 华为终端有限公司 Method and device for realizing functions of cache partition of Android system as well as terminal equipment
CN103207919A (en) * 2013-04-26 2013-07-17 北京亿赞普网络技术有限公司 Method and device for quickly inquiring and calculating MangoDB cluster

Also Published As

Publication number Publication date
CN104239511A (en) 2014-12-24

Similar Documents

Publication Publication Date Title
CN104239511B (en) A kind of user's space file system implementation method towards MongoDB
US10037341B1 (en) Nesting tree quotas within a filesystem
US11093466B2 (en) Incremental out-of-place updates for index structures
CN106484877B (en) A kind of document retrieval system based on HDFS
CN103577123B (en) A kind of small documents optimization based on HDFS stores method
CN104160394B (en) Scalable analysis platform for semi-structured data
CN113986873B (en) Method for processing, storing and sharing data modeling of mass Internet of things
Kyrola Drunkardmob: billions of random walks on just a pc
CN106663056A (en) Metadata index search in file system
CN106611046A (en) Big data technology-based space data storage processing middleware framework
Wang et al. Research and implementation on spatial data storage and operation based on Hadoop platform
CN106708993A (en) Spatial data storage processing middleware framework realization method based on big data technology
CN102169507A (en) Distributed real-time search engine
US9659023B2 (en) Maintaining and using a cache of child-to-parent mappings in a content-addressable storage system
CN103078898B (en) File system, interface service device and data storage service supplying method
CN107807932B (en) Hierarchical data management method and system based on path enumeration
CN105302920A (en) Optimal management method and system for cloud storage data
CN107766355B (en) Hierarchical data management method, hierarchical data management system and instant messaging system
CN107391502A (en) The data query method, apparatus and index structuring method of time interval, device
US10241963B2 (en) Hash-based synchronization of geospatial vector features
Shangguan et al. Big spatial data processing with Apache Spark
CN113434506B (en) Data management and retrieval method, device, computer equipment and readable storage medium
Shin et al. A comparative experimental study of distributed storage engines for big spatial data processing using GeoSpark
CN105843809B (en) Data processing method and device
CN101937455B (en) Method for establishing multi-dimensional classification cluster based on infinite hierarchy and heredity information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160330

CF01 Termination of patent right due to non-payment of annual fee