Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for batch query of HBase (Hadoop Database) data for Servlet in TTLB (time to last byte) based on Lua

A batch and table data technology, applied in the field of data processing, can solve the problems of increasing delay, reducing system concurrent processing performance, and large system overhead, and achieving the effect of reducing I/O and system memory overhead.

Active Publication Date: 2015-04-29
LUZHOU MEDICAL COLLEGE
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] 4. Increase delay
Not only there is a large system overhead, reducing the concurrent processing performance of the system, and it is difficult to determine the blocking time, but also causes more serious problems: According to the HBase specification, the HTable.get(Get) and HTable.put(Put) methods are also unsafe

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for batch query of HBase (Hadoop Database) data for Servlet in TTLB (time to last byte) based on Lua

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0064] Classes and functions involved in the present invention and implementations are as follows:

[0065] 1. Wrapper class

[0066] Initialize the ReadHBase class, and call the Lua API of LuaScript to provide services to the Servlet through the Luajava plug-in: setReadParameter caches the query request in the Readqueue table of LuaScript; getResult quickly finds the query result from the Readqueue. In addition, the first thread in the TTLB calls schedule to complete the batch query (other threads return, wait or search for query results).

[0067] Data members of the Wrapper class:

[0068] 1. private Boolean startscheduler; / / whether the batch query request execution thread has been started

[0069] 2. private static Wrapper instance=new Wrapper(); / / single instance constructor

[0070] 3. private LuaState l; / / LuaJava library

[0071] 4. private lock = "LuaScheduler"; / / synchronous lock

[0072] 5. private int lastbatchquerytime; / / last batch query ex...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for batch query of HBase (Hadoop Database) data for Servlet in TTLB (time to last byte) (request response time) based on Lua. The method comprises a Wrapper type, a LuaScript type and a ReadHBase type, and in the Wrapper type, using Java API (Application Program Interface) to package Lua API of the LuaScript, and supporting Servlet calling; caching a query request into a Lua table, and finding a query result in the Lua table; in the LuaScript type, packing all threads in the TTLB, sending the query request, calling the Java API of the ReadHBase type to complete batch query of HBase table records, unpacking returning results, and generating the returning result of each thread; in the ReadHBase type, unpacking parameters sent by the LuaScript, and calling a function HTable.get (List<Get>) of the Java API; packing returning results of the get function; packing and unpacking the batch query request and the batch query result, so as to realize the batch query of any HBase table, and query any HBase table record. The method has the advantage that the method can be used for the Servlet to search any HBase table data, and the batch query request of the Servlet can be cached through the Lua table, so as to guarantee the thread security of the Servlet.

Description

technical field [0001] The invention relates to a data processing method, in particular to a Lua-based method for querying HBase data in batches by a Servlet in a TTLB. Background technique [0002] HBase is a highly reliable, high-performance, scalable open source database that supports unstructured storage. Using Servlet to access HBase may cause two threads to access the same resource at the same time, resulting in data inconsistency and thread insecurity. Servlet specifications, Java textbooks, Internet and related literature point out that the existing methods to solve thread insecurity mainly include: implementing the SingleThreadModel interface, synchronizing shared data, avoiding object instances, and increasing delay. [0003] 1. Implement the SingleThreadModel interface [0004] The SingleThreadModel interface is implemented, and the Servlet container ensures that only one thread servlet instance is running, while other requests are queued. [0005] 2. Synchroni...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/24552
Inventor 胡自权尹德辉夏纪毅
Owner LUZHOU MEDICAL COLLEGE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products