30 jan 2007 kl. 04.18 skrev Daniel Noll:
karl wettin wrote:
Then it hit me that perheps the integer limitation should be in
the store (Directory) and not the IndexReader? If not now, perhaps
in the future when everybody is running on 64bit JVMs. I don't
think it will be a very expensive thing to implement. But did
anyone need that yet?
I don't know about it not being expensive to implement. Keep in
mind that even on a 64-bit JVM, you still can't use longs in array
indexes. :-)
I think the big undertaking would be to refactor all of Lucene to use
longs as document numbers.
But not in the store. There it would still be integers, and the
MultiReader can keep track of Integer.MAX_VALUE stores.
Integer.MAX_VALUE*Integer.MAX_VALUE = Long.MAX_VALUE. So there would
not have to be any arrays around with a length greater than
Integer.MAX_VALUE?
class SegmentReader extends IndexReader {
+ private int documentNumber(long n) throws IOException {
+ if (n > Integer.MAX_VALUE) {
+ throw new IOException("Max " + Integer.MAX_VALUE + " documents
in a Segement!");
+ }
+ return (int)n;
+ }
- protected void doDelete(int docNum) {
+ protected void doDelete(long longDocNum) {
+ int docNum = documentNumber(longDocNum);
...
But lets not do that right away now.
And as we are on the subject of things not to be implemented anytime
soon, I would like a layer of JXTA (or so) via bluetooth for Lucene
on J2ME for mining purposes.
I'm serious.
As always in the the future, people will walk around with a
communicator in the pocket. It will keep track of all your movies,
music, drink recipes, and all that other important stuff. And your
preferences about them. And of course, lots of big brother related
things too. About you and about other people that might be
interesting for you to know what they have been doing. And how much
you trust them. And how much you like them. With the use of neat
technology the collective intelligence and karma of these devices
will ensure that all of us get to listen to great music all the time,
drink the things we will enjoy the most at the moment, only meet
interesting people all the time, and all that. Most important, it
will supprise us. It will be great, so remeber where you heard about
it the first time!
--
karl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]