fix: replace GraphSONExporter spray-json write path with Jackson Core streaming#361
Open
eoliphan wants to merge 4 commits into
Open
fix: replace GraphSONExporter spray-json write path with Jackson Core streaming#361eoliphan wants to merge 4 commits into
eoliphan wants to merge 4 commits into
Conversation
…ypes Add floatOptional, doubleOptional, longOptional, and booleanOptional properties to the Generic test schema. These properties enable testing of FloatValue, DoubleValue, LongValue, and BooleanValue branches in the exporter and GraphSONProtocol that were previously untested. Regenerate domain classes and update Neo4j CSV test data and assertions to reflect the new schema.
… streaming Fixes joernio#360 — OOM when exporting large graphs. The spray-json PrettyPrinter built the entire graph as a single java.lang.String (UTF-16, ~1GB ceiling). Jackson Core streams tokens directly to a BufferedOutputStream, so memory usage is bounded by the generator buffer, not graph size. The import path (GraphSONImporter) is unchanged. Public API is unchanged.
Contributor
|
thank you @eoliphan , I'll take a look at this, hopefully tomorrow 🤞🏻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #360.
Summary
GraphSONExporter.runExportpreviously built the entire graph as a singlejava.lang.Stringvia spray-json'sPrettyPrinter, causingOutOfMemoryErroron large graphs (Java strings are UTF-16, ~1 GB ceiling).BufferedOutputStreamas each node/edge is processed, keeping peak memory bounded by the generator buffer regardless of graph size.GraphSONImporter),GraphSONProtocol, and all other exporters are unchanged.GraphSONExporteris unchanged.Float,Double,Long, andBooleanproperty types to thegenerictest schema (pre-existing coverage gap) and a round-trip test exercising allPropertyValuesubtypes.