You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2022/01/05 14:54:21 UTC

[lucene] branch branch_9x updated (7525941 -> 90cc570)

This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git.


    from 7525941  LUCENE-10352: Convert TestAllAnalyzersHaveFactories and TestRandomChains to a global integration test and discover classes to check from module system (#582)
     new 76d8350  LUCENE-10343: Remove MyRandom in favor of test framework random (#573)
     new 90cc570  Modernize release announcement text. (#525)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dev-tools/scripts/releaseWizard.yaml               |  2 +-
 .../packed/TestLegacyDirectPacked.java             | 27 +++++-----------------
 .../lucene/util/packed/TestDirectPacked.java       | 26 ++++-----------------
 3 files changed, 12 insertions(+), 43 deletions(-)

[lucene] 01/02: LUCENE-10343: Remove MyRandom in favor of test framework random (#573)

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 76d83507beddcc421fc1906e0be4562e16531819
Author: gf2121 <52...@users.noreply.github.com>
AuthorDate: Wed Jan 5 22:31:00 2022 +0800

    LUCENE-10343: Remove MyRandom in favor of test framework random (#573)
---
 .../packed/TestLegacyDirectPacked.java             | 27 +++++-----------------
 .../lucene/util/packed/TestDirectPacked.java       | 26 ++++-----------------
 2 files changed, 11 insertions(+), 42 deletions(-)

diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java
index 63c6952..d571e5e 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/packed/TestLegacyDirectPacked.java
@@ -16,9 +16,9 @@
  */
 package org.apache.lucene.backward_codecs.packed;
 
+import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
 import java.util.Random;
 import org.apache.lucene.backward_codecs.store.EndiannessReverserUtil;
-import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
@@ -26,6 +26,7 @@ import org.apache.lucene.store.IndexOutput;
 import org.apache.lucene.tests.util.LuceneTestCase;
 import org.apache.lucene.tests.util.TestUtil;
 import org.apache.lucene.util.LongValues;
+import org.apache.lucene.util.packed.PackedInts;
 
 public class TestLegacyDirectPacked extends LuceneTestCase {
 
@@ -94,7 +95,7 @@ public class TestLegacyDirectPacked extends LuceneTestCase {
   }
 
   private void doTestBpv(Directory directory, int bpv, long offset) throws Exception {
-    MyRandom random = new MyRandom(random().nextLong());
+    Random random = random();
     int numIters = TEST_NIGHTLY ? 100 : 10;
     for (int i = 0; i < numIters; i++) {
       long[] original = randomLongs(random, bpv);
@@ -122,29 +123,13 @@ public class TestLegacyDirectPacked extends LuceneTestCase {
     }
   }
 
-  private long[] randomLongs(MyRandom random, int bpv) {
+  private long[] randomLongs(Random random, int bpv) {
     int amount = random.nextInt(5000);
     long[] longs = new long[amount];
+    long max = PackedInts.maxValue(bpv);
     for (int i = 0; i < longs.length; i++) {
-      longs[i] = random.nextLong(bpv);
+      longs[i] = RandomNumbers.randomLongBetween(random, 0, max);
     }
     return longs;
   }
-
-  // java.util.Random only returns 48bits of randomness in nextLong...
-  static class MyRandom extends Random {
-    byte[] buffer = new byte[8];
-    ByteArrayDataInput input = new ByteArrayDataInput();
-
-    MyRandom(long seed) {
-      super(seed);
-    }
-
-    public synchronized long nextLong(int bpv) {
-      nextBytes(buffer);
-      input.reset(buffer);
-      long bits = input.readLong();
-      return bits >>> (64 - bpv);
-    }
-  }
 }
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
index b4e04e8..3ed18de 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
@@ -16,8 +16,8 @@
  */
 package org.apache.lucene.util.packed;
 
+import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
 import java.util.Random;
-import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
@@ -111,7 +111,7 @@ public class TestDirectPacked extends LuceneTestCase {
 
   private void doTestBpv(Directory directory, int bpv, long offset, boolean merge)
       throws Exception {
-    MyRandom random = new MyRandom(random().nextLong());
+    Random random = random();
     int numIters = TEST_NIGHTLY ? 100 : 10;
     for (int i = 0; i < numIters; i++) {
       long[] original = randomLongs(random, bpv);
@@ -145,29 +145,13 @@ public class TestDirectPacked extends LuceneTestCase {
     }
   }
 
-  private long[] randomLongs(MyRandom random, int bpv) {
+  private long[] randomLongs(Random random, int bpv) {
     int amount = random.nextInt(5000);
     long[] longs = new long[amount];
+    long max = PackedInts.maxValue(bpv);
     for (int i = 0; i < longs.length; i++) {
-      longs[i] = random.nextLong(bpv);
+      longs[i] = RandomNumbers.randomLongBetween(random, 0, max);
     }
     return longs;
   }
-
-  // java.util.Random only returns 48bits of randomness in nextLong...
-  static class MyRandom extends Random {
-    byte[] buffer = new byte[8];
-    ByteArrayDataInput input = new ByteArrayDataInput();
-
-    MyRandom(long seed) {
-      super(seed);
-    }
-
-    public synchronized long nextLong(int bpv) {
-      nextBytes(buffer);
-      input.reset(buffer);
-      long bits = input.readLong();
-      return bits >>> (64 - bpv);
-    }
-  }
 }

[lucene] 02/02: Modernize release announcement text. (#525)

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 90cc57034329835271602b6c170cbd2bfa287fc1
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Wed Jan 5 15:53:49 2022 +0100

    Modernize release announcement text. (#525)
    
    It currently reads as Lucene is a full-text search library when it can do much
    more than that nowadays.
---
 dev-tools/scripts/releaseWizard.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-tools/scripts/releaseWizard.yaml b/dev-tools/scripts/releaseWizard.yaml
index 8e2c6a6..cc31447 100644
--- a/dev-tools/scripts/releaseWizard.yaml
+++ b/dev-tools/scripts/releaseWizard.yaml
@@ -88,7 +88,7 @@ templates:
 
     The Lucene PMC is pleased to announce the release of Apache Lucene {{ release_version }}.
 
-    Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.
+    Apache Lucene is a high-performance, full-featured search engine library written entirely in Java. It is a technology suitable for nearly any application that requires structured search, full-text search, faceting, nearest-neighbor search across high-dimensionality vectors, spell correction or query suggestions.
 
     This release contains numerous bug fixes, optimizations, and improvements, some of which are highlighted below. The release is available for immediate download at: