File tree Expand file tree Collapse file tree
core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/wal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535import com .fasterxml .jackson .core .JsonFactory ;
3636import com .fasterxml .jackson .core .JsonParser ;
3737import 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 */
You can’t perform that action at this time.
0 commit comments