Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
Lucene.Net, mail # dev - [Lucene.Net] Roadmap


Copy link to this message
-
Re: [Lucene.Net] Roadmap
Christopher Currens 2011-11-21, 20:18
Some of the Lucene classes have Dispose methods, well, ones that call Close
(and that Close method may or may not call base.Close(), if needed or not).
 Virtual dispose methods can be dangerous only in that they're easy to
implement wrong.  However, it shouldn't be too bad, at least with a
line-by-line port, as we would make the call to the base class whenever
Lucene does, and that would (should) give us the same behavior, implemented
properly.  I'm not aware of differences in the JVM, regarding inheritance
and base methods being called automatically, particularly Close methods.

Slightly unrelated, another annoyance is the use of Java Iterators vs C#
Enumerables.  A lot of our code is there simply because there are
Iterators, but it could be converted to Enumerables. The whole HasNext,
Next vs C#'s MoveNext(), Current is annoying, but it's used all over in the
base code, and would have to be changed there as well.  Either way, I would
like to push for that before 3.0.3 is relased.  IMO, small changes like
this still keep the code similar to the line-by-line port, in that it
doesn't add any difficulties in the porting process, but provides great
benefits to the users of the code, to have a .NET centric API.  I don't
think it would violate our project desciption we have listed on our
Incubator page, either.
Thanks,
Christopher

On Mon, Nov 21, 2011 at 12:03 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

> +1 on the suggestion to move Close -> IDisposable; not being able to use
> "using" is such a pain, and an eyesore on the code.
>
>
> Although it will have to be done properly, and not just have Dispose call
> Close (you should have proper protected virtual Dispose methods to take
> inheritance into account, etc).
>
>
> - Nick
>
> ----------------------------------------
>
> From: "Christopher Currens" <[EMAIL PROTECTED]>
>
> Sent: Monday, November 21, 2011 2:56 PM
>
> To: [EMAIL PROTECTED]
>
> Subject: Re: [Lucene.Net] Roadmap
>
>
> Regarding the 3.0.3 branch I started last week, I've put in a lot of late
>
> nights and gotten far more done in a week and a half than I expected.  The
>
> list of changes is very large, and fortunately, I've documented it in some
>
> files that are in the branches root of certain projects.  I'll list what
>
> changes have been made so far, and some of the concerns I have about them,
>
> as well as what still needs to be done.  You can read them all in detail
> in
>
> the files that are in the branch.
>
>
> All changes in 3.0.3 have been ported to the Lucene.Net and
>
> Lucene.Net.Test, except BooleanClause, LockStressTest, MMapDirectory,
>
> NIOFSDirectory, DummyConcurrentLock, NamedThreadFactory, and
>
> ThreadInterruptedException.
>
>
> MMapDirectory and NIOFSDirectory have never been ported in the first place
>
> for 2.9.4, so I'm not worried about those.  LockStressTest is a
>
> command-line tool, porting it should be easy, but not essential to a 3.0.3
>
> release, IMO.  DummyConcurrentLock also seems unnecessary (and
>
> non-portable) for .NET, since it's based around Java's Lock class and is
>
> only used to bypass locking, which can be done by passing new Object() to
>
> the method.
>
> NamedThreadFactory I'm unsure about.  It's used in ParallelMultiSearcher
>
> (in which I've opted to use the TPL), and seems to be only used for
>
> debugging, possibly testing.  Either way, I'm not sure it's necessary.
>
> Also, named threads would mean we probably would have to move the class
>
> from the TPL, which greatly simplified the code and parallelization of it
>
> all, as I can't see a way to Set names for a Task.  I suppose it might be
>
> possible, as Tasks have unique Ids, and you could use a Dictionary to map
>
> the thread's name to the ID in the factory, but you'd have to create a
>
> helper function that would allow you to find a task by its name, which
>
> seems more work than the resulting benefits.  VS2010 already has better
>
> support for debugging tasks over threads (I used it when writing the