The content of the invention
It is an object of the invention to provide a kind of storage for saving meta data server and transmit data resource, again
Global profile mark generating method, generating means and the corresponding distribution of the mark uniqueness of each file can effectively be ensured
File system;The global profile mark capacity for solving existing distributed file system causes greatly very much to store and transmit the overall situation
The excessive technical problem of file identification cost.
To solve the above problems, technical scheme provided by the invention is as follows:
The present invention relates to a kind of global profile mark generating method of distributed file system, wherein, the distributed text
Part system includes at least one master metadata server and multiple meta data servers, and the meta data server is used to store
And reading and writing of files, the master metadata server are used to generate corresponding global profile mark according to the metamessage of the file,
The global profile mark generating method includes step:
When receiving document creation request, the numbering of meta data server generates the overall situation according to where being created file
The server number field of file identification;And
The global profile is generated according to establishment numbering of the global profile mark in the master metadata server
The document order field of mark;
The establishment numbering that the different global profiles is identified in the master metadata server is different.
In the global profile mark generating method of distributed file system of the present invention, the document order field
The actual creation time strictly increasing identified according to the global profile.
It is described according to the overall situation in the global profile mark generating method of distributed file system of the present invention
Establishment numbering of the file identification in the master metadata server generates the document order field of the global profile mark
Step includes:
The document order is generated according to creation time of the global profile mark in the master metadata server
The creation time subfield of field;And
It is suitable that the file is generated according to the establishment numbering that global profile described in the creation time subfield identical identifies
The establishment order subfield of sequence field.
In the global profile mark generating method of distributed file system of the present invention, as current time creates text
The establishment order subfield that the quantity A1 of the global profile mark of part is less than or equal to current time can represent that global profile identifies
Quantity A2, then the creation time subfield of current time and corresponding is used according to the establishment order that the global profile identifies
Establishment order subfield come represent the global profile of current time institute establishment file identify;
The quantity A1 that global profile such as current time establishment file identifies is more than the establishment order subfield of current time
The quantity A2 for the global profile mark that can be represented, and the establishment order subfield of identical creation time subfield can represent
The maximum quantity of global profile mark is A3, then the establishment order identified according to the global profile uses the establishment of current time
Time subfield and corresponding establishment order subfield and the creation time subfield of lower n seconds and corresponding establishment order
Field come represent the global profile of current time institute establishment file identify;Wherein n is rounding up for [(A1-A2)/A3].
In the global profile mark generating method of distributed file system of the present invention, the distributed field system
The global profile mark generating method of system also includes step:
Growth data field is set in the global profile identifies, and the growth data field is used to carry out the overall situation
The Data expansion of file identification;
The global profile mark is included for the growth data field, the server number field, the wound successively
Build time subfield and the establishment order subfield.
In the global profile mark generating method of distributed file system of the present invention, the growth data field
Length range be 8-16 bits, the length range of the server number field is 8-16 bits, the sub- word of creation time
The length of section is 32-64 bits, and the length of the establishment order subfield is 16-32 bits.
In the global profile mark generating method of distributed file system of the present invention, the growth data field
Length be 8 bits, the length of the server number field is 8 bits, and the length of the creation time subfield is 32 ratios
Spy, the length of the establishment order subfield is 16 bits.
The invention further relates to a kind of global profile identification generation apparatus of distributed file system, wherein the distributed text
Part system includes at least one master metadata server and multiple meta data servers, and the meta data server is used to store
And reading and writing of files, the master metadata server are used to generate corresponding global profile mark according to the metamessage of the file,
The global profile identification generation apparatus includes:
Server number field module, it is corresponding with global profile mark for being described using server number field
Meta data server where file;And
Document order field module, for being identified using global profile described in document order field description in the pivot number
Numbered according to the establishment in server;
The establishment numbering that the different global profiles is identified in the master metadata server is different.
In the global profile identification generation apparatus of distributed file system of the present invention, the document order field
The actual creation time strictly increasing that the document order field in module identifies according to the global profile.
In the global profile identification generation apparatus of distributed file system of the present invention, the document order field
Module includes:
Creation time subfield unit, for describing the global profile mark in the master using creation time subfield
Creation time in meta data server;And
Establishment order subfield unit, for describing the creation time subfield identical using establishment order subfield
The establishment numbering of the global profile mark.
In the global profile identification generation apparatus of distributed file system of the present invention, the global profile mark
Generating means also include:
Growth data field module, for carrying out the Data expansion of the global profile mark using growth data field.
In the global profile identification generation apparatus of distributed file system of the present invention, the global profile mark
It is suitable to include the growth data field, the server number field, the creation time subfield and the establishment successively
Sequence subfield.
In the global profile identification generation apparatus of distributed file system of the present invention, the growth data field
Length range be 8-16 bits, the length range of the server number field is 8-16 bits, the sub- word of creation time
The length of section is 32-64 bits, and the length of the establishment order subfield is 16-32 bits.
In the global profile identification generation apparatus of distributed file system of the present invention, the growth data field
Length be 8 bits, the length of the server number field is 8 bits, and the length of the creation time subfield is 32 ratios
Spy, the length of the establishment order subfield is 16 bits.
The invention further relates to a kind of distributed file system, and it includes at least one master metadata server and multiple members
Data server, the meta data server is used to store and reading and writing of files, and the master metadata server is according to the file
Metamessage, use above-mentioned global profile identification generation apparatus to generate corresponding global profile and identify.
Compared to prior art, global profile mark generating method of the invention, generating means and corresponding distributed text
Part system can save the storage of meta data server and transmit the resource of data, can effectively ensure the mark of each file again
Uniqueness;The global profile mark capacity for solving existing distributed file system causes greatly very much to store and transmit overall situation text
The excessive technical problem of part mark cost.
For the above of the present invention can be become apparent, preferred embodiment cited below particularly, and coordinate institute's accompanying drawings, make
Describe in detail as follows:
Embodiment
The explanation of following embodiment is with reference to additional schema, to illustrate the particular implementation that the present invention can be used to implementation
Example.The direction term that the present invention is previously mentioned, such as " on ", " under ", "front", "rear", "left", "right", " interior ", " outer ", " side "
Deng being only the direction with reference to annexed drawings.Therefore, the direction term used is to illustrate and understand the present invention, and is not used to
The limitation present invention.
In figure, the similar unit of structure is represented with identical label.
The present invention relates to a kind of global profile mark generating method of distributed file system, as shown in figure 1, Fig. 1 is this
The flow chart of the preferred embodiment of the global profile mark generating method of the distributed file system of invention.The distributed field system
System includes at least one master metadata server and multiple meta data servers, and meta data server is used to storing and reading and writing text
Part, master metadata server are used to generate corresponding global profile mark, the distributed file system according to the metamessage of file
Global profile mark generating method include:
Step 101, when receiving document creation request, the numbering of meta data server generates according to where being created file
The server number field of global profile mark;
Step 102, document order field is generated according to creation time of the global profile mark in master metadata server
Creation time subfield;
Step 103, the establishment numbering generation document order word identified according to creation time subfield identical global profile
The establishment order subfield of section;
Here the establishment numbering that different global profiles is identified in master metadata server is different.
The global profile mark generating method of the distributed file system of the embodiment of the present invention is described in detail below
The detailed process of each step.
In a step 101, when receiving document creation request, the numbering of meta data server according to where being created file
The server number field of global profile mark is generated, is created so as to which the server number field can describe this where file
The numbering of meta data server.
In a step 102, document order is generated according to creation time of the global profile mark in master metadata server
The creation time subfield of field.Difference can preferably be distinguished according to the creation time subfield that the creation time of file generates
Establishment file, while can also pass through global profile mark reflection file creation time attribute.Here it is every in order to ensure
The uniqueness of the individual global profile mark for being created file, the creation time subfield of document order field is according to global profile mark
The actual creation time strictly increasing of knowledge.Here the creation time subfield after strictly increasing refers to creation time relatively is necessarily big
In the creation time subfield of creation time earlier above(The adjacent creation time subfield of creation time can not be equal).
In step 103, the establishment numbering generation file identified according to creation time subfield identical global profile is suitable
The establishment order subfield of sequence field.Within the time of same second, multiple meta data servers may create multiple files, this
When in order to meet to the same second create file(That is the represented file of creation time subfield identical global profile mark)
Make a distinction, generation establishment order subfield can be numbered according to the establishment of file, the establishment is numbered preferably according to the establishment of file
It is sequentially generated, i.e., the actual creation time that the establishment order subfield of identical creation time subfield identifies according to global profile is tight
Lattice are incremented by, to ensure the uniqueness of each file identification.
Further, the global profile mark generating method of the distributed file system of the embodiment of the present invention also includes step:
Growth data field is set in global profile identifies.Growth data field, server number field, creation time subfield with
And establishment order subfield is arranged in order and constitutes global profile mark.Wherein growth data field is used to carry out global profile mark
Some attribute of existing file can be numbered for the Data expansion of knowledge, the growth data field(Such as the version of file
Deng), can also reserve and the server of extension in future is numbered, it might even be possible to reserved some extended attribute to future file
It is numbered, growth data field can also be not provided with here certainly.
Further, during the global profile mark generation of distributed file system, in order to ensure the mark of each file only
One property, the actual creation time strictly increasing that document order field identifies according to global profile, i.e., evening actual creation time is complete
The document order field of office file mark is necessarily more than the document order field of actual creation time early global profile mark.
Further, the length range of the growth data field in global profile mark is 8-16 bits, and server is numbered
The length range of field is 8-16 bits, and the length of creation time subfield is 32-64 bits, the length of establishment order subfield
For 16-32 bits.
Such as the length of the growth data field in global profile mark is preferably 8 bits(That is 1 byte), server code
The length of field is preferably 8 bits, and the length of creation time subfield is preferably 32 bits, and the length of establishment order subfield is excellent
Elect 16 bits as.So server code field can support that 256 meta data servers are numbered, creation time subfield
, can be to 2 using the second as least count unit32Second(More than 130 years)Interior file is numbered, and establishment order subfield can be to 1
2 in second16(65536)Individual file carries out different numberings.The total length of so global profile mark is 64 bits, preferable
While realizing unique identification, the memory space that global profile mark takes is also smaller.Each word in certain global profile mark
The specific length of section can be adjusted according to the specific needs of user.
Global profile mark is generated using the global profile mark generating method of the distributed file system of the embodiment of the present invention
During knowledge, the quantity A1 as the global profile of current time establishment file identifies is less than or equal to current time(The current second)Establishment it is suitable
The quantity A2 for the global profile mark that sequence subfield can represent, then when the establishment order identified according to global profile uses current
Between creation time subfield and corresponding establishment order subfield represent the global profile mark of current time institute establishment file
Know.
The quantity A1 that global profile such as current time establishment file identifies is more than the establishment order subfield of current time
The quantity A2 for the global profile mark that can be represented, and the establishment order subfield of identical creation time subfield can represent
The maximum quantity of global profile mark is A3, then the establishment order identified according to global profile uses the creation time of current time
Subfield and corresponding establishment order subfield and the creation time subfield of lower n seconds and corresponding establishment order subfield
To represent that the global profile of current time institute establishment file identifies;Wherein n is rounding up for [(A1-A2)/A3].
The generation identified below by the global profile of the file in the three second time of description is sub to illustrate creation time
The generation of field and corresponding establishment order subfield(Because server number field is according to the preset numbers of meta data server
Directly generate, no longer elaborate here).
First second, such as A2=A3=216=65536, A1=70000, at this moment because A1 is more than A2, current time(The current second)'s
Creation time subfield and corresponding establishment order subfield can not represent the overall situation text of file all caused by current time
Part identifies, therefore represents A1-A2=4464 using the creation time subfield and corresponding establishment order subfield of next second
The global profile mark of file.The document order field of the global profile mark of 70000 files is according to global profile simultaneously
The actual creation time strictly increasing of mark, wherein the global profile of preceding 65536 files is identified in the sub- word of same creation time
The actual creation time strictly increasing that establishment order subfield under section identifies according to global profile, the overall situation of rear 4564 files
The actual creation time that establishment order subfield of the file identification under same creation time subfield identifies according to global profile
Strictly increasing.
Second second, such as A3=65536, A2=65536-4464=61072, A1=70000, at this moment A1 be still more than A2, currently
The creation time subfield of time and corresponding establishment order subfield can not represent file all caused by current time
Global profile identify, therefore using next second creation time subfield and corresponding establishment order subfield come represent A1-A2=
The global profile mark of 8928 files.The document order field of the global profile mark of 70000 files is according to complete simultaneously
The actual creation time strictly increasing of office file mark, wherein the global profile of preceding 61072 files is identified in same establishment
Between the actual creation time strictly increasing that is identified according to global profile of establishment order subfield under subfield, rear 8928 files
Global profile identify the actual wound that establishment order subfield under same creation time subfield identifies according to global profile
Build time strictly increasing.
3rd second, such as A3=65536, A2=65536-8928=56608, A1=50000, at this moment A1 be less than A2, can be used and work as
The creation time subfield of preceding time and corresponding establishment order subfield represent the overall situation text of file that current time creates
Part identifies, and the global profile of above-mentioned 8928 files and 50000 files identifies the wound under same creation time subfield
Build the actual creation time strictly increasing that order subfield identifies according to global profile.
Further, when carrying out active-standby switch such as master metadata server, standby master metadata server may be with original
The Time Inconsistency of master metadata server, at this moment in order to ensure the uniqueness of the global profile of each file mark, after switching
Document order field still according to global profile identify actual creation time strictly increasing.
Time such as standby master metadata server is later than the time of former master metadata server, then directly using standby
Master metadata server time carry out creation time subfield generation;Time such as standby master metadata server is early
In the time of former master metadata server, then according to the generation of above-mentioned creation time subfield and corresponding establishment order subfield
Embodiment generation creation time subfield, i.e., using the creation time subfield of follow-up time come represent current time create
The global profile mark of file, to ensure that the actual creation time that document order field still identifies according to global profile strictly passs
Increase.
The global profile mark of distributed file system in use, user by the path of file from master metadata server
The upper global profile mark for obtaining this document;Then file is obtained from the server number field in the global profile mark of file
The numbering of the meta data server at place(That is the IP of meta data server);User connects according to the numbering of the meta data server
To corresponding meta data server;Document order field during end user identifies according to global profile is carried out to corresponding file
Read-write operation.
Because the structure of global profile mark is simple, distributed file system is identified using the global profile, Ke Yiyou
The volume of transmitted data reduced between user and meta data server of effect, while ensure the uniqueness of the mark of each file.
The invention further relates to a kind of global profile identification generation apparatus of distributed file system, Fig. 2 and Fig. 3 are refer to,
Fig. 2 is the global profile mark of the preferred embodiment generation of the global profile identification generation apparatus of the distributed file system of the present invention
The schematic diagram of knowledge, Fig. 3 are the structural representation of the preferred embodiment of the distributed file system of the present invention.The distributed field system
System includes at least one master metadata server 11 and multiple meta data servers 12, and the meta data server 12 is used to store
And reading and writing of files, the master metadata server 11 are used for the metamessage according to file, use global profile identification generation apparatus 13
Generate corresponding global profile mark.Master metadata server 11 and each meta data server 12 connect, user simultaneously with master
Meta data server 11 and each meta data server 12 connect.
It is suitable that the global profile identification generation apparatus 13 of the embodiment of the present invention includes server number field module 131, file
Sequence field module 132 and growth data field module 133.Server number field module 131 is used to generate server numbering
Field, document order field module 132 are used to generate document order field, and growth data field module 133, which is used to generate, to be extended
Data field.This document sequence field module 132 includes being used for the creation time subfield unit for generating creation time subfield
And for generating the establishment order subfield unit of establishment order subfield.
The global profile generated the following detailed description of the global profile identification generation apparatus 13 of this preferred embodiment identifies.Should
Global profile mark includes server number field and document order field, and the server number field is used to describe and the overall situation
Meta data server 12 where the corresponding file of file identification(That is the numbering of respective meta-data server 12);This document order
Field is used to describe establishment numbering of the global profile mark in master metadata server 11, and each global profile mark is in pivot
Document order field in data server 11 differs.
As shown in Fig. 2 global profile mark also includes growth data field, document order field includes the sub- word of creation time
Section and establishment order subfield, growth data field, server number field, creation time subfield and establishment order
Field, which is arranged in order, constitutes global profile mark.Wherein growth data field is used for the data expansion for carrying out global profile mark
Some attribute of existing file can be numbered for exhibition, the growth data field(Such as version of file etc.), can also
The reserved server to extension in future is numbered, it might even be possible to and reserved some extended attribute to future file is numbered,
Certainly growth data field can be also not provided with here.
Creation time subfield is used to describe creation time of the global profile mark in master metadata server 11;Create
Order subfield is used for the establishment numbering for describing creation time subfield identical global profile mark.Due to file establishment when
Between can preferably distinguish different establishment files, while can also pass through the creation time of global profile mark reflection file
Attribute, therefore can be significantly to the file progress unique identification in some meta data server 12 by creation time subfield
Simplification global profile mark field length, so as to save master metadata server 11 store and transmit global profile identify
Resource.The file that establishment order subfield creates to the same second(That is creation time subfield identical global profile mark institute table
The file shown)Further distinguished, to ensure the uniqueness of the global profile of each file mark.Certainly file here
Sequence field can also be represented using other modes, and the file in each meta data server 12 is carried out as long as can realize
Unique identification(Establishment numbering of the file in meta data server 12 can be reflected)Document order field belong to this hair
Bright protection domain.
Further, in order to ensure the uniqueness of the mark of each file, document order field identifies according to global profile
The document order field of the global profile mark of actual creation time strictly increasing, i.e. evening actual creation time is necessarily more than actual
The document order field of the early global profile mark of creation time.
Further, the length range of the growth data field in global profile mark is 8-16 bits, and server is numbered
The length range of field is 8-16 bits, and the length of creation time subfield is 32-64 bits, the length of establishment order subfield
For 16-32 bits.
The length of growth data field in reference picture 2, such as global profile mark is preferably 8 bits(That is 1 byte),
The length of server code field is preferably 8 bits, and the length of creation time subfield is preferably 32 bits, the sub- word of establishment order
The length of section is preferably 16 bits.So server code field can support that 256 meta data servers 12 are numbered, wound
Time subfield is built using the second as least count unit, can be to 232Second(More than 130 years)Interior file is numbered, the sub- word of establishment order
Section can be to 2 in 1 second16(65536)Individual file carries out different numberings.So the total length of global profile mark is 64 ratios
Spy, while preferably unique identification is realized, the memory space that global profile mark takes is also smaller.Certain global profile
The specific length of each field can be adjusted according to the specific needs of user in mark.
The invention further relates to a kind of distributed file system, the distributed file system takes including at least one main metadata
Business device and multiple meta data servers, the meta data server is used to store and reading and writing of files, master metadata server are used for
According to the metamessage of file, generate corresponding global profile using above-mentioned global profile identification generation apparatus and identify, simultaneously should
Distributed file system carries out the establishment and read-write of file on meta data server, the distribution using above-mentioned global profile mark
The global profile identification generation apparatus and corresponding application method that formula file system uses refer to above-mentioned distributed file system
Global profile mark generating method and generating means specific embodiment.
Global profile mark generating method, generating means and the corresponding distributed file system of the present invention can save pivot
The storage of data server and the resource for transmitting data, it can effectively ensure the mark uniqueness of each file again;Solve
The global profile mark capacity of existing distributed file system causes greatly very much to store and transmit global profile mark cost mistake
Big technical problem.
In summary, although the present invention is disclosed above with preferred embodiment, above preferred embodiment simultaneously is not used to limit
The system present invention, one of ordinary skill in the art, without departing from the spirit and scope of the present invention, it can make various changes and profit
Decorations, therefore protection scope of the present invention is defined by the scope that claim defines.