CN105956205B - It is a kind of to generate the strong method and device of HBASE row - Google Patents

It is a kind of to generate the strong method and device of HBASE row Download PDF

Info

Publication number
CN105956205B
CN105956205B CN201610511657.3A CN201610511657A CN105956205B CN 105956205 B CN105956205 B CN 105956205B CN 201610511657 A CN201610511657 A CN 201610511657A CN 105956205 B CN105956205 B CN 105956205B
Authority
CN
China
Prior art keywords
hbase
time
row
server
determined
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.)
Active
Application number
CN201610511657.3A
Other languages
Chinese (zh)
Other versions
CN105956205A (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.)
Baishi Software (beijing) Co Ltd
Original Assignee
Baishi Software (beijing) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baishi Software (beijing) Co Ltd filed Critical Baishi Software (beijing) Co Ltd
Priority to CN201610511657.3A priority Critical patent/CN105956205B/en
Publication of CN105956205A publication Critical patent/CN105956205A/en
Application granted granted Critical
Publication of CN105956205B publication Critical patent/CN105956205B/en
Active 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/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • 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/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • 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/24Querying
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Library & Information Science (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The strong method and device of HBASE row is generated the invention discloses a kind of, belongs to software development technique, there are system times to change for solving the strong generation method of existing HBASE row, leads to the strong repetition of row or the incorrect problem that sorts.It include: the unique identification that server corresponding with HBASE is successively recorded in HBASE database, the server and the HBASE establish the time of connection;Time and the current time of connection are established according to the HBASE and the server, establish at the first time and the first time is determined as the starting point that the HBASE row that global static class generates is good for;When accessing the global static class, to the starting point that the HBASE row is good for, using the method genesis sequence number of Atomic atom adding 1, and the server unique identification and the serial number is determined as HBASE row and are good for.

Description

It is a kind of to generate the strong method and device of HBASE row
Technical field
The invention belongs to technical field of software development, more particularly relate to a kind of method and device that generation HBASE row is strong.
Background technique
HBASE is a PostgreSQL database distributed, towards column, which is write in Fay Chang Google paper " distributed memory system of Bigtable: one structural data ".Just as Google is utilized in Bigtable Distributed Storage provided by file system (File System) is the same, and HBASE is provided on Hadoop and is similar to The ability of Bigtable.
Under normal conditions, the strong generation method of HBASE row generally has following several situations: 1), by HBASE automatically generating row It is strong;2), using UUID (English are as follows: Universally Unique Identifier, Chinese abbreviation: Universally Unique Identifier) Character string is strong as row;The strong generation method of above two HBASE row, due to row it is strong in do not include data insertion sequencing letter Breath, so as to cause the application scenarios that can not show successive data according to the strong sequence of row;To solve the above-mentioned problems, using making The strong method of row is generated with custom rule, still, since the strong method of custom rule generation row may under distributed environment It will appear repetition, may cause the data being stored in HBASE and the case where mutually covering occur, further, when due to using Between stamp construct the strong needs for being able to satisfy sequence of row, but after system time changes, it is easy to cause row is strong to repeat or row Sequence is incorrect.
In conclusion existing HBASE row is good for generation method, there are system times to change, cause row it is strong repeat or Sort incorrect problem.
Summary of the invention
The embodiment of the present invention provides a kind of method and device that generation HBASE row is strong, for solving the row of existing HBASE There are systems to be easy to happen change for strong generation method, leads to the strong repetition of row or the incorrect problem that sorts.
The embodiment of the present invention provides a kind of method that generation HBASE row is strong, comprising:
Successively record the unique identification of corresponding with HBASE server in HBASE database, the server with it is described HBASE establishes the time of connection;
Time and the current time of connection are established according to the HBASE and the server, are established at the first time and by institute It states and is determined as the starting point that the HBASE row that global static class generates is good at the first time;
When accessing the global static class, to the starting point that the HBASE row is good for, using the method for Atomic atom adding 1 Genesis sequence number, and the server unique identification and the serial number are determined as HBASE row and are good for.
Preferably, time and the current time that connection is established according to the HBASE and the server, establishes first The first time is simultaneously determined as the starting point that the HBASE row that global static class generates is good for by the time, comprising:
When the time for establishing connection being less than the current time, then the current time is determined as described first Time;Or
When the time for establishing connection being greater than the current time, current time is increased into a predefined increment Time afterwards is determined as at the first time.
The embodiment of the present invention provides a kind of device that generation HBASE row is strong, comprising:
Recording unit, for successively recording the unique identification of server corresponding with HBASE, institute in HBASE database It states server and the HBASE establishes the time of connection;
Unit is established, for establishing time and the current time of connection according to the HBASE and the server, establishes the The first time is simultaneously determined as the starting point that the HBASE row that global static class generates is good for by one time;
Determination unit is used for when accessing the global static class, to the starting point that the HBASE row is good for, using Atomic The method genesis sequence number of atom adding 1, and the server unique identification and the serial number are determined as HBASE row and are good for.
Preferably, the unit of establishing is specifically used for:
When the time for establishing connection being less than the current time, then the current time is determined as described first Time;Or
When the time for establishing connection being greater than the current time, current time is increased into a predefined increment Time afterwards is determined as at the first time.
The embodiment of the present invention provides a kind of method and device that generation HBASE row is strong, including in HBASE database successively The unique identification of server corresponding with HBASE is recorded, the server and the HBASE establish the time of connection;According to institute It states HBASE and the server establishes time and the current time of connection, establish at the first time and determine the first time The starting point being good for for the HBASE row that global static class generates;When the global static class is accessed, using Atomic atom Add 1 method, genesis sequence number, and the server unique identification and the serial number are determined as HBASE row and are good for.In this hair HBASE row provided by bright embodiment is strong to be made of server unique identification and serial number, wherein server unique identification is peace The unique number configured when filling server, uniqueness by specifying by hand, and serial number is the application program life for accessing HBASE At unique number;The HBASE row determined using the above method is strong, related to server, is unrelated with the time, with can sort, Unduplicated feature solves the prior art when system time changes, and causes row is strong to repeat or sort incorrect Problem.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of method flow schematic diagram for generating HBASE row and being good for provided in an embodiment of the present invention;
Fig. 2 is a kind of apparatus structure schematic diagram for generating HBASE row and being good for provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 illustratively shows a kind of method flow schematic diagram for generating HBASE row and being good for provided in an embodiment of the present invention; This method can at least be applied in software development.
As shown in Figure 1, a kind of method for generating HBASE row and being good for provided in an embodiment of the present invention, comprising the following steps:
Step 101, the unique identification of server corresponding with HBASE, the service are successively recorded in HBASE database Device and the HBASE establish the time of connection;
Step 102, time and the current time that connection is established according to the HBASE and the server, when establishing first Between and the first time is determined as the strong starting point of the HBASE row that global static class generates;
Step 103, when accessing the global static class, to the starting point that the HBASE row is good for, using Atomic atom adding 1 method genesis sequence number, and the server unique identification and the serial number are determined as HBASE row and are good for.
It should be noted that the executing subject in the embodiment of the present invention is server.
In a step 101, after HBASE server corresponding with the HBASE establishes connection, server can be in HBASE Record the unique identification of server corresponding to the HBASE in database, and by HBASE server corresponding with the HBASE The time for establishing connection is also recorded in HBASE database.
It should be noted that server can before HBASE server corresponding with the HBASE establishes connection, The unique identification of record server corresponding with the HBASE in HBASE database;It can also be corresponding with the HBASE in HBASE Server is established after connection, and the unique identification of server corresponding with the HBASE is recorded in HBASE database;In this hair In bright embodiment, the time for recording the unique identification of server corresponding with the HBASE in HBASE database to server is first Afterwards sequentially without limitation.
Further, server can be while HBASE server corresponding with the HBASE establishes connection, in HBASE Record server corresponding with the HBASE establishes the time of connection in database;It can also be in cloth storage system and the HBASE Corresponding server is established after connection, recorded in HBASE database corresponding with HBASE server establish connection when Between;In embodiments of the present invention, server corresponding with the HBASE is recorded in HBASE database to server and establishes connection Time sequencing without limitation.
In a step 102, time and the current time that connection is established according to the HBASE and the server establish the The first time is simultaneously determined as the starting point that the HBASE row that global static class generates is good for by one time.
In practical applications, it needs to establish the time of connection with server according to HBASE and current time is compared, really That fixed time is bigger.Specifically: when the time that HBASE and server establish connection being greater than current time, then by HBASE The time for establishing connection with server is determined as at the first time;Alternatively, working as when the HBASE time for establishing connection with server is less than When the preceding time, increase by 1000000000000 on the basis of current time, then by increase 1000000000000 it is current Time is determined as at the first time.
In step 103, when accessing the global static class, to the starting point that the HBASE row is good for, using Atomic original Son adds 1 method genesis sequence number, and the server unique identification and the serial number are determined as HBASE row and are good for.
In embodiments of the present invention, strong by accessing the method generation HBASE row that global static class provides, when global static When class is accessed, to the starting point that HBASE row is good for, using the operating method of Atomic atom adding 1, genesis sequence number then will clothes Business device unique identification and the serial number of generation are connected is good for as HBASE row, and determining HBASE row is good for and is returned.
It is made of in conclusion the HBASE row provided by the embodiment of the present invention is strong server unique identification and serial number, Wherein, server unique identification is the unique number configured when installing server, and uniqueness by specifying by hand, and serial number To access the unique number that the application program of HBASE generates;The HBASE row determined using the above method is strong, related to server, It is unrelated with the time, has the characteristics that can to sort, is unduplicated, solving the prior art when system changes, lead to the strong weight of row The multiple or incorrect problem that sorts.
Based on the same inventive concept, the embodiment of the invention provides a kind of devices of determining flame spread rates, due to the dress The principle for setting solution technical problem is similar to a kind of method of determining flame spread rates, therefore the implementation side of may refer to of the device The implementation of method, overlaps will not be repeated.
Fig. 2 is a kind of apparatus structure schematic diagram for generating HBASE row and being good for provided in an embodiment of the present invention.As shown in Fig. 2, this A kind of strong device of generation HBASE row that inventive embodiments provide, specifically includes that
Recording unit 20, for successively recording the unique identification of server corresponding with HBASE in HBASE database, The server and the HBASE establish the time of connection;
Unit 21 is established, for establishing time and the current time of connection according to the HBASE and the server, is established It is determined as the starting point that the HBASE row that global static class generates is good at the first time and by the first time;
Determination unit 22, for the starting point that the HBASE row is good for, using when accessing the global static class The method genesis sequence number of Atomic atom adding 1, and the server unique identification and the serial number are determined as HBASE row It is strong.
Preferably, the unit 21 of establishing is specifically used for:
When the time for establishing connection being greater than the current time, then the time for establishing connection is determined as institute It states at the first time;Or
When the time for establishing connection being less than the current time, by increase by 1000000000000 it is described current Time is determined as at the first time.
It should be appreciated that the apparatus is realized according to one of the above generates unit that the strong device of HBASE row includes only The logical partitioning that carries out of function, in practical application, the superposition or fractionation of said units can be carried out.And the embodiment provides A kind of function realized of the strong device of generation HBASE row and provided by the above embodiment a kind of generate the strong side of HBASE row Method corresponds, and for the more detailed process flow that the device is realized, has done in above method embodiment one in detail Description, is not described in detail herein.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (2)

1. a kind of generate the strong method of HBASE row characterized by comprising
Successively recorded in HBASE database corresponding with HBASE server unique identification and the server with it is described HBASE establishes the time of connection;
Time and the current time of connection are established according to the HBASE and the server, are established at the first time and by described the One time was determined as the starting point that the HBASE row that global static class generates is good for;
When generating HBASE line unit, when by accessing the global static class, to the starting point that the HBASE row is good for, use The method genesis sequence number of Atomic atom adding 1, and the server unique identification and the serial number are determined as HBASE row It is strong;Time and the current time that connection is established according to the HBASE and the server, foundation first time simultaneously will be described It is determined as the starting point that the HBASE row that global static class generates is good at the first time, comprising:
When the time for establishing connection being less than the current time, then when the current time being determined as described first Between;Or
When the time for establishing connection being greater than the current time, after current time is increased a predefined increment Time is determined as at the first time.
2. a kind of generate the strong device of HBASE row characterized by comprising
Recording unit, for successively recording the unique identification of server corresponding with HBASE, the clothes in HBASE database Business device and the HBASE establish the time of connection;
Unit is established, for establishing time and the current time of connection according to the HBASE and the server, when establishing first Between and the first time is determined as the strong starting point of the HBASE row that global static class generates;
Determination unit is used for when accessing the global static class, to the starting point that the HBASE row is good for, using Atomic atom Add 1 method genesis sequence number, and the server unique identification and the serial number are determined as HBASE row and are good for;It is described to build Vertical unit is specifically used for:
When the time for establishing connection being less than the current time, then when the current time being determined as described first Between;Or
When the time for establishing connection being greater than the current time, after current time is increased a predefined increment Time is determined as at the first time.
CN201610511657.3A 2016-07-01 2016-07-01 It is a kind of to generate the strong method and device of HBASE row Active CN105956205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610511657.3A CN105956205B (en) 2016-07-01 2016-07-01 It is a kind of to generate the strong method and device of HBASE row

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610511657.3A CN105956205B (en) 2016-07-01 2016-07-01 It is a kind of to generate the strong method and device of HBASE row

Publications (2)

Publication Number Publication Date
CN105956205A CN105956205A (en) 2016-09-21
CN105956205B true CN105956205B (en) 2019-07-02

Family

ID=56903044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610511657.3A Active CN105956205B (en) 2016-07-01 2016-07-01 It is a kind of to generate the strong method and device of HBASE row

Country Status (1)

Country Link
CN (1) CN105956205B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835896B (en) * 2021-01-27 2022-07-05 浙江中智达科技有限公司 Real-time database data hotspot balancing method, device, equipment and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117439A (en) * 2015-08-11 2015-12-02 小米科技有限责任公司 Global identifier generation method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8676808B2 (en) * 2009-07-09 2014-03-18 Dillon Software Services, Llc Data store interface that facilitates distribution of application functionality across a multi-tier client-server architecture

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117439A (en) * 2015-08-11 2015-12-02 小米科技有限责任公司 Global identifier generation method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Twitter分布式自增ID算法Snowflake;快乐的霖霖;《CSDN博客https://bolg.csdn.net/chdhust/article/detail/51759722》;20160625;第1-2页

Also Published As

Publication number Publication date
CN105956205A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
CN107480039B (en) Small file read-write performance test method and device for distributed storage system
CN104423961B (en) A kind of method and system for generating test script
JP6045134B2 (en) Parallel workload simulation for application performance testing
CN104965757A (en) Virtual machine live migration method, virtual machine migration management apparatus, and virtual machine live migration system
CN109995814A (en) Moving method and device, communication equipment, the storage medium of cloud host resource
CN106155833A (en) A kind of method and apparatus of asynchronous remote copy
CN105446757B (en) A kind of processing method and equipment of data packet
JP2016512362A (en) Tracking application usage in computing environments
CN104714957A (en) List structure changing method and device
CN109582305B (en) Encoding method and device for mobile application page elements and electronic equipment
CN110046638A (en) Fusion method, device and the equipment of multi-platform data
CN106126115A (en) A kind of method and device of the disk of EVM(extended virtual machine)
CN105956205B (en) It is a kind of to generate the strong method and device of HBASE row
CN110442500A (en) A kind of test method and device of the super fusion clustering performance based on Unixbench
CN107766230A (en) A kind of method and apparatus tested based on configuration file
JP2019106031A (en) Data processing system and data analysis/processing method
CN107590044B (en) Testing method, device and equipment for distributed storage cluster
CN110597728A (en) Method, device and system for constructing test data
US11640281B2 (en) Tool for introspection in object-oriented source code
CN109656825A (en) The method and device of fine arts resource processing, electronic equipment, storage medium
CN105930260B (en) A kind of system availability test method and device
CN114021059A (en) Method, system, device and storage medium for downloading off-line digital map
CN105808318B (en) Information processing method and electronic equipment
CN110033264B (en) Merkel tree corresponding to building block and simple payment verification method and device
CN112749159A (en) Form generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant