From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 67DC3138824 for ; Thu, 23 Oct 2014 09:22:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67D3FE07FC; Thu, 23 Oct 2014 09:22:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E37DDE07F5 for ; Thu, 23 Oct 2014 09:22:37 +0000 (UTC) Received: from [192.168.1.7] (ip70-181-96-121.oc.oc.cox.net [70.181.96.121]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 98A4434039F for ; Thu, 23 Oct 2014 09:22:36 +0000 (UTC) Message-ID: <5448C8DA.8080009@gentoo.org> Date: Thu, 23 Oct 2014 02:22:34 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] Re: [PATCH] emerge --search: use description index References: <5441DE73.3090601@gentoo.org> <544201C4.5050106@gentoo.org> <54443249.1090901@gentoo.org> <20141023015515.26ca0c7e.dolsen@gentoo.org> In-Reply-To: <20141023015515.26ca0c7e.dolsen@gentoo.org> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Archives-Salt: 80379faf-8582-4db6-b75e-1bc89f9809ae X-Archives-Hash: 2264fd4d2da95aa2d7d594392cad355d On 10/23/2014 01:55 AM, Brian Dolbec wrote: > What I wonder, is why the following two classes aren't in the portage > namespace. There is far too much logic embedded in the _emerge > namespace. Most probably under the portage/dpapi subpkg. Looking at > them, they do look very similar to the portdbapi and vardbapi classes. > They are just stripped down and optimised for this data. They also > don't seem to use any _emerge specific namespace modules that I saw. > > Perhaps with a file name of index.py or indexers.py The classes aren't really designed for general use, so that's why I left them bundled in _emerge.search. However, the classes could certainly be fleshed out for general-purpose use. In their current state, the indexer classes implement only the minimal functionality required by the search class. A drawback of the current IndexedPortdb design is that it holds all of the index data in memory at once. I took this approach because that allowed it to easily fit the dbapi interface used by the search class. In the future, we might decide to rewrite the search class so that it processes the index as a stream, which will allow individual search results to be displayed as soon as they are located [1]. This rewrite will require a new index API. So, considering that we probably want a new index API in the future, we might save some unnecessary effort and stick with the special-purpose/minimalistic IndexedPortdb/Vardb adapters for now. [1] https://bugs.gentoo.org/show_bug.cgi?id=412471 -- Thanks, Zac