Skip to content

Commit e76d378

Browse files
committed
GH-5691 CLI for running and storing query explanations
1 parent 6ac05fc commit e76d378

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/wal/ValueStoreWalReader.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.fasterxml.jackson.core.JsonFactory;
3636
import com.fasterxml.jackson.core.JsonParser;
3737
import com.fasterxml.jackson.core.JsonToken;
38+
import com.fasterxml.jackson.core.StreamReadConstraints;
3839

3940
/**
4041
* Reader for ValueStore WAL segments that yields minted records in LSN order across segments. It tolerates truncated or
@@ -47,7 +48,7 @@ public final class ValueStoreWalReader implements AutoCloseable {
4748
private static final Logger logger = LoggerFactory.getLogger(ValueStoreWalReader.class);
4849

4950
private final ValueStoreWalConfig config;
50-
private final JsonFactory jsonFactory = new JsonFactory();
51+
private final JsonFactory jsonFactory = createJsonFactory();
5152
// Streaming iteration state
5253
private final List<SegmentEntry> segments;
5354
private int segIndex = -1;
@@ -78,6 +79,14 @@ private ValueStoreWalReader(ValueStoreWalConfig config) {
7879
this.currentSegmentSummarySeen = false;
7980
}
8081

82+
private static JsonFactory createJsonFactory() {
83+
return JsonFactory.builder()
84+
.streamReadConstraints(StreamReadConstraints.builder()
85+
.maxStringLength(ValueStoreWAL.MAX_FRAME_BYTES)
86+
.build())
87+
.build();
88+
}
89+
8190
/**
8291
* Create a reader for the given configuration. No I/O is performed until iteration begins.
8392
*/

0 commit comments

Comments
 (0)