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

Mofonetprofiles 294 create dox graph db consumer batching #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bsimpson
Copy link
Contributor

@bsimpson bsimpson commented Sep 15, 2022

JIRA story: https://doximity.atlassian.net/browse/MOFONETPROFILES-294

Overview

Adds a new batch client

Technical Information

Neo4j::Http::Client.in_batch do |tx|
  [
    tx.upsert_node(node),
    tx.upsert_node(node2),
    tx.upsert_relationship(relationship: relationship, from: from, to: to)
  ]
end

This will allow us to pass in multiple statements into the same HTTP API
request.
Copy link
Member

@rstawarz rstawarz left a comment

Choose a reason for hiding this comment

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

♠️

@bsimpson bsimpson force-pushed the MOFONETPROFILES-294-create-dox-graph-db-consumer-batching branch from 449cab7 to 41cc584 Compare September 15, 2022 18:59
This client inherits from the default client but overrides the actions
associated with node and relationship manipulation

To run commands in batch you can now instantiate a transaction like:

Neo4j::Http::Client.in_batch do |tx|
  [
    tx.upsert_node(node),
    tx.upsert_node(node2),
    tx.upsert_relationship(relationship: relationship, from: from, to:
    to)
  ]
end

The array of statements will be passed into a batch client that will
prepare the statements and the parameters and issue a single
request to the Neo4j HTTP API. Note that the size of the batch is
determined by the caller's array length.
@bsimpson bsimpson force-pushed the MOFONETPROFILES-294-create-dox-graph-db-consumer-batching branch from 324813d to 95266f6 Compare September 16, 2022 18:57
The batch client subclasses are now provided a provide_xxx method that
can be overridden to format into a statement syntax for batching
@bsimpson bsimpson force-pushed the MOFONETPROFILES-294-create-dox-graph-db-consumer-batching branch from 4daa236 to a68ba63 Compare September 22, 2022 13:59
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.

3 participants