File read-write opening method and device

An open method and file technology, applied in the field of data processing, can solve problems such as inability to provide services, consume large handles, and fail to allocate handles

Active Publication Date: 2019-10-08
HANGZHOU HIKVISION DIGITAL TECH
View PDF2 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Among them, reading and opening a file requires opening a new read-in stream, which consumes a handle, and writing and opening a file requires opening a new write-out stream, which consumes a handle
This causes a large number of handles to be consumed during the running of ES
[0004] With the increase of storage index files in ES, the number of shards created in ES and the number of ES indexes will continue to increase, and the number of handle

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
  • File read-write opening method and device
  • File read-write opening method and device
  • File read-write opening method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0124] The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

[0125] For ease of understanding, the words appearing in the embodiments of the present application are explained below.

[0126] Index files: including metadata files and index data files.

[0127] File stream: includes read-in stream and write-out stream.

[0128] Read into the stream: also known as the input stream. In Java, a resource is read from the outside world in the form of an input stream, which can be files, data on the network, and so on. In a broader sense, the inpu...

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 embodiment of the invention provides a file read-write opening method and device. The read-write opening method comprises: acquiring a request for a read-in flow of a target index file; judging whether a read-in stream of the target index file exists in the started read-in streams or not; if the read-in flow of the target index file does not exist and it is determined that the total number ofthe started read-in flow and the started write-out flow reaches a first preset threshold value, closing the file flow according to a preset flow closing strategy, wherein the file flow is a read-in flow or a write-out flow; starting a new read-in flow as a target read-in flow of the target index file; and marking the target read-in flow as being occupied, and opening the target index file according to the reference read of the target read-in flow. By applying the embodiment of the invention, the distribution of the handles is ensured, and the possibility of unhealthy service states of the ES caused by unreasonable use of the handles is reduced.

Description

technical field [0001] The present application relates to the technical field of data processing, in particular to a method and device for reading, writing and opening a file. Background technique [0002] ElasticSearch (hereinafter referred to as ES) is a distributed full-text search system based on Lucene, including multiple node devices. Lucene is a full-text search library. Its internal file-based architecture establishes inverted indexes for the texts to be retrieved. These indexes are stored in the form of different files as Lucene indexes. Lucene's index consists of multiple index files, and the index files are divided into metadata files and index data files. Such as figure 1 The ES shown includes multiple ES indexes such as figure 1 ES Index 1, ES Index 2, and ES Index 3 are shown. Each ES index includes multiple shards, such as figure 1 The ES index 3 shown includes Shard1, Shard2 and Shard3. A shard is an index unit, corresponding to a Lucene index, and a Lu...

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
IPC IPC(8): G06F16/33G06F16/31
CPCG06F16/316G06F16/3331
Inventor 邓长春
Owner HANGZHOU HIKVISION DIGITAL TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products