Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1276: Add streaming support to export JSON and GraphML #1330

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

conker84
Copy link
Collaborator

Fixes #1276

Add streaming support to export JSON and GraphML

Proposed Changes (Mandatory)

A brief list of proposed changes in order to fix the issue:

  • Added stream support to JSON
  • Added stream support to GraphML
  • Updated the documentation

@conker84 conker84 requested a review from jexp October 31, 2019 17:19
ExportFileManager cypherFileManager = FileManagerFactory.createFileManager(fileName, false, exportConfig.streamStatements());
final PrintWriter graphMl = cypherFileManager.getPrintWriter("graphml");
if (exportConfig.streamStatements()) {
long timeout = exportConfig.getTimeoutSeconds();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse the streaming exporter code across all the export formats (CSV, JSON, GraphML) rather than having the same code multiple times?

I think the only thing that changes is the line that does the write/dump?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

printWriter.flush();
printWriter.close();
return reporter.stream();
ExportFileManager cypherFileManager = FileManagerFactory.createFileManager(fileName, false, exportConfig.streamStatements());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last parameter into createFileManager is unused - can probably delete that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@conker84
Copy link
Collaborator Author

@mneedham I updated the PR.
Thanks a lot for the feedback!

@mneedham mneedham merged commit e6a8285 into neo4j-contrib:3.5 Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add streaming support to export JSON and GraphML
2 participants