CN109344140A - Data access method, device, electronic equipment and computer storage medium - Google Patents
Data access method, device, electronic equipment and computer storage medium Download PDFInfo
- Publication number
- CN109344140A CN109344140A CN201810924374.0A CN201810924374A CN109344140A CN 109344140 A CN109344140 A CN 109344140A CN 201810924374 A CN201810924374 A CN 201810924374A CN 109344140 A CN109344140 A CN 109344140A
- Authority
- CN
- China
- Prior art keywords
- operating mode
- file system
- access
- version
- default
- 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.)
- Pending
Links
Abstract
This application involves technical field of data processing, disclose a kind of data access method, device, electronic equipment and computer readable storage medium, wherein, data access method includes: to determine operating mode corresponding to the access path currently got based on the first default corresponding relationship between access path and operating mode;Then if operating mode is not default operating mode, by preset document system plug-in unit, according to the data information in the file system of operating mode access respective version.The method of the embodiment of the present application, it can be based on same client, by preset document system plug-in unit, to access the file system of any version, i.e. in the case where transparent to upper layer application, realize compatible by access of the same client to the file system of each version.
Description
Technical field
This application involves technical field of data processing, specifically, this application involves a kind of data access method, device,
Electronic equipment and computer storage medium.
Background technique
Hadoop realizes a distributed file system HDFS (Hadoop Distributed File System),
In, HDFS has the characteristics that high fault tolerance, and can be designed to be deployed on cheap common hardware, while HDFS can
The data that high transmission rates carry out access application are provided, those is suitble to have the application program of super large data set.
It with the continuous development of technology and updates, on the basis of HDFS1.0 system, has issued new HDFS2.0 system
System, the storage access mode and HDFS1.0 system of HDFS2.0 system have very big difference, and HDFS1.0 system is using Hadoop
Included RPC (Remote Procedure Call Protocol, remote procedure call protocol) is communicated, and HDFS2.0 system
System is then communicated using PB (Protocol Buffer, agreement buffering) agreement.
Currently, it is directed to the HDFS system (such as HDFS1.0 and HDFS2.0) of different editions, it can be by disposing respectively not
With the mode of the client (such as client 1.0 and client 2.0) of version, to access difference respectively using corresponding client
The HDFS of version is accessed in HDFS2.0 for example, accessing the data in HDFS1.0 using client 1.0 using client 2.0
Data.However, then data must be copied to from HDFS1.0 to use client 2.0 to access the data in HDFS1.0
HDFS2.0, this process, not only trivial operations, but also long time will be consumed, cause efficiency lower.
Summary of the invention
To overcome above-mentioned technical problem or at least being partially solved above-mentioned technical problem, spy proposes following technical scheme:
In a first aspect, providing a kind of data access method, comprising:
Based on the first default corresponding relationship between access path and operating mode, the access path institute currently got is determined
Corresponding operating mode;
If operating mode is not that default operating mode is accessed by preset document system plug-in unit according to operating mode
Data information in the file system of respective version.
Specifically, passing through preset document system plug-in unit, in the file system that respective version is accessed according to operating mode
Before data information, further includes:
The second default corresponding relationship between configuration work mode and the version information of file system.
Further, by preset document system plug-in unit, in the file system that respective version is accessed according to operating mode
Data information, comprising:
According to the second default corresponding relationship, the version information of the corresponding file system of operating mode is determined;
The number in corresponding file system is accessed according to obtained version information is determined by preset document system plug-in unit
It is believed that breath.
Further, corresponding file is being obtained according to obtained version information is determined by preset document system plug-in unit
Before data information in system, further includes:
Third between configuration work mode and Classloader presets corresponding relationship.
Further, corresponding file system is obtained according to obtained version information is determined by preset document system plug-in unit
Data information in system, comprising:
Corresponding relationship is preset according to third, determines Classloader corresponding with operating mode;
By preset document system plug-in unit, according to the determining obtained corresponding file system of Classloader load application version information
Java archive file packet;
According to Java archive file packet, the data information in file system is accessed.
Further, Classloader carrys out the Java shelves of the corresponding file system of load application version information by way of reflection
Case file packet.
Further, further includes:
If operating mode is default operating mode, according to the second default corresponding relationship, it is loaded directly into respective version letter
The Java archive file packet of the file system of breath, to access the data information in this document system.
Further, file system is distributed file system HDFS.
Second aspect provides a kind of data access device, comprising:
Determining module, for determining current obtain based on the first default corresponding relationship between access path and operating mode
Operating mode corresponding to the access path arrived;
First processing module, for passing through preset document system plug-in unit, root when operating mode is not default operating mode
According to the data information in the file system of operating mode access respective version.
It specifically, further include the first configuration module;
First configuration module, for default pair of second between configuration work mode and the version information of file system
It should be related to.
Further, first processing module includes that version determines submodule and data access submodule;
Version determines submodule, for determining the corresponding file system of operating mode according to the second default corresponding relationship
Version information;
Data access submodule, for accessing phase according to obtained version information is determined by preset document system plug-in unit
The data information in file system answered.
It further, further include the second configuration module;
Second configuration module presets corresponding relationship for the third between configuration work mode and Classloader.
Further, data access submodule includes that Classloader determines subelement, load subelement and data access
Unit;
Classloader determines subelement, for presetting corresponding relationship according to third, determines class corresponding with operating mode
Loader;
Subelement is loaded, for being believed according to determining obtained Classloader load application version by preset document system plug-in unit
Cease the Java archive file packet of corresponding file system;
Data access subelement, for accessing the data information in file system according to Java archive file packet.
Further, load subelement is specifically used for Classloader by way of reflection, and it is corresponding to carry out load application version information
File system Java archive file packet.
It further, further include Second processing module;
Second obtains module, for when operating mode is default operating mode, according to the second default corresponding relationship, directly
The Java archive file packet of the file system of respective version information is loaded, to obtain the data information in this document system.
Further, file system is distributed file system HDFS.
The third aspect, provides a kind of electronic equipment, including memory, processor and storage on a memory and can located
The computer program run on reason device, processor realize above-mentioned data access method when executing described program.
Fourth aspect provides a kind of computer readable storage medium, calculating is stored on computer readable storage medium
Machine program, the program realize above-mentioned data access method when being executed by processor.
The application implements the data access method provided, based on the default corresponding pass of first between access path and operating mode
System determines operating mode corresponding to the access path currently got, obtains respective version according to operating mode to be subsequent
Data information in file system provides premise guarantee;When operating mode is not default operating mode, pass through default file system
System plug-in unit, is handled the data information in the file system of respective version according to operating mode, same so as to be based on
Client, by preset document system plug-in unit, to access the file system of any version, i.e., in the situation transparent to upper layer application
Under, the access compatibility by same client to the file system of each version is realized, is not only effectively prevented by corresponding
The client of version accesses the troublesome operation of corresponding file system, and in the process for realizing compatible access, being not necessarily to will
Data copy in the file system of other versions reduces operation complexity into the file system of current version, improves data
Access efficiency.
The additional aspect of the application and advantage will be set forth in part in the description, these will become from the following description
It obtains obviously, or recognized by the practice of the application.
Detailed description of the invention
The application is above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments
Obviously and it is readily appreciated that, in which:
Fig. 1 is the flow diagram of the data access method of the embodiment of the present application;
Fig. 2 is the process schematic of the data access method of the embodiment of the present application;
Fig. 3 is the basic structure schematic diagram of the data access device of the embodiment of the present application;
Fig. 4 is the detailed construction schematic diagram of the data access device of the embodiment of the present application;
Fig. 5 is the structural schematic diagram of the electronic equipment of the embodiment of the present application.
Specific embodiment
Embodiments herein is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and is only used for explaining the application, and cannot be construed to the limitation to the application.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in the description of the present application
Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition
Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member
Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be
Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or wirelessly coupling.It is used herein to arrange
Diction "and/or" includes one or more associated wholes for listing item or any cell and all combinations.
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party
Formula is described in further detail.
Currently, for the file system (such as file system 1.0 and H file system .0) of different editions, can by
The mode for disposing the client (such as client 1.0 and client 2.0) of different editions on same machine respectively, uses phase
The client answered accesses the file system of different editions respectively, for example, accessing the number in file system 1.0 using client 1.0
According to need to specify corresponding when accessing the data in file system 2.0, the i.e. file system of access different editions using client 2.0
Different editions client, for upper layer application, operating process is very complicated for this, and can not be saturating to upper layer application
In the case where bright, the data sharing of the file system of different editions is realized.In addition, to use client 2.0 to access file system
Data in system 1.0, then must copy data to file system 2.0 from file system 1.0, this process not only operates numerous
It is miscellaneous, and long time will be consumed, cause efficiency lower.
Data access method, device, electronic equipment and computer readable storage medium provided by the present application, it is intended to solve existing
There is the technical problem as above of technology.
How the technical solution of the application and the technical solution of the application are solved with specifically embodiment below above-mentioned
Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept
Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, embodiments herein is described.
Embodiment one
The embodiment of the present application provides a kind of data access method, as shown in Figure 1, comprising:
Step S110 is currently got based on the first default corresponding relationship between access path and operating mode, determination
Operating mode corresponding to access path.
Specifically, client access background server file system in data information when, usually according in advance
The operating mode of storage determines corresponding file system, thus access the data information in the file system determined, and
User usually inputs access path when accessing data by client in the client, so that client is according to access road
Diameter accesses corresponding data information, and therefore, client is needed according to the default corresponding pass of first between access path and operating mode
System, such as the corresponding operating mode 1 of access path 1, the corresponding operating mode 2 of access path 2, the corresponding operating mode 3 of access path 3,
It determines operating mode corresponding to the access path of user's input, that is, determines corresponding to the access path that currently gets of client
Operating mode, and then corresponding file system is determined according to operating mode, and access the number in the file system determined
It is believed that breath.
Step S120, if operating mode is not default operating mode, by preset document system plug-in unit, according to work
Data information in the file system of mode access respective version.
Specifically, in client development process, the operating mode of a default can be preset, for example, client default pair
The operating mode answered is operating mode 2, which is the default operating mode of client, i.e., client is default base
Data information in file system of the operating mode 2 to access corresponding version, such as client default are based on operating mode
2, access the data information in file system 2.0.Wherein, access file system 2.0 in data information not only include read or
The case where obtaining the data information in file system 2.0, further includes the feelings that the data information in file system 2.0 is written
Condition, i.e., into file system 2.0 the case where write-in data information.
Further, in order to realize that client is compatible to the access of the data information in the file system of different editions,
In client development process, also client is allowed to believe with the data in file system of other operating modes to access respective version
Breath, such as client access data information in file system 1.0 with operating mode 1, in another example client is with operating mode 3
Access the data information in file system 3.0.
Further, client can judge currently to obtain according to file system (such as FileSystem) this interface
To access path corresponding to operating mode whether be default operating mode, if corresponding to the access path currently got
Operating mode be not default operating mode, then illustrate that client is the file system to other versions in addition to file system 2.0
The compatible access of data information in system (such as file system 1.0, file system 3.0).At this point, client passes through default file
System plugin accesses in the file system of respective version according to operating mode corresponding to the access path currently got
Data information, i.e. client can not access directly except default operating mode corresponds to file system (such as the file system of version
2.0) file system (such as file system 1.0, file system 3.0) of other versions outside, but pass through preset document system
Plug-in unit, such as SpinnerFileSystem carry out the data information in dereference file system 1.0 or file system 3.0.
Data access method provided by the embodiments of the present application is based on access path and operating mode compared with prior art
Between the first default corresponding relationship, determine operating mode corresponding to the access path that currently gets, be subsequent according to work
Data information in the file system of pattern acquiring respective version provides premise guarantee;When operating mode is not default operating mode
When, by preset document system plug-in unit, the data information in the file system of respective version is handled according to operating mode,
So as to be based on same client, by preset document system plug-in unit, to access the file system of any version, i.e., to upper
In the case that layer application is transparent, the access compatibility by same client to the file system of each version is realized, is not only had
Effect avoids the troublesome operation that corresponding file system can only be accessed by the client of respective version, and is realizing
The process of compatible access, without dropping in the file system of the data copy in the file system of other versions to current version
Low operation complexity improves data access efficiency.
Embodiment two
The embodiment of the present application provides alternatively possible implementation, further includes implementing on the basis of example 1
Method shown in example two, wherein
File system is distributed file system HDFS.
It further include step S111 (being not marked in figure): the version of configuration work mode and file system before step S120
The second default corresponding relationship between information.
Step S120 includes step S1201 (being not marked in figure) and step S1202 (being not marked in figure), wherein
Step S1201: according to the second default corresponding relationship, the version information of the corresponding file system of operating mode is determined.
Step S1203: corresponding file is accessed according to obtained version information is determined by preset document system plug-in unit
Data information in system.
Specifically, can be pre-configured between operating mode and the version information of distributed file system HDFS second is pre-
If corresponding relationship, wherein be one-to-one between operating mode and the version information of HDFS, such as operating mode 1 is corresponding
The version information of HDFS is 1.0 versions, i.e. operating mode 1 and HDFS1.0 corresponds, in another example operating mode 2 is corresponding
The version information of HDFS is 2.0 versions, i.e., operating mode 2 and HDFS2.0 correspond, then for example operating mode 3 is corresponding
The version information of HDFS is 3.0 versions, i.e. operating mode 3 and HDFS3.0 corresponds.It is pre-configured with operating mode and HDFS
After corresponding relationship between version information, convenient for directly determining the HDFS of respective version according to operating mode, and access according to work
Operation mode accesses the data information in the HDFS of respective version.
Further, client is determined current according to the first default corresponding relationship between access path and operating mode
After operating mode corresponding to the access path got, such as determine work corresponding to the access path currently got
Mode is operating mode 1, and then client can be default corresponding according to second between operating mode and the version information of HDFS
Relationship determines the version information (such as 1.0 versions) of HDFS corresponding to current operation mode (such as operating mode 1), i.e.,
Operating mode 1 corresponds to HDFS1.0 can pass through after the version information for determining HDFS corresponding to current operation mode
Preset document system plug-in unit accesses the number in corresponding HDFS1.0 according to obtained version information (such as 1.0 versions) is determined
It is believed that breath.
For the embodiment of the present application, by the second default corresponding relationship between operating mode and the version information of HDFS,
Convenient for rapidly and accurately determining the version information of HDFS corresponding to current operation mode, so that client is by presetting
File system plugin is realized according to obtained version information is determined to the quick, high of the data information in the HDFS of respective version
Effect access realizes the compatible access of the data information corresponded in the HDFS of different editions by same client.
Embodiment three
The embodiment of the present application provides alternatively possible implementation, further includes implementing on the basis of example 2
Method shown in example three, wherein
It further include step S1202 (being not marked in figure) before step S1203: between configuration work mode and Classloader
Third preset corresponding relationship.
Step S1203 includes step S12031 (being not marked in figure), step S12032 (being not marked in figure) and step
S12033 (is not marked in figure), wherein
Step S12031: corresponding relationship is preset according to third, determines Classloader corresponding with operating mode.
Step S12032: by preset document system plug-in unit, according to determining obtained Classloader load application version information pair
The Java archive file packet for the file system answered.
Step S12033: according to Java archive file packet, the data information in file system is accessed.
Wherein, Classloader carrys out the Java archive text of the corresponding file system of load application version information by way of reflection
Part packet.
Specifically, preset document system plug-in unit is through corresponding Classloader in a manner of reflecting, to realize to compatibility
The access of data information in the HDFS (such as HDFS1.0, HDFS3.0) of version, then, inserted by preset document system
Part before accessing the data information in corresponding HDFS, can be pre-configured with operating mode according to obtained version information is determined
Third between Classloader presets corresponding relationship, wherein and it is one-to-one between operating mode and Classloader, such as
Operating mode 1 corresponds to Classloader 1, i.e. operating mode 1 and Classloader 1 corresponds, in another example the corresponding class of operating mode 3 adds
Device 3 is carried, i.e. operating mode 3 and Classloader 3 corresponds.
Further, client is determined current according to the first default corresponding relationship between access path and operating mode
After operating mode corresponding to the access path got, such as determine work corresponding to the access path currently got
Mode is operating mode 1, and then client can be default corresponding according to second between operating mode and the version information of HDFS
Relationship determines the version information (such as 1.0 versions) of HDFS corresponding to current operation mode (such as operating mode 1), i.e.,
Operating mode 1 corresponds to HDFS1.0, can be default pair according to the third between operating mode and Classloader followed by client
It should be related to, determine Classloader (such as Classloader 1), i.e. work corresponding to current operation mode (such as operating mode 1)
Operation mode 1 corresponds to HDFS1.0, and the corresponding Classloader 1 of operating mode 1.
Further, Classloader is in a manner of reflection, by loading the HDFS (such as HDFS1.0) to compatible version
Java archive file packet, to realize the access of data information in the HDFS (such as HDFS1.0) to compatible version, in
It is that (i.e. operating mode 1 corresponds to HDFS1.0, and the corresponding class of operating mode 1 adds for the corresponding relationship that can be determined according to above-mentioned
Carry device 1), through Classloader 1 in a manner of reflection, load the Java archive of the HDFS (such as HDFS1.0) to compatible version
File packet accesses the data information in the HDFS (such as HDFS1.0) of respective version further according to Java archive file packet.
Upper layer is realized by way of introducing related Java archive file packet and change configuration for the embodiment of the present application
Using uniform client, data information in the case of unaware in the HDFS of read/write different editions, and can be moved in HDFS
Data communication is realized when shifting.
Example IV
The embodiment of the present application provides alternatively possible implementation, on the basis of embodiment one is to embodiment three,
It further include method shown in example IV, wherein
It further include step S130 (being not marked in figure): default according to second if operating mode is default operating mode
Corresponding relationship is loaded directly into the Java archive file packet of the file system of respective version information, to access in this document system
Data information.
Specifically, in client development process, the operating mode of a default can be preset, for example, client default pair
The operating mode answered is operating mode 2, which is the default operating mode of client, i.e., client is default base
Data information in HDFS of the operating mode 2 to access corresponding version, such as client default are based on operating mode 2, access
Data information in HDFS2.0.
Further, client can judge currently to obtain according to file system (such as FileSystem) this interface
To access path corresponding to operating mode whether be default operating mode, if corresponding to the access path currently got
Operating mode be default operating mode, for example, operating mode corresponding to the access path currently got is operating mode 2
(default operating mode), then according to the second above-mentioned default corresponding relationship, that can determine client default access is HDFS2.0
In data information.At this point, client can not can be loaded directly into respective version information by means of any plug-in unit or Classloader
HDFS Java archive file packet, directly access the data information in the HDFS2.0.
Further, Fig. 2 gives above-described embodiment one into the HDFS of the client access respective version of example IV
Data information process schematic, in Fig. 2, entire big frame represents the inside when data information in client access HDFS
Implementation procedure, wherein the operating mode of client default is operating mode 2, i.e., default directly accesses the data in HDFS2.0
Information, and the data in the data information and back compatible access HDFS3.0 that can be compatible with forward in access HDFS1.0
Information, thus realize by the same client to the compatible access of the version forward (such as HDFS1.0) of HDFS and to
The compatible access of version (such as HDFS3.0) afterwards, because without the HDFS deployment pair in same machine for each version
The client of version is answered, for example, HDFS1.0 disposes corresponding client 1.0, in another example disposing corresponding client for HDFS2.0
End 2.0.
Further, technical solution of the above-described embodiment one into example IV may be summarized to be: pass through introducing
New realization class SpinnerFileSystem (the i.e. above-mentioned default file system of FileSystem (i.e. above-mentioned file system)
System plug-in unit), realize the compatibility of corresponding different editions HDFS access, wherein specific strategy is as follows:
(1) HDFS of different editions is configured by ViewFs (view filesystem), wherein the HDFS of different editions is used
Different Schema (i.e. above-mentioned operating mode).
(2) the corresponding realization of SpinnerFileSystem is configured for the Schema of HDFS to be compatible with.
(3) in SpinnerFileSystem, by different ClassLoader (i.e. above-mentioned Classloader), with anti-
The mode penetrated realization JAR packet (i.e. above-mentioned Java archive file according to corresponding to the HDFS that Schema loads different editions
Packet), so that the method interface of existing version be realized, it is transferred to by way of reflection in the JAR of respective version, realizes client
End to the access logic of HDFS1.0, HDFS3.0 etc., serializing and RPC (Remote Procedure Call Protocol, far
Journey invocation of procedure agreement) frame compatibility.
Embodiment five
Fig. 3 is a kind of structural schematic diagram of data access device provided by the embodiments of the present application, as shown in figure 3, the device
30 can include determining that module 31 and first processing module 32;Wherein,
Determining module 31 is used to determine current obtain based on the first default corresponding relationship between access path and operating mode
Operating mode corresponding to the access path arrived;
First processing module 32 is used for when operating mode is not default operating mode, by preset document system plug-in unit,
The data information in the file system of respective version is accessed according to operating mode.
It specifically, further include the first configuration module 33, as shown in Figure 4, wherein the first configuration module 33 is used for configuration work
The second default corresponding relationship between mode and the version information of file system.
Further, first processing module 32 includes that version determines submodule 321 and data access submodule 322, such as Fig. 4
It is shown, wherein
Version determines submodule 321 for determining the corresponding file system of operating mode according to the second default corresponding relationship
Version information;
Data access submodule 322 is used to, according to obtained version information is determined, access by preset document system plug-in unit
Data information in corresponding file system.
It further, further include the second configuration module 34, as shown in Figure 4, wherein the second configuration module 34 is for configuring work
Third between operation mode and Classloader presets corresponding relationship.
Further, data access submodule 322 include Classloader determine subelement 3221, load subelement 3222 with
Data access subelement 3223, as shown in Figure 4, wherein
Classloader determines subelement 3221 for presetting corresponding relationship according to third, and determination is corresponding with operating mode
Classloader;
It loads subelement 3222 to be used for through preset document system plug-in unit, according to determining obtained Classloader load application version
The Java archive file packet of the corresponding file system of information;
Data access subelement 3223 is used to access the data information in file system according to Java archive file packet.
Further, load subelement 3221 is specifically used for Classloader by way of reflection, carrys out load application version information
The Java archive file packet of corresponding file system.
It further, further include Second processing module 35, as shown in Figure 4, wherein the second acquisition module 35 is for working as work
When mode is default operating mode, according to the second default corresponding relationship, it is loaded directly into the file system of respective version information
Java archive file packet, to access the data information in this document system.
Further, file system is distributed file system HDFS.
Device provided by the embodiments of the present application, compared with prior art, based on first between access path and operating mode
Default corresponding relationship, determines operating mode corresponding to the access path currently got, is obtained to be subsequent according to operating mode
Data information in the file system of respective version provides premise guarantee;When operating mode is not default operating mode, pass through
Preset document system plug-in unit is handled the data information in the file system of respective version according to operating mode, so as to
It is enough based on same client, by preset document system plug-in unit, to access the file system of any version, i.e., to upper layer application
In the case where transparent, the access compatibility by same client to the file system of each version is realized, is not only effectively avoided
The troublesome operation of corresponding file system is accessed by the client of respective version, and in the mistake for realizing compatible access
Journey, without reducing operation complexity in the file system of the data copy in the file system of other versions to current version,
Improve data access efficiency.
Embodiment six
The embodiment of the present application provides a kind of electronic equipment, as shown in figure 5, electronic equipment shown in fig. 5 500 includes: place
Manage device 501 and memory 503.Wherein, processor 501 is connected with memory 503, is such as connected by bus 502.Further,
Electronic equipment 500 can also include transceiver 504.It should be noted that transceiver 504 is not limited to one in practical application, it should
The structure of electronic equipment 500 does not constitute the restriction to the embodiment of the present application.
Wherein, processor 501 is applied in the embodiment of the present application, for realizing Fig. 3 or determining module shown in Fig. 4 and the
The function of the function of one processing module and the first configuration module shown in Fig. 4, the second configuration module and Second processing module.
Processor 501 can be CPU, general processor, DSP, ASIC, FPGA or other programmable logic device, crystalline substance
Body pipe logical device, hardware component or any combination thereof.It, which may be implemented or executes, combines described by present disclosure
Various illustrative logic blocks, module and circuit.Processor 501 is also possible to realize the combination of computing function, such as wraps
It is combined containing one or more microprocessors, DSP and the combination of microprocessor etc..
Bus 502 may include an access, and information is transmitted between said modules.Bus 502 can be pci bus or EISA
Bus etc..Bus 502 can be divided into address bus, data/address bus, control bus etc..For convenient for indicating, in Fig. 5 only with one slightly
Line indicates, it is not intended that an only bus or a type of bus.
Memory 503 can be ROM or can store the other kinds of static storage device of static information and instruction, RAM
Or the other kinds of dynamic memory of information and instruction can be stored, it is also possible to EEPROM, CD-ROM or other CDs
Storage, optical disc storage (including compression optical disc, laser disc, optical disc, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium
Or other magnetic storage apparatus or can be used in carry or store have instruction or data structure form desired program generation
Code and can by any other medium of computer access, but not limited to this.
Memory 503 is used to store the application code for executing application scheme, and is held by processor 501 to control
Row.Processor 501 is for executing the application code stored in memory 503, to realize that Fig. 3 or embodiment illustrated in fig. 4 are mentioned
The movement of the data access device of confession.
Electronic equipment provided by the embodiments of the present application, including memory, processor and storage on a memory and can located
The computer program that runs on reason device, when processor executes program, compared with prior art, it can be achieved that: based on access path with
The first default corresponding relationship between operating mode determines operating mode corresponding to the access path currently got, is subsequent
The data information obtained in the HDFS of respective version according to operating mode provides premise guarantee;When operating mode is not default work
When mode, by preset document system plug-in unit, the data information in the file system of respective version is carried out according to operating mode
Processing, so as to be based on same client, by preset document system plug-in unit, to access the file system of any version, i.e.,
In the case where transparent to upper layer application, the access compatibility by same client to the file system of each version is realized,
The troublesome operation for accessing corresponding file system by the client of respective version is not only effectively prevented, but also is being realized
The process of compatible access, without dropping in the file system of the data copy in the file system of other versions to current version
Low operation complexity improves data access efficiency.
The embodiment of the present application provides a kind of computer readable storage medium, is stored on the computer readable storage medium
Computer program realizes method shown in embodiment one when the program is executed by processor.Compared with prior art, based on access
The first default corresponding relationship between path and operating mode determines operating mode corresponding to the access path currently got,
Premise guarantee is provided for the data information in the subsequent file system for obtaining respective version according to operating mode;When operating mode not
When being default operating mode, by preset document system plug-in unit, according to operating mode to the number in the file system of respective version
It is believed that breath is handled, so as to be based on same client, by preset document system plug-in unit, to access the text of any version
Part system is realized through same client that is, in the case where transparent to upper layer application to the file system of each version
Access compatibility, not only effectively prevents the troublesome operation that corresponding file system is accessed by the client of respective version,
And in the process for realizing compatible access, without by the file of the data copy in the file system of other versions to current version
In system, operation complexity is reduced, improves data access efficiency.
Computer readable storage medium provided by the embodiments of the present application is suitable for any embodiment of the above method.Herein not
It repeats again.
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other
At least part of the sub-step or stage of step or other steps executes in turn or alternately.
The above is only some embodiments of the application, it is noted that for the ordinary skill people of the art
For member, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications are also answered
It is considered as the protection scope of the application.
Claims (10)
1. a kind of data access method characterized by comprising
Based on the first default corresponding relationship between access path and operating mode, determine corresponding to the access path currently got
Operating mode;
If the operating mode is not default operating mode, by preset document system plug-in unit, according to the operation mode
Access the data information in the file system of respective version.
2. the method according to claim 1, wherein by preset document system plug-in unit, according to the work
Before data information in the file system of mode access respective version, further includes:
The second default corresponding relationship between configuration work mode and the version information of file system.
3. according to the method described in claim 2, it is characterized in that, described by preset document system plug-in unit, according to the work
Operation mode accesses the data information in the file system of respective version, comprising:
According to the described second default corresponding relationship, the version information of the corresponding file system of the operating mode is determined;
By preset document system plug-in unit, according to obtained version information is determined, the data letter in corresponding file system is accessed
Breath.
4. according to the method described in claim 3, it is characterized in that, being obtained by preset document system plug-in unit according to determination
Version information, before accessing the data information in corresponding file system, further includes:
Third between configuration work mode and Classloader presets corresponding relationship.
5. according to the method described in claim 4, it is characterized in that, being obtained by preset document system plug-in unit according to determination
Version information accesses the data information in corresponding file system, comprising:
Corresponding relationship is preset according to the third, determines Classloader corresponding with the operating mode;
By the preset document system plug-in unit, the corresponding file of the version information is loaded according to determining obtained Classloader
The Java archive file packet of system;
According to the Java archive file packet, the data information in the file system is accessed.
6. according to the method described in claim 5, it is characterized in that, the Classloader by way of reflection, to load
State the Java archive file packet of the corresponding file system of version information.
7. method according to claim 1-6, which is characterized in that further include:
If the operating mode is default operating mode, according to the second default corresponding relationship, it is loaded directly into respective version letter
The Java archive file packet of the file system of breath, to access the data information in this document system.
8. a kind of data acquisition facility characterized by comprising
Determining module, for what is currently got based on the first default corresponding relationship between access path and operating mode, determination
Operating mode corresponding to access path;
First processing module, for passing through preset document system plug-in unit, root when the operating mode is not default operating mode
According to the data information in the file system of operating mode access respective version.
9. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor
Machine program, which is characterized in that the processor realizes the described in any item data access of claim 1-7 when executing described program
Method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes claim 1-7 described in any item data access methods when the program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810924374.0A CN109344140A (en) | 2018-08-14 | 2018-08-14 | Data access method, device, electronic equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810924374.0A CN109344140A (en) | 2018-08-14 | 2018-08-14 | Data access method, device, electronic equipment and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109344140A true CN109344140A (en) | 2019-02-15 |
Family
ID=65296850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810924374.0A Pending CN109344140A (en) | 2018-08-14 | 2018-08-14 | Data access method, device, electronic equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109344140A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110688674A (en) * | 2019-09-23 | 2020-01-14 | ***股份有限公司 | Access butt-joint device, system and method and device applying access butt-joint device |
CN114500485A (en) * | 2022-01-28 | 2022-05-13 | 北京沃东天骏信息技术有限公司 | Data processing method and device |
CN110688674B (en) * | 2019-09-23 | 2024-04-26 | ***股份有限公司 | Access dockee, system and method and device for applying access dockee |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101459669A (en) * | 2008-12-29 | 2009-06-17 | 成都市华为赛门铁克科技有限公司 | Access method and apparatus for network file system |
US8533231B2 (en) * | 2011-08-12 | 2013-09-10 | Nexenta Systems, Inc. | Cloud storage system with distributed metadata |
CN104699723A (en) * | 2013-12-10 | 2015-06-10 | 北京神州泰岳软件股份有限公司 | Data exchange adapter and system and method for synchronizing data among heterogeneous systems |
CN104750937A (en) * | 2015-04-08 | 2015-07-01 | 西安电子科技大学 | Integrated circuit layout conversion method based on Hadoop |
-
2018
- 2018-08-14 CN CN201810924374.0A patent/CN109344140A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101459669A (en) * | 2008-12-29 | 2009-06-17 | 成都市华为赛门铁克科技有限公司 | Access method and apparatus for network file system |
US8533231B2 (en) * | 2011-08-12 | 2013-09-10 | Nexenta Systems, Inc. | Cloud storage system with distributed metadata |
CN104699723A (en) * | 2013-12-10 | 2015-06-10 | 北京神州泰岳软件股份有限公司 | Data exchange adapter and system and method for synchronizing data among heterogeneous systems |
CN104750937A (en) * | 2015-04-08 | 2015-07-01 | 西安电子科技大学 | Integrated circuit layout conversion method based on Hadoop |
Non-Patent Citations (1)
Title |
---|
ITEYE_9550: "HDFS:解决HDFS跨版本兼容问题", 《HTTPS://BLOG.CSDN.NET/ITEYE_9550/ARTICLE/DETAILS/82140892》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110688674A (en) * | 2019-09-23 | 2020-01-14 | ***股份有限公司 | Access butt-joint device, system and method and device applying access butt-joint device |
CN110688674B (en) * | 2019-09-23 | 2024-04-26 | ***股份有限公司 | Access dockee, system and method and device for applying access dockee |
CN114500485A (en) * | 2022-01-28 | 2022-05-13 | 北京沃东天骏信息技术有限公司 | Data processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9195527B2 (en) | System and method for processing messages using native data serialization/deserialization in a service-oriented pipeline architecture | |
CN101421711B (en) | Virtual execution system for resource-constrained devices | |
US20070177583A1 (en) | Partial message streaming | |
CN109901827A (en) | Using exchange method, device, electronic equipment and readable storage medium storing program for executing | |
US8473531B2 (en) | Presenting a file system for a file containing items | |
JP2006512694A (en) | System and method for building and running a platform neutral generic service client application | |
WO2008082517A1 (en) | Synchronization patterns for mobile applications | |
US8707329B2 (en) | Open framework system for heterogeneous computing and service integration | |
US8626526B2 (en) | System and method for a healthcare communication framework | |
CN106713469B (en) | Dynamic loading method, device and system for distributed container | |
CN106445951A (en) | File transmission method and apparatus | |
CN109104368B (en) | Connection request method, device, server and computer readable storage medium | |
CN107544298A (en) | A kind of camera call method and device | |
CN104239508A (en) | Data query method and data query device | |
CN109344140A (en) | Data access method, device, electronic equipment and computer storage medium | |
US7685258B2 (en) | Disconnectible applications | |
CN111294377B (en) | Dependency network request sending method, terminal device and storage medium | |
US7519977B2 (en) | System and method for asynchronously invoking dynamic proxy interface using supplemental interfaces | |
CN110516176A (en) | Processing method, device, electronic equipment and the readable storage medium storing program for executing of user's request | |
US7203945B2 (en) | Import/export utility and a method of processing data using the same | |
US6834281B1 (en) | Method and apparatus to support multi-node direct access to file system data | |
CN113505125A (en) | Data uplink method and uplink proxy device | |
US7487405B1 (en) | Method and mechanism for dynamically configuring logical paths of state machines | |
US7716197B2 (en) | XCAP and SIP filter chain state transforms via dynamic helper functions for internet multimedia subsystems | |
EP1851625A4 (en) | Simulating an application for subsequent deployment to a device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190215 |