Skip to content

Commit a4e0d57

Browse files
Jelmer Kuperusjelmerk
Jelmer Kuperus
authored andcommitted
Repackage classes to avoid JPMS issues
1 parent da73e22 commit a4e0d57

File tree

60 files changed

+190
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+190
-171
lines changed

FAQ.md

+2-2

hnswlib-core-jdk17/README.md

+1-1

hnswlib-core-jdk17/src/main/java/com/github/jelmerk/knn/Jdk17DistanceFunctions.java hnswlib-core-jdk17/src/main/java/com/github/jelmerk/hnswlib/jdk17/Jdk17DistanceFunctions.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.jdk17;
22

3+
import com.github.jelmerk.hnswlib.core.DistanceFunction;
34
import jdk.incubator.vector.*;
45

56
/**

hnswlib-core-jdk17/src/test/java/com/github/jelmerk/knn/Jdk17DistanceFunctionsTest.java hnswlib-core-jdk17/src/test/java/com/github/jelmerk/hnswlib/jdk17/Jdk17DistanceFunctionsTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.jdk17;
22

3+
import com.github.jelmerk.hnswlib.core.DistanceFunction;
4+
import com.github.jelmerk.hnswlib.core.DistanceFunctions;
5+
import com.github.jelmerk.hnswlib.jdk17.Jdk17DistanceFunctions;
36
import org.junit.jupiter.api.Disabled;
47
import org.junit.jupiter.api.Test;
58

hnswlib-core/README.md

+17-7

hnswlib-core/src/main/java/com/github/jelmerk/knn/DistanceFunction.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/DistanceFunction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.Serializable;
44

hnswlib-core/src/main/java/com/github/jelmerk/knn/DistanceFunctions.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/DistanceFunctions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
/**
44
* Collection of distance functions.

hnswlib-core/src/main/java/com/github/jelmerk/knn/Index.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/Index.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

3-
import com.github.jelmerk.knn.util.NamedThreadFactory;
3+
import com.github.jelmerk.hnswlib.core.util.NamedThreadFactory;
44

55
import java.io.*;
66
import java.nio.file.Files;

hnswlib-core/src/main/java/com/github/jelmerk/knn/IndexException.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/IndexException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
/**
44
* Base class for exceptions thrown by {@link Index} implementations.

hnswlib-core/src/main/java/com/github/jelmerk/knn/Item.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/Item.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.Serializable;
44

hnswlib-core/src/main/java/com/github/jelmerk/knn/JavaObjectSerializer.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/JavaObjectSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.*;
44

hnswlib-core/src/main/java/com/github/jelmerk/knn/NullProgressListener.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/NullProgressListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
/**
44
* Implementation of {@link ProgressListener} that does nothing.

hnswlib-core/src/main/java/com/github/jelmerk/knn/ObjectSerializer.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/ObjectSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.IOException;
44
import java.io.ObjectInput;

hnswlib-core/src/main/java/com/github/jelmerk/knn/ProgressListener.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/ProgressListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
/**
44
* Callback interface for reporting on the progress of an index operation.

hnswlib-core/src/main/java/com/github/jelmerk/knn/SearchResult.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/SearchResult.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.Serializable;
44
import java.util.Comparator;

hnswlib-core/src/main/java/com/github/jelmerk/knn/SparseVector.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/SparseVector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.io.Serializable;
44

hnswlib-core/src/main/java/com/github/jelmerk/knn/UncategorizedIndexException.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/UncategorizedIndexException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
/**
44
* Thrown to indicate that a nested exception occurred in one of the worker threads.

hnswlib-core/src/main/java/com/github/jelmerk/knn/bruteforce/BruteForceIndex.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/bruteforce/BruteForceIndex.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package com.github.jelmerk.knn.bruteforce;
2-
3-
import com.github.jelmerk.knn.DistanceFunction;
4-
import com.github.jelmerk.knn.Index;
5-
import com.github.jelmerk.knn.Item;
6-
import com.github.jelmerk.knn.SearchResult;
7-
import com.github.jelmerk.knn.util.ClassLoaderObjectInputStream;
8-
import com.github.jelmerk.knn.util.DummyComparator;
1+
package com.github.jelmerk.hnswlib.core.bruteforce;
2+
3+
import com.github.jelmerk.hnswlib.core.DistanceFunction;
4+
import com.github.jelmerk.hnswlib.core.Index;
5+
import com.github.jelmerk.hnswlib.core.Item;
6+
import com.github.jelmerk.hnswlib.core.SearchResult;
7+
import com.github.jelmerk.hnswlib.core.util.ClassLoaderObjectInputStream;
8+
import com.github.jelmerk.hnswlib.core.util.DummyComparator;
99

1010
import java.io.*;
1111
import java.nio.file.Files;

hnswlib-core/src/main/java/com/github/jelmerk/knn/hnsw/HnswIndex.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/hnsw/HnswIndex.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.github.jelmerk.knn.hnsw;
1+
package com.github.jelmerk.hnswlib.core.hnsw;
22

33

4-
import com.github.jelmerk.knn.*;
5-
import com.github.jelmerk.knn.util.*;
4+
import com.github.jelmerk.hnswlib.core.*;
5+
import com.github.jelmerk.hnswlib.core.util.*;
66
import org.eclipse.collections.api.list.primitive.MutableIntList;
77
import org.eclipse.collections.api.map.primitive.MutableObjectIntMap;
88
import org.eclipse.collections.api.map.primitive.MutableObjectLongMap;

hnswlib-core/src/main/java/com/github/jelmerk/knn/hnsw/SizeLimitExceededException.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/hnsw/SizeLimitExceededException.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.jelmerk.knn.hnsw;
1+
package com.github.jelmerk.hnswlib.core.hnsw;
22

3-
import com.github.jelmerk.knn.IndexException;
3+
import com.github.jelmerk.hnswlib.core.IndexException;
44

55
/**
66
* Thrown to indicate the size of the index has been exceeded.

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/ArrayBitSet.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/ArrayBitSet.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

3-
import java.io.Serial;
43
import java.io.Serializable;
54
import java.util.Arrays;
65

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/ClassLoaderObjectInputStream.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/ClassLoaderObjectInputStream.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33

44
import java.io.IOException;

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/DummyComparator.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/DummyComparator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33
import java.io.Serializable;
44
import java.util.Comparator;

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/GenericObjectPool.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/GenericObjectPool.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33
import java.io.Serializable;
44
import java.util.concurrent.ArrayBlockingQueue;

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/Murmur3.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/Murmur3.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33

44
/**

hnswlib-core/src/main/java/com/github/jelmerk/knn/util/NamedThreadFactory.java hnswlib-core/src/main/java/com/github/jelmerk/hnswlib/core/util/NamedThreadFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33
import java.util.concurrent.ThreadFactory;
44
import java.util.concurrent.atomic.AtomicInteger;

hnswlib-core/src/test/java/com/github/jelmerk/knn/DistanceFunctionsTest.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/DistanceFunctionsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import org.junit.jupiter.api.Test;
44

hnswlib-core/src/test/java/com/github/jelmerk/knn/ProgressUpdate.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/ProgressUpdate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.util.Objects;
44

hnswlib-core/src/test/java/com/github/jelmerk/knn/TestItem.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/TestItem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn;
1+
package com.github.jelmerk.hnswlib.core;
22

33
import java.util.Arrays;
44

hnswlib-core/src/test/java/com/github/jelmerk/knn/bruteforce/BruteForceIndexTest.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/bruteforce/BruteForceIndexTest.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
package com.github.jelmerk.knn.bruteforce;
1+
package com.github.jelmerk.hnswlib.core.bruteforce;
22

3-
import com.github.jelmerk.knn.*;
3+
import com.github.jelmerk.hnswlib.core.DistanceFunctions;
4+
import com.github.jelmerk.hnswlib.core.ProgressUpdate;
5+
import com.github.jelmerk.hnswlib.core.SearchResult;
6+
import com.github.jelmerk.hnswlib.core.TestItem;
47

58
import java.io.ByteArrayInputStream;
69
import java.io.ByteArrayOutputStream;

hnswlib-core/src/test/java/com/github/jelmerk/knn/hnsw/HnswIndexTest.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/hnsw/HnswIndexTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.jelmerk.knn.hnsw;
1+
package com.github.jelmerk.hnswlib.core.hnsw;
22

3-
import com.github.jelmerk.knn.*;
3+
import com.github.jelmerk.hnswlib.core.*;
44

55
import java.io.ByteArrayInputStream;
66
import java.io.ByteArrayOutputStream;

hnswlib-core/src/test/java/com/github/jelmerk/knn/util/ArrayBitSetTest.java hnswlib-core/src/test/java/com/github/jelmerk/hnswlib/core/util/ArrayBitSetTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.util;
1+
package com.github.jelmerk.hnswlib.core.util;
22

33
import org.junit.jupiter.api.Test;
44

hnswlib-examples/hnswlib-examples-java/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</execution>
3535
</executions>
3636
<configuration>
37-
<mainClass>com.github.jelmerk.knn.examples.FastText</mainClass>
37+
<mainClass>com.github.jelmerk.hnswlib.examples.FastText</mainClass>
3838
</configuration>
3939
</plugin>
4040
</plugins>

hnswlib-examples/hnswlib-examples-java/src/main/java/com/github/jelmerk/knn/examples/FastText.java hnswlib-examples/hnswlib-examples-java/src/main/java/com/github/jelmerk/hnswlib/examples/FastText.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.jelmerk.knn.examples;
1+
package com.github.jelmerk.hnswlib.examples;
22

33
import java.io.*;
44
import java.net.URL;
@@ -10,14 +10,14 @@
1010
import java.util.stream.Collectors;
1111
import java.util.zip.GZIPInputStream;
1212

13-
import com.github.jelmerk.knn.DistanceFunctions;
14-
import com.github.jelmerk.knn.Index;
15-
import com.github.jelmerk.knn.SearchResult;
16-
import com.github.jelmerk.knn.hnsw.HnswIndex;
13+
import com.github.jelmerk.hnswlib.DistanceFunctions;
14+
import com.github.jelmerk.hnswlib.Index;
15+
import com.github.jelmerk.hnswlib.SearchResult;
16+
import com.github.jelmerk.hnswlib.hnsw.HnswIndex;
1717

1818
import static java.util.concurrent.TimeUnit.MILLISECONDS;
1919

20-
import static com.github.jelmerk.knn.util.VectorUtils.normalize;
20+
import static com.github.jelmerk.hnswlib.util.VectorUtils.normalize;
2121

2222
/**
2323
* Example application that downloads the english fast-text word vectors, inserts them into an hnsw index and lets

hnswlib-examples/hnswlib-examples-java/src/main/java/com/github/jelmerk/knn/examples/Word.java hnswlib-examples/hnswlib-examples-java/src/main/java/com/github/jelmerk/hnswlib/examples/Word.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.jelmerk.knn.examples;
1+
package com.github.jelmerk.hnswlib.examples;
22

3-
import com.github.jelmerk.knn.Item;
3+
import com.github.jelmerk.hnswlib.Item;
44

55
import java.util.Arrays;
66

hnswlib-metrics-dropwizard/src/main/java/com/github/jelmerk/knn/metrics/dropwizard/StatisticsDecorator.java hnswlib-metrics-dropwizard/src/main/java/com/github/jelmerk/hnswlib/metrics/dropwizard/StatisticsDecorator.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.github.jelmerk.knn.metrics.dropwizard;
1+
package com.github.jelmerk.hnswlib.metrics.dropwizard;
22

33
import com.codahale.metrics.*;
4-
import com.github.jelmerk.knn.Index;
5-
import com.github.jelmerk.knn.Item;
6-
import com.github.jelmerk.knn.SearchResult;
4+
import com.github.jelmerk.hnswlib.core.Index;
5+
import com.github.jelmerk.hnswlib.core.Item;
6+
import com.github.jelmerk.hnswlib.core.SearchResult;
77

88
import java.io.IOException;
99
import java.io.OutputStream;
@@ -52,7 +52,7 @@ public class StatisticsDecorator<TId, TVector, TItem extends Item<TId, TVector>,
5252
private final AccuracyTestThread accuracyEvaluator;
5353

5454
/**
55-
* Constructs a new {@link com.github.jelmerk.knn.metrics.dropwizard.StatisticsDecorator}.
55+
* Constructs a new {@link StatisticsDecorator}.
5656
*
5757
* @param metricRegistry metric registry to publish the metric in
5858
* @param clazz the first element of the name
@@ -95,7 +95,7 @@ public StatisticsDecorator(MetricRegistry metricRegistry,
9595
}
9696

9797
/**
98-
* Constructs a new {@link com.github.jelmerk.knn.metrics.dropwizard.StatisticsDecorator}
98+
* Constructs a new {@link StatisticsDecorator}
9999
*
100100
* @param indexName name of the index. Will be used as part of the metric path
101101
* @param approximativeIndex the approximative index

hnswlib-metrics-dropwizard/src/test/java/com/github/jelmerk/knn/metrics/dropwizard/StatisticsDecoratorTest.java hnswlib-metrics-dropwizard/src/test/java/com/github/jelmerk/hnswlib/metrics/dropwizard/StatisticsDecoratorTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.github.jelmerk.knn.metrics.dropwizard;
1+
package com.github.jelmerk.hnswlib.metrics.dropwizard;
22

33
import com.codahale.metrics.MetricRegistry;
4-
import com.github.jelmerk.knn.Index;
5-
import com.github.jelmerk.knn.SearchResult;
4+
import com.github.jelmerk.hnswlib.core.Index;
5+
import com.github.jelmerk.hnswlib.core.SearchResult;
66

77
import org.junit.jupiter.api.Test;
88
import org.junit.jupiter.api.BeforeEach;

hnswlib-metrics-dropwizard/src/test/java/com/github/jelmerk/knn/metrics/dropwizard/TestItem.java hnswlib-metrics-dropwizard/src/test/java/com/github/jelmerk/hnswlib/metrics/dropwizard/TestItem.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.jelmerk.knn.metrics.dropwizard;
1+
package com.github.jelmerk.hnswlib.metrics.dropwizard;
22

3-
import com.github.jelmerk.knn.Item;
3+
import com.github.jelmerk.hnswlib.core.Item;
44

55
final class TestItem implements Item<String, float[]> {
66

hnswlib-scala/README.md

+4-4

0 commit comments

Comments
 (0)