Lucene 3.0.0 Details (1)-Deep Exploration of lucene consumer and processor

Source: Internet
Author: User
Tags data structures

For the Lucene 3.0.0 threading Model I am very interested in, because for multithreading I also recently contact, although I contact the program is nearly ten years, there are several places I have been very sorry:

No network-related code, no multithreaded programs, no database-related content, no Linux-related programs written

. You may find it very strange:

So, what have you been doing for the past ten years? This is not basically equivalent to not understand the program Ah! (–_-)

It took me 6 years to consolidate the basics of algorithms and data structures, another 4 years confused a lot of such as 3D games, the game of artificial intelligence programs, and so on, overall, there is not too much wasted time code written not much, the algorithm is not bad, but the efficiency is not quite high, I hope to be able to make a good repair in the next few years, slowly become a "snake balm" to the mess of things to get.

I have a hobby for studying other people's programs, as opposed to staying on the "use" level, it is better to stay in the "research" level, my feeling is that in the work should be as far as possible to the foundation for a strong, can be more people in the code advanced Ideas learned, otherwise work, the project pressure and life pressure will make people impetuous , it can make people do not have a definite force to study the content that needs to spend a lot of time to understand. In fact, the current open source framework (such as Apache below) and the free use of the framework (such as WPF, etc.) has been very much, want to just "do" a project is not difficult, of course, is a general project, not a huge project. The important thing is how to elevate your mind to a higher level, and I hope I can develop it according to my own ideas. Maybe that's why I didn't get an outsourced project from college.

I would like to share my experience with you by writing a journal, for an open source framework research may also need a small team to do together, a person reading a large number of code is a very bitter thing, if someone discusses, may be a lot of problems will be solved. In addition, for Lucene, I would like to be able to have a considerable grasp of the source code, use of operating system-independent libraries and C + + to do some rewriting, for the key code to achieve, on the one hand, the language is to work later is C + + rather than Java, on the other hand to leave some "available" code . This is still on the "research" level, the future of the project can be developed into "usable" need to look again.

In addition reprint please specify the source: leftnoteasy.cnblogs.com, Leftnoteasy original

Consumer call section of the Lucene 3.0.0 (cont.):

The thread structure of Lucene is closely related to the consumer model of Lucene, and I have a log documenting some of the consumer parts of Lucene, see: Lucene 3.0.0 Sample Resolution (3)- Indexfiles.java, before writing more rough, there are a lot of content is not recorded completely, here to add:

To unlock the complex consumer invocation model, I tried to draw a uml diagram to clarify the idea:

The classes that are directly related to consumer and processor have the following, and it looks scary, and I'm trying to get a clear picture of the relationship between them:

It is noteworthy that when reading the code, it is found that sometimes even two abstract classes have the same method and do not use inherited relationships to do so, it may be that lucene developers in order to avoid rtti errors, this is very easy to confuse people in the first reading code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.