Skip to content

Commit 0bc3f5d

Browse files
committed
manual fix of ServiceLoader
Encoding was provided both as module-info and as a file...and both files were not aligned. The real fix was to write a failing (see EncodingRegistryTest) that makes sure that all encoding are really registered properly. Dropped 3 EncodingId without any Encoding: - VORTEX_BITPACKED("vortex.bitpacked") - VORTEX_FLAT("vortex.flat") - VORTEX_STATS("vortex.stats") So after testing with module-info and "provides/uses" keyword csv was still failing. So the solution for now is to revert back to the classpath (see TODO item).
1 parent 0b8d466 commit 0bc3f5d

9 files changed

Lines changed: 6 additions & 73 deletions

File tree

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
- [ ] prefix all modules with "vortex-"
7878
- [ ] add BOM module
7979
- [ ] deploy to maven central
80+
- [ ] switch back to module-path, but keep in mind these 2 blockers
8081
- [ ] drop warnings about flatbuffers
8182
```shell
8283
[WARNING] ****************************************************************************************************************************************************

core/src/main/java/io/github/dfa1/vortex/encoding/EncodingId.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public enum EncodingId {
1717
VORTEX_RUNEND("vortex.runend"),
1818
VORTEX_CONSTANT("vortex.constant"),
1919
VORTEX_ALP("vortex.alp"),
20-
VORTEX_BITPACKED("vortex.bitpacked"),
2120
VORTEX_VARBIN("vortex.varbin"),
2221
VORTEX_FSST("vortex.fsst"),
2322
VORTEX_NULL("vortex.null"),
@@ -36,10 +35,8 @@ public enum EncodingId {
3635
VORTEX_ALPRD("vortex.alprd"),
3736

3837
// Layout encoding IDs included so parser/registry can represent them safely
39-
VORTEX_FLAT("vortex.flat"),
4038
VORTEX_CHUNKED("vortex.chunked"),
4139
VORTEX_STRUCT("vortex.struct"),
42-
VORTEX_STATS("vortex.stats"),
4340

4441
FASTLANES_BITPACKED("fastlanes.bitpacked"),
4542
FASTLANES_FOR("fastlanes.for"),

core/src/main/java/io/github/dfa1/vortex/encoding/EncodingRegistry.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ public Array decodeSegment(MemorySegment seg, List<String> encodingSpecs,
100100

101101
Array decode(DecodeContext ctx) {
102102
EncodingId id = ctx.node().encodingId();
103-
Encoding c = encodings.get(id);
104-
if (c == null) {
105-
System.out.println(encodings);
103+
Encoding encoding = encodings.get(id);
104+
if (encoding == null) {
106105
throw new VortexException(id, "no encoding registered");
107106
}
108-
return c.decode(ctx);
107+
return encoding.decode(ctx);
109108
}
110109
}

core/src/main/java/module-info.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

core/src/test/java/io/github/dfa1/vortex/encoding/EncodingRegistryTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ void all() {
3232

3333
// When
3434
for (EncodingId encodingId : EncodingId.values()) {
35-
if (!sut.hasEncoding(encodingId)) {
36-
System.out.println(encodingId);
37-
}
38-
//assertThat(sut.hasEncoding(encodingId)).describedAs("%s".formatted(encodingId)).isTrue();
35+
assertThat(sut.hasEncoding(encodingId)).describedAs("%s".formatted(encodingId)).isTrue();
3936
}
4037
}
4138
}

csv/src/main/java/module-info.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

reader/src/main/java/io/github/dfa1/vortex/scan/ScanIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private Array decodeConcatPrimitive(List<Layout> flats, DType dtype, long totalR
278278

279279
private Array decodeFlat(Layout flat, DType dtype, SegmentAllocator arena) {
280280
if (flat.segments().isEmpty()) {
281-
throw new VortexException(EncodingId.VORTEX_FLAT, "no segments");
281+
throw new VortexException("no segments");
282282
}
283283
int segIdx = flat.segments().getFirst();
284284
SegmentSpec spec = file.footer().segmentSpecs().get(segIdx);

reader/src/main/java/module-info.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

writer/src/main/java/module-info.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)