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

Added apoc.load.directory.async.* procedures #1843

Merged
merged 39 commits into from Apr 9, 2021

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Mar 29, 2021

Based on #1639 (comment)

  • Added apoc.load.directory.add(name, cypher, pattern, urlDir, configMap)
  • Added apoc.load.directory.remove(name)
  • Added apoc.load.directory.list() and apoc.load.directory.removeAll()
  • Fixed bug in load csv if file with spaces, for example apoc.load.csv('filename with spaces.csv') like testWithSpacesInFileName in LoadCsvTest.java

vga91 added 30 commits April 2, 2021 09:21
@@ -0,0 +1,5 @@
¦xref::overview/apoc.load.directory.async/apoc.load.directory.async.remove.adoc[apoc.load.directory.async.remove icon:book[]] +

`apoc.load.directory.async.remove(name) YIELD name, status, pattern, cypher, urlDir, config, error` - Remove a folder listener by name and return remaining listener
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`apoc.load.directory.async.remove(name) YIELD name, status, pattern, cypher, urlDir, config, error` - Remove a folder listener by name and return remaining listener
`apoc.load.directory.async.remove(name) YIELD name, status, pattern, cypher, urlDir, config, error` - Remove a folder listener by name and return remaining listeners, if any

@@ -0,0 +1,254 @@
The first parameter is the name of our custom watch listener.
If I call a procedure with the same name as an existing one, this will be overwritten.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If I call a procedure with the same name as an existing one, this will be overwritten.
If we use an already existing listener name, that listener will be overwritten.

using we like the in the rest of the document

Copy link
Contributor

Choose a reason for hiding this comment

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

applies to the other documentation pages below


We can use as query parameter, another load procedure, like `apoc.load.csv` or `apoc.load.json`.

Here is two examples.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Here is two examples.
Here are two examples.

Copy link
Contributor

Choose a reason for hiding this comment

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

applies to the other documentation pages below


=== Examples of interoperability with other procedures

We can use as query parameter, another load procedure, like `apoc.load.csv` or `apoc.load.json`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
We can use as query parameter, another load procedure, like `apoc.load.csv` or `apoc.load.json`.
We can use another load procedure as query parameter, like `apoc.load.csv` or `apoc.load.json`.

Copy link
Contributor

Choose a reason for hiding this comment

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

applies to the other documentation pages below


=== Error handling

When for some reason, the listener fails, its `status` field change from `RUNNING` to `ERROR`, and the associated error is put
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When for some reason, the listener fails, its `status` field change from `RUNNING` to `ERROR`, and the associated error is put
When for some reason, the listener fails, its `status` field change from `RUNNING` to `ERROR`, and the associated error is output.

Copy link
Contributor

Choose a reason for hiding this comment

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

applies to the other documentation pages below

=== Error handling

When for some reason, the listener fails, its `status` field change from `RUNNING` to `ERROR`, and the associated error is put
so if we execute `call apoc.load.directory.async.list`, we obtain, for example:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
so if we execute `call apoc.load.directory.async.list`, we obtain, for example:
If we execute `call apoc.load.directory.async.list`, we obtain, for example:

Copy link
Contributor

Choose a reason for hiding this comment

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

applies to the other documentation pages below

@@ -0,0 +1,9 @@
The procedure support the following config parameters:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The procedure support the following config parameters:
The procedure supports the following config parameters:

Future removed = storage.remove(loadDirectoryItem);
if (removed == null) {
String name = loadDirectoryItem.getName();
throw new RuntimeException("Listener with name: " + name + " doesn't exists");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throw new RuntimeException("Listener with name: " + name + " doesn't exists");
throw new RuntimeException("Listener with name: " + name + " doesn't exist");

@fbiville fbiville merged commit 7a793c4 into neo4j-contrib:4.1 Apr 9, 2021
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.

None yet

2 participants