From 1a9a4afd6264011ec13d88fef9597f1b900c3e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Cord=C3=B3n?= Date: Fri, 3 Nov 2023 14:30:31 +0000 Subject: [PATCH 1/6] [NOID] Adds job to apply formatting in PRs (#520) --- .../actions/gradle-command-on-pr/action.yaml | 103 ++++++++++++++++++ .github/workflows/ChatOps.yml | 17 +++ .github/workflows/spotlessApply-command.yml | 19 ++++ 3 files changed, 139 insertions(+) create mode 100644 .github/actions/gradle-command-on-pr/action.yaml create mode 100644 .github/workflows/ChatOps.yml create mode 100644 .github/workflows/spotlessApply-command.yml diff --git a/.github/actions/gradle-command-on-pr/action.yaml b/.github/actions/gradle-command-on-pr/action.yaml new file mode 100644 index 000000000..c9fdee8a4 --- /dev/null +++ b/.github/actions/gradle-command-on-pr/action.yaml @@ -0,0 +1,103 @@ +name: "Run gradle command on pull request" + +inputs: + gradle-command: + description: "Gradle command to run" + required: true + TEAMCITY_DEV_URL: + required: true + TEAMCITY_USER: + required: true + TEAMCITY_PASSWORD: + required: true + SERVICE_ACCOUNT_PAT: + required: true + +runs: + using: "composite" + steps: + - name: Checkout branch from fork + uses: actions/checkout@v3 + with: + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.ref }} + + - uses: ./.github/actions/setup-jdk + - uses: ./.github/actions/setup-gradle-cache + + - name: Calls gradle command + shell: bash + env: + TEAMCITY_DEV_URL: ${{ inputs.TEAMCITY_DEV_URL }} + TEAMCITY_USER: ${{ inputs.TEAMCITY_USER }} + TEAMCITY_PASSWORD: ${{ inputs.TEAMCITY_PASSWORD }} + run: | + ./gradlew ${{ inputs.gradle-command }} + + - name: Check for modified files + shell: bash + id: git-check + run: echo modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) >> $GITHUB_OUTPUT + + - name: Commit to the PR branch + shell: bash + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'neo-technology-build-agent' + git config --global user.email 'neo-technology-build-agent@users.noreply.github.com' + git add -A + git commit -m "Run ${{ inputs.gradle-command }}" + + - name: Push changes + uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 + with: + github_token: ${{ inputs.SERVICE_ACCOUNT_PAT }} + branch: ${{ github.event.client_payload.pull_request.head.ref }} + + - name: Add reaction on pushed changes + if: ${{ success() && steps.git-check.outputs.modified == 'true' }} + uses: peter-evans/create-or-update-comment@v2 + with: + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + reaction-type: hooray + + - name: Add reaction when no update is needed + if: ${{ success() && steps.git-check.outputs.modified == 'false' }} + uses: peter-evans/create-or-update-comment@v2 + with: + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + reaction-type: '+1' + + - name: Create URL to the run output for failure report + shell: bash + if: ${{ !success() }} + id: vars + run: echo run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID >> $GITHUB_OUTPUT + + - name: Create comment with URL on failure + if: ${{ !success() }} + uses: peter-evans/create-or-update-comment@v2 + with: + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + issue-number: ${{ github.event.client_payload.github.payload.issue.number }} + body: | + :x: [${{ inputs.gradle-command }} failed][1] + + [1]: ${{ steps.vars.outputs.run-url }} + + - name: Report failure to original comment with a reaction + if: ${{ !success() }} + uses: peter-evans/create-or-update-comment@v2 + with: + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + reaction-type: '-1' + + - name: Go back to original branch + uses: actions/checkout@v3 + with: + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.base.ref }} \ No newline at end of file diff --git a/.github/workflows/ChatOps.yml b/.github/workflows/ChatOps.yml new file mode 100644 index 000000000..870f8a2ac --- /dev/null +++ b/.github/workflows/ChatOps.yml @@ -0,0 +1,17 @@ +name: Slash Command Dispatch +on: + issue_comment: + types: [created] +permissions: write-all +jobs: + slashCommandDispatch: + runs-on: ubuntu-latest + steps: + - name: Slash Command Dispatch + uses: peter-evans/slash-command-dispatch@v3 + with: + issue-type: pull-request + reaction-token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.SERVICE_ACCOUNT_PAT }} + commands: | + spotlessApply \ No newline at end of file diff --git a/.github/workflows/spotlessApply-command.yml b/.github/workflows/spotlessApply-command.yml new file mode 100644 index 000000000..ca6823e71 --- /dev/null +++ b/.github/workflows/spotlessApply-command.yml @@ -0,0 +1,19 @@ +name: Formats PR +on: + repository_dispatch: + types: [spotlessApply-command] + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Format and push changes to PR + uses: ./.github/actions/gradle-command-on-pr + with: + gradle-command: spotlessApply + TEAMCITY_DEV_URL: ${{ secrets.TEAMCITY_DEV_URL }} + TEAMCITY_USER: ${{ secrets.TEAMCITY_USER }} + TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }} + SERVICE_ACCOUNT_PAT: ${{ secrets.SERVICE_ACCOUNT_PAT }} \ No newline at end of file From 25699c3900b7eb04c3af0ebc4c534cdcca4aa935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Cord=C3=B3n?= Date: Mon, 6 Nov 2023 11:09:33 +0000 Subject: [PATCH 2/6] [NOID] Upgrades testContainers dependency (#523) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f29e01219..c0a06c3aa 100644 --- a/build.gradle +++ b/build.gradle @@ -132,5 +132,5 @@ apply from: "licenses-source-header.gradle" ext { publicDir = "${project.rootDir}" neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : "5.14.0" - testContainersVersion = '1.18.3' + testContainersVersion = '1.19.1' } From a95a472a5ccf0d3225ef83fe5adf2a08d11897a1 Mon Sep 17 00:00:00 2001 From: Gem Lamont <106068376+gem-neo4j@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:01:50 +0100 Subject: [PATCH 3/6] [Dz0rqAEz] Bump APOC and Neo to 5.15 (#521) --- LICENSES.txt | 85 ++++++++++++++++++++++--------------------- NOTICE.txt | 101 ++++++++++++++++++++++++++------------------------- build.gradle | 8 ++-- readme.adoc | 6 +-- 4 files changed, 101 insertions(+), 99 deletions(-) diff --git a/LICENSES.txt b/LICENSES.txt index 44e82361c..782ef3c79 100644 --- a/LICENSES.txt +++ b/LICENSES.txt @@ -21,8 +21,8 @@ Apache-2.0 aws-java-sdk-core-1.12.425.jar aws-java-sdk-kms-1.12.425.jar aws-java-sdk-s3-1.12.425.jar - byte-buddy-1.14.6.jar - byte-buddy-agent-1.14.6.jar + byte-buddy-1.14.9.jar + byte-buddy-agent-1.14.9.jar caffeine-3.1.8.jar cassandra-driver-core-3.10.0.jar commons-beanutils-1.9.4.jar @@ -36,18 +36,19 @@ Apache-2.0 commons-configuration2-2.9.0.jar commons-csv-1.9.0.jar commons-daemon-1.0.13.jar - commons-io-2.14.0.jar + commons-io-2.15.0.jar commons-lang3-3.13.0.jar commons-logging-1.2.jar commons-math3-3.6.1.jar commons-net-3.9.0.jar commons-text-1.10.0.jar + commons-text-1.11.0.jar curator-client-5.2.0.jar curator-framework-5.2.0.jar curator-recipes-5.2.0.jar - docker-java-api-3.3.0.jar - docker-java-transport-3.3.0.jar - docker-java-transport-zerodep-3.3.0.jar + docker-java-api-3.3.3.jar + docker-java-transport-3.3.3.jar + docker-java-transport-zerodep-3.3.3.jar ehcache-3.3.1.jar error_prone_annotations-2.18.0.jar error_prone_annotations-2.2.0.jar @@ -121,15 +122,15 @@ Apache-2.0 jcip-annotations-1.0-1.jar jctools-core-4.0.1.jar jettison-1.5.4.jar - jetty-http-10.0.16.jar - jetty-io-10.0.16.jar - jetty-security-10.0.16.jar - jetty-server-10.0.16.jar - jetty-servlet-10.0.16.jar + jetty-http-10.0.17.jar + jetty-io-10.0.17.jar + jetty-security-10.0.17.jar + jetty-server-10.0.17.jar + jetty-servlet-10.0.17.jar jetty-servlet-api-4.0.6.jar - jetty-util-10.0.16.jar - jetty-webapp-10.0.16.jar - jetty-xml-10.0.16.jar + jetty-util-10.0.17.jar + jetty-webapp-10.0.17.jar + jetty-xml-10.0.17.jar jffi-1.2.16-native.jar jffi-1.2.16.jar jmespath-java-1.12.425.jar @@ -171,11 +172,11 @@ Apache-2.0 metrics-core-3.2.4.jar netty-3.10.6.Final.jar netty-all-4.1.89.Final.jar - netty-buffer-4.1.99.Final.jar - netty-codec-4.1.99.Final.jar + netty-buffer-4.1.100.Final.jar + netty-codec-4.1.100.Final.jar netty-codec-dns-4.1.89.Final.jar netty-codec-haproxy-4.1.89.Final.jar - netty-codec-http-4.1.99.Final.jar + netty-codec-http-4.1.100.Final.jar netty-codec-http2-4.1.89.Final.jar netty-codec-memcache-4.1.89.Final.jar netty-codec-mqtt-4.1.89.Final.jar @@ -184,24 +185,24 @@ Apache-2.0 netty-codec-socks-4.1.89.Final.jar netty-codec-stomp-4.1.89.Final.jar netty-codec-xml-4.1.89.Final.jar - netty-common-4.1.99.Final.jar - netty-handler-4.1.99.Final.jar + netty-common-4.1.100.Final.jar + netty-handler-4.1.100.Final.jar netty-handler-proxy-4.1.89.Final.jar netty-handler-ssl-ocsp-4.1.89.Final.jar - netty-resolver-4.1.99.Final.jar + netty-resolver-4.1.100.Final.jar netty-resolver-dns-4.1.89.Final.jar netty-resolver-dns-classes-macos-4.1.89.Final.jar netty-resolver-dns-native-macos-4.1.89.Final-osx-aarch_64.jar netty-resolver-dns-native-macos-4.1.89.Final-osx-x86_64.jar - netty-transport-4.1.99.Final.jar - netty-transport-classes-epoll-4.1.99.Final.jar - netty-transport-classes-kqueue-4.1.99.Final.jar - netty-transport-native-epoll-4.1.99.Final-linux-aarch_64.jar - netty-transport-native-epoll-4.1.99.Final-linux-x86_64.jar - netty-transport-native-epoll-4.1.99.Final.jar - netty-transport-native-kqueue-4.1.99.Final-osx-aarch_64.jar - netty-transport-native-kqueue-4.1.99.Final-osx-x86_64.jar - netty-transport-native-unix-common-4.1.99.Final.jar + netty-transport-4.1.100.Final.jar + netty-transport-classes-epoll-4.1.100.Final.jar + netty-transport-classes-kqueue-4.1.100.Final.jar + netty-transport-native-epoll-4.1.100.Final-linux-aarch_64.jar + netty-transport-native-epoll-4.1.100.Final-linux-x86_64.jar + netty-transport-native-epoll-4.1.100.Final.jar + netty-transport-native-kqueue-4.1.100.Final-osx-aarch_64.jar + netty-transport-native-kqueue-4.1.100.Final-osx-x86_64.jar + netty-transport-native-unix-common-4.1.100.Final.jar netty-transport-rxtx-4.1.89.Final.jar netty-transport-sctp-4.1.89.Final.jar netty-transport-udt-4.1.89.Final.jar @@ -212,7 +213,7 @@ Apache-2.0 opencsv-5.7.1.jar opentest4j-1.3.0.jar picocli-4.7.5.jar - reactor-core-3.5.10.jar + reactor-core-3.5.11.jar reload4j-1.2.22.jar scala-collection-contrib_2.13-0.3.0.jar scala-library-2.13.11.jar @@ -446,7 +447,7 @@ BSD-2-Clause jline-3.9.0.jar jsch-0.1.55.jar stax2-api-4.2.1.jar - zstd-jni-1.5.5-6.jar + zstd-jni-1.5.5-10.jar ------------------------------------------------------------------------------ Copyright @@ -2560,28 +2561,28 @@ MIT bcprov-jdk15on-1.68.jar bcprov-jdk18on-1.76.jar bcutil-jdk18on-1.76.jar - cassandra-1.18.3.jar + cassandra-1.19.1.jar checker-qual-2.5.2.jar checker-qual-3.33.0.jar - couchbase-1.18.3.jar - database-commons-1.18.3.jar + couchbase-1.19.1.jar + database-commons-1.19.1.jar duct-tape-1.0.8.jar - elasticsearch-1.18.3.jar - jdbc-1.18.3.jar + elasticsearch-1.19.1.jar + jdbc-1.19.1.jar jersey-client-2.34.jar jersey-container-servlet-2.34.jar jersey-container-servlet-core-2.34.jar jersey-hk2-2.34.jar jnr-x86asm-1.0.2.jar - localstack-1.18.3.jar - mockito-core-5.5.0.jar + localstack-1.19.1.jar + mockito-core-5.7.0.jar mssql-jdbc-6.2.1.jre7.jar - mysql-1.18.3.jar - neo4j-1.18.3.jar - postgresql-1.18.3.jar + mysql-1.19.1.jar + neo4j-1.19.1.jar + postgresql-1.19.1.jar reactive-streams-1.0.4.jar slf4j-api-2.0.9.jar - testcontainers-1.18.3.jar + testcontainers-1.19.1.jar ------------------------------------------------------------------------------ The MIT License diff --git a/NOTICE.txt b/NOTICE.txt index e9d939a35..e0b01722c 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -51,8 +51,8 @@ Apache-2.0 aws-java-sdk-core-1.12.425.jar aws-java-sdk-kms-1.12.425.jar aws-java-sdk-s3-1.12.425.jar - byte-buddy-1.14.6.jar - byte-buddy-agent-1.14.6.jar + byte-buddy-1.14.9.jar + byte-buddy-agent-1.14.9.jar caffeine-3.1.8.jar cassandra-driver-core-3.10.0.jar commons-beanutils-1.9.4.jar @@ -66,18 +66,19 @@ Apache-2.0 commons-configuration2-2.9.0.jar commons-csv-1.9.0.jar commons-daemon-1.0.13.jar - commons-io-2.14.0.jar + commons-io-2.15.0.jar commons-lang3-3.13.0.jar commons-logging-1.2.jar commons-math3-3.6.1.jar commons-net-3.9.0.jar commons-text-1.10.0.jar + commons-text-1.11.0.jar curator-client-5.2.0.jar curator-framework-5.2.0.jar curator-recipes-5.2.0.jar - docker-java-api-3.3.0.jar - docker-java-transport-3.3.0.jar - docker-java-transport-zerodep-3.3.0.jar + docker-java-api-3.3.3.jar + docker-java-transport-3.3.3.jar + docker-java-transport-zerodep-3.3.3.jar ehcache-3.3.1.jar error_prone_annotations-2.18.0.jar error_prone_annotations-2.2.0.jar @@ -151,15 +152,15 @@ Apache-2.0 jcip-annotations-1.0-1.jar jctools-core-4.0.1.jar jettison-1.5.4.jar - jetty-http-10.0.16.jar - jetty-io-10.0.16.jar - jetty-security-10.0.16.jar - jetty-server-10.0.16.jar - jetty-servlet-10.0.16.jar + jetty-http-10.0.17.jar + jetty-io-10.0.17.jar + jetty-security-10.0.17.jar + jetty-server-10.0.17.jar + jetty-servlet-10.0.17.jar jetty-servlet-api-4.0.6.jar - jetty-util-10.0.16.jar - jetty-webapp-10.0.16.jar - jetty-xml-10.0.16.jar + jetty-util-10.0.17.jar + jetty-webapp-10.0.17.jar + jetty-xml-10.0.17.jar jffi-1.2.16-native.jar jffi-1.2.16.jar jmespath-java-1.12.425.jar @@ -201,11 +202,11 @@ Apache-2.0 metrics-core-3.2.4.jar netty-3.10.6.Final.jar netty-all-4.1.89.Final.jar - netty-buffer-4.1.99.Final.jar - netty-codec-4.1.99.Final.jar + netty-buffer-4.1.100.Final.jar + netty-codec-4.1.100.Final.jar netty-codec-dns-4.1.89.Final.jar netty-codec-haproxy-4.1.89.Final.jar - netty-codec-http-4.1.99.Final.jar + netty-codec-http-4.1.100.Final.jar netty-codec-http2-4.1.89.Final.jar netty-codec-memcache-4.1.89.Final.jar netty-codec-mqtt-4.1.89.Final.jar @@ -214,24 +215,24 @@ Apache-2.0 netty-codec-socks-4.1.89.Final.jar netty-codec-stomp-4.1.89.Final.jar netty-codec-xml-4.1.89.Final.jar - netty-common-4.1.99.Final.jar - netty-handler-4.1.99.Final.jar + netty-common-4.1.100.Final.jar + netty-handler-4.1.100.Final.jar netty-handler-proxy-4.1.89.Final.jar netty-handler-ssl-ocsp-4.1.89.Final.jar - netty-resolver-4.1.99.Final.jar + netty-resolver-4.1.100.Final.jar netty-resolver-dns-4.1.89.Final.jar netty-resolver-dns-classes-macos-4.1.89.Final.jar netty-resolver-dns-native-macos-4.1.89.Final-osx-aarch_64.jar netty-resolver-dns-native-macos-4.1.89.Final-osx-x86_64.jar - netty-transport-4.1.99.Final.jar - netty-transport-classes-epoll-4.1.99.Final.jar - netty-transport-classes-kqueue-4.1.99.Final.jar - netty-transport-native-epoll-4.1.99.Final-linux-aarch_64.jar - netty-transport-native-epoll-4.1.99.Final-linux-x86_64.jar - netty-transport-native-epoll-4.1.99.Final.jar - netty-transport-native-kqueue-4.1.99.Final-osx-aarch_64.jar - netty-transport-native-kqueue-4.1.99.Final-osx-x86_64.jar - netty-transport-native-unix-common-4.1.99.Final.jar + netty-transport-4.1.100.Final.jar + netty-transport-classes-epoll-4.1.100.Final.jar + netty-transport-classes-kqueue-4.1.100.Final.jar + netty-transport-native-epoll-4.1.100.Final-linux-aarch_64.jar + netty-transport-native-epoll-4.1.100.Final-linux-x86_64.jar + netty-transport-native-epoll-4.1.100.Final.jar + netty-transport-native-kqueue-4.1.100.Final-osx-aarch_64.jar + netty-transport-native-kqueue-4.1.100.Final-osx-x86_64.jar + netty-transport-native-unix-common-4.1.100.Final.jar netty-transport-rxtx-4.1.89.Final.jar netty-transport-sctp-4.1.89.Final.jar netty-transport-udt-4.1.89.Final.jar @@ -242,7 +243,7 @@ Apache-2.0 opencsv-5.7.1.jar opentest4j-1.3.0.jar picocli-4.7.5.jar - reactor-core-3.5.10.jar + reactor-core-3.5.11.jar reload4j-1.2.22.jar scala-collection-contrib_2.13-0.3.0.jar scala-library-2.13.11.jar @@ -278,7 +279,7 @@ BSD-2-Clause jline-3.9.0.jar jsch-0.1.55.jar stax2-api-4.2.1.jar - zstd-jni-1.5.5-6.jar + zstd-jni-1.5.5-10.jar BSD-3-Clause asm-9.3.jar @@ -342,14 +343,14 @@ Eclipse Public License - Version 1.0 jetty-servlet-api-4.0.6.jar Eclipse Public License - Version 2.0 - jetty-http-10.0.16.jar - jetty-io-10.0.16.jar - jetty-security-10.0.16.jar - jetty-server-10.0.16.jar - jetty-servlet-10.0.16.jar - jetty-util-10.0.16.jar - jetty-webapp-10.0.16.jar - jetty-xml-10.0.16.jar + jetty-http-10.0.17.jar + jetty-io-10.0.17.jar + jetty-security-10.0.17.jar + jetty-server-10.0.17.jar + jetty-servlet-10.0.17.jar + jetty-util-10.0.17.jar + jetty-webapp-10.0.17.jar + jetty-xml-10.0.17.jar Eclipse Public License - v 1.0 eclipse-collections-11.1.0.jar @@ -423,28 +424,28 @@ MIT bcprov-jdk15on-1.68.jar bcprov-jdk18on-1.76.jar bcutil-jdk18on-1.76.jar - cassandra-1.18.3.jar + cassandra-1.19.1.jar checker-qual-2.5.2.jar checker-qual-3.33.0.jar - couchbase-1.18.3.jar - database-commons-1.18.3.jar + couchbase-1.19.1.jar + database-commons-1.19.1.jar duct-tape-1.0.8.jar - elasticsearch-1.18.3.jar - jdbc-1.18.3.jar + elasticsearch-1.19.1.jar + jdbc-1.19.1.jar jersey-client-2.34.jar jersey-container-servlet-2.34.jar jersey-container-servlet-core-2.34.jar jersey-hk2-2.34.jar jnr-x86asm-1.0.2.jar - localstack-1.18.3.jar - mockito-core-5.5.0.jar + localstack-1.19.1.jar + mockito-core-5.7.0.jar mssql-jdbc-6.2.1.jre7.jar - mysql-1.18.3.jar - neo4j-1.18.3.jar - postgresql-1.18.3.jar + mysql-1.19.1.jar + neo4j-1.19.1.jar + postgresql-1.19.1.jar reactive-streams-1.0.4.jar slf4j-api-2.0.9.jar - testcontainers-1.18.3.jar + testcontainers-1.19.1.jar MPL 1.1 javassist-3.25.0-GA.jar diff --git a/build.gradle b/build.gradle index c0a06c3aa..13dbdec5b 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ downloadLicenses { allprojects { group = 'org.neo4j.procedure' - version = '5.14.0' + version = '5.15.0' archivesBaseName = 'apoc' description = """neo4j-apoc-procedures""" } @@ -70,8 +70,8 @@ subprojects { // neo4jDockerImage system property is used in TestContainerUtil systemProperties 'user.language' : 'en' , 'user.country' : 'US', - 'neo4jDockerImage' : project.hasProperty("neo4jDockerVersionOverride") ? 'neo4j:' + project.getProperty("neo4jDockerVersionOverride") + '-enterprise-debian' : 'neo4j:5.14.0-enterprise-debian', - 'neo4jCommunityDockerImage': project.hasProperty("neo4jDockerVersionOverride") ? 'neo4j:' + project.getProperty("neo4jDockerVersionOverride") + '-debian': 'neo4j:5.14.0-debian', + 'neo4jDockerImage' : project.hasProperty("neo4jDockerVersionOverride") ? 'neo4j:' + project.getProperty("neo4jDockerVersionOverride") + '-enterprise-debian' : 'neo4j:5.15.0-enterprise-debian', + 'neo4jCommunityDockerImage': project.hasProperty("neo4jDockerVersionOverride") ? 'neo4j:' + project.getProperty("neo4jDockerVersionOverride") + '-debian': 'neo4j:5.15.0-debian', 'coreDir': 'core' maxHeapSize = "5G" @@ -131,6 +131,6 @@ apply from: "licenses-source-header.gradle" ext { publicDir = "${project.rootDir}" - neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : "5.14.0" + neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : "5.15.0" testContainersVersion = '1.19.1' } diff --git a/readme.adoc b/readme.adoc index a65d65809..a3b1f6411 100644 --- a/readme.adoc +++ b/readme.adoc @@ -1,8 +1,8 @@ :readme: -:branch: 5.14 +:branch: 5.15 :docs: https://neo4j.com/docs/apoc/current -:apoc-release: 5.14.0 -:neo4j-version: 5.14.0 +:apoc-release: 5.15.0 +:neo4j-version: 5.15.0 :img: https://raw.githubusercontent.com/neo4j/apoc/dev/images https://community.neo4j.com[image:https://img.shields.io/discourse/users?logo=discourse&server=https%3A%2F%2Fcommunity.neo4j.com[Discourse users]] From 2c9f55a7a7b90ea8de9f3e2beeaa95f9f8f778ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Cord=C3=B3n?= Date: Mon, 6 Nov 2023 15:15:39 +0000 Subject: [PATCH 4/6] [NOID] Adds job to update the licenses in PRs (#524) --- .../actions/gradle-command-on-pr/action.yaml | 2 +- .github/workflows/ChatOps.yml | 3 ++- .../workflows/generateLicenses-command.yml | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/generateLicenses-command.yml diff --git a/.github/actions/gradle-command-on-pr/action.yaml b/.github/actions/gradle-command-on-pr/action.yaml index c9fdee8a4..58e18dd4e 100644 --- a/.github/actions/gradle-command-on-pr/action.yaml +++ b/.github/actions/gradle-command-on-pr/action.yaml @@ -47,7 +47,7 @@ runs: git config --global user.name 'neo-technology-build-agent' git config --global user.email 'neo-technology-build-agent@users.noreply.github.com' git add -A - git commit -m "Run ${{ inputs.gradle-command }}" + git commit -m "[NOID] Run ${{ inputs.gradle-command }}" - name: Push changes uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 diff --git a/.github/workflows/ChatOps.yml b/.github/workflows/ChatOps.yml index 870f8a2ac..2ba6c5524 100644 --- a/.github/workflows/ChatOps.yml +++ b/.github/workflows/ChatOps.yml @@ -14,4 +14,5 @@ jobs: reaction-token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.SERVICE_ACCOUNT_PAT }} commands: | - spotlessApply \ No newline at end of file + spotlessApply + generateLicenses \ No newline at end of file diff --git a/.github/workflows/generateLicenses-command.yml b/.github/workflows/generateLicenses-command.yml new file mode 100644 index 000000000..68f3953ed --- /dev/null +++ b/.github/workflows/generateLicenses-command.yml @@ -0,0 +1,19 @@ +name: Updates license files +on: + repository_dispatch: + types: [generateLicenses-command] + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Format and push changes to PR + uses: ./.github/actions/gradle-command-on-pr + with: + gradle-command: generateLicenses + TEAMCITY_DEV_URL: ${{ secrets.TEAMCITY_DEV_URL }} + TEAMCITY_USER: ${{ secrets.TEAMCITY_USER }} + TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }} + SERVICE_ACCOUNT_PAT: ${{ secrets.SERVICE_ACCOUNT_PAT }} \ No newline at end of file From 5094e2a2a623d36b08ac0400c25283f95c7cd87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Cord=C3=B3n?= Date: Mon, 6 Nov 2023 15:47:54 +0000 Subject: [PATCH 5/6] [NOID] Formats everything (#522) Co-authored-by: neo-technology-build-agent --- build.gradle | 10 + common/build.gradle | 8 - common/src/main/java/apoc/ApocConfig.java | 130 +- .../java/apoc/ApocConfigExtensionFactory.java | 10 +- .../main/java/apoc/ApocExtensionFactory.java | 45 +- .../main/java/apoc/ApocGlobalComponents.java | 7 +- .../main/java/apoc/PoolExtensionFactory.java | 3 +- common/src/main/java/apoc/Pools.java | 123 +- .../java/apoc/RegisterComponentFactory.java | 20 +- .../main/java/apoc/SystemPropertyKeys.java | 2 +- .../main/java/apoc/algo/PathFindingUtils.java | 41 +- .../main/java/apoc/coll/SetBackedList.java | 9 +- .../main/java/apoc/convert/ConvertUtils.java | 6 +- .../main/java/apoc/cypher/CypherUtils.java | 19 +- common/src/main/java/apoc/date/DateUtils.java | 30 +- .../export/cypher/FileManagerFactory.java | 29 +- .../formatter/AbstractCypherFormatter.java | 1192 +++++----- .../AddStructureCypherFormatter.java | 107 +- .../formatter/CreateCypherFormatter.java | 48 +- .../export/cypher/formatter/CypherFormat.java | 85 +- .../cypher/formatter/CypherFormatter.java | 49 +- .../formatter/CypherFormatterUtils.java | 63 +- .../formatter/UpdateAllCypherFormatter.java | 62 +- .../UpdateStructureCypherFormatter.java | 101 +- .../apoc/export/util/BatchTransaction.java | 15 +- .../java/apoc/export/util/BulkImportUtil.java | 43 +- .../apoc/export/util/CountingInputStream.java | 21 +- .../java/apoc/export/util/CountingReader.java | 6 +- .../export/util/DurationValueSerializer.java | 7 +- .../java/apoc/export/util/ExportConfig.java | 80 +- .../java/apoc/export/util/ExportFormat.java | 18 +- .../java/apoc/export/util/ExportUtils.java | 49 +- .../java/apoc/export/util/FormatUtils.java | 64 +- .../export/util/LimitedSizeInputStream.java | 17 +- .../apoc/export/util/MetaInformation.java | 82 +- .../export/util/NodesAndRelsSubGraph.java | 43 +- .../apoc/export/util/PointSerializer.java | 13 +- .../apoc/export/util/ProgressReporter.java | 12 +- .../main/java/apoc/export/util/Reporter.java | 1 + .../apoc/export/util/TemporalSerializer.java | 4 +- .../java/apoc/gephi/GephiFormatUtils.java | 21 +- common/src/main/java/apoc/get/Get.java | 4 +- .../src/main/java/apoc/graph/GraphsUtils.java | 29 +- .../document/builder/DocumentToGraph.java | 123 +- .../graph/document/builder/LabelBuilder.java | 14 +- .../document/builder/RelationshipBuilder.java | 18 +- .../java/apoc/graph/util/GraphsConfig.java | 25 +- common/src/main/java/apoc/load/CSVResult.java | 40 +- .../main/java/apoc/load/LoadJsonUtils.java | 22 +- common/src/main/java/apoc/load/Mapping.java | 56 +- .../src/main/java/apoc/load/util/Results.java | 5 +- .../java/apoc/meta/ConstraintTracker.java | 2 +- .../src/main/java/apoc/meta/MetaConfig.java | 48 +- .../main/java/apoc/meta/SampleMetaConfig.java | 7 +- .../java/apoc/meta/Tables4LabelsProfile.java | 57 +- common/src/main/java/apoc/meta/Types.java | 119 +- .../meta/tablesforlabels/OrderedLabels.java | 13 +- .../PropertyContainerProfile.java | 16 +- .../meta/tablesforlabels/PropertyTracker.java | 7 +- .../path/RelationshipTypeAndDirections.java | 64 +- .../apoc/periodic/BatchAndTotalCollector.java | 24 +- .../apoc/periodic/BatchAndTotalResult.java | 39 +- .../main/java/apoc/periodic/BatchMode.java | 14 +- .../java/apoc/periodic/PeriodicUtils.java | 187 +- .../java/apoc/result/AssertSchemaResult.java | 2 +- .../java/apoc/result/ByteArrayResult.java | 4 +- .../main/java/apoc/result/GraphResult.java | 3 +- .../apoc/result/IndexConstraintNodeInfo.java | 12 +- .../IndexConstraintRelationshipInfo.java | 7 +- .../src/main/java/apoc/result/MapResult.java | 10 +- .../main/java/apoc/result/NodeListResult.java | 3 +- .../java/apoc/result/NodeResultWithStats.java | 4 +- .../main/java/apoc/result/ProgressInfo.java | 2 +- .../result/RelationshipResultWithStats.java | 4 +- .../main/java/apoc/result/VirtualGraph.java | 30 +- .../main/java/apoc/result/VirtualNode.java | 31 +- .../main/java/apoc/result/VirtualPath.java | 36 +- .../java/apoc/result/VirtualRelationship.java | 34 +- .../java/apoc/result/WeightedPathResult.java | 11 +- .../util/ApocUrlStreamHandlerFactory.java | 5 +- .../src/main/java/apoc/util/ArchiveType.java | 5 +- .../main/java/apoc/util/CompressionAlgo.java | 30 +- .../java/apoc/util/CompressionConfig.java | 4 +- .../main/java/apoc/util/DateFormatUtil.java | 133 +- .../main/java/apoc/util/DateParseUtil.java | 13 +- .../java/apoc/util/DurationFormatUtil.java | 40 +- .../src/main/java/apoc/util/EntityUtil.java | 15 +- common/src/main/java/apoc/util/FileUtils.java | 126 +- .../java/apoc/util/FixedSizeStringWriter.java | 2 +- common/src/main/java/apoc/util/JsonUtil.java | 60 +- common/src/main/java/apoc/util/LogsUtil.java | 9 +- common/src/main/java/apoc/util/MapUtil.java | 2 +- .../apoc/util/MissingDependencyException.java | 2 +- .../java/apoc/util/QueueBasedSpliterator.java | 6 +- common/src/main/java/apoc/util/QueueUtil.java | 8 +- .../main/java/apoc/util/StreamConnection.java | 16 +- .../java/apoc/util/SupportedProtocols.java | 14 +- common/src/main/java/apoc/util/Util.java | 493 ++-- .../collection/AbstractResourceIterable.java | 134 +- .../util/collection/FilteringIterable.java | 2 +- .../util/collection/FilteringIterator.java | 3 +- .../collection/NestingResourceIterator.java | 4 +- .../collection/ResourceClosingIterator.java | 1 - .../collection/WrappingResourceIterator.java | 5 +- .../google/cloud/GCStorageURLConnection.java | 22 +- .../GCStorageURLStreamHandlerFactory.java | 1 - .../main/java/apoc/util/hdfs/HDFSUtils.java | 89 +- .../MultiThreadedGlobalGraphOperations.java | 43 +- common/src/main/java/apoc/util/s3/S3Aws.java | 17 +- .../java/apoc/util/s3/S3OutputStream.java | 47 +- .../src/main/java/apoc/util/s3/S3Params.java | 15 +- .../java/apoc/util/s3/S3ParamsExtractor.java | 45 +- .../java/apoc/util/s3/S3URLConnection.java | 13 +- .../main/java/apoc/util/s3/S3UploadUtils.java | 1 - common/src/main/java/apoc/uuid/UuidUtil.java | 4 +- .../cypher/export/CypherResultSubGraph.java | 31 +- .../neo4j/cypher/export/DatabaseSubGraph.java | 40 +- .../org/neo4j/cypher/export/SubGraph.java | 25 +- .../apoc/ApocConfigCommandExpansionTest.java | 85 +- common/src/test/java/apoc/ApocConfigTest.java | 40 +- .../java/apoc/coll/SetBackedListTest.java | 54 +- .../apoc/export/util/FormatUtilsTest.java | 23 +- .../document/builder/DocumentToGraphTest.java | 13 +- .../document/builder/LabelBuilderTest.java | 13 +- .../apoc/load/relative/LoadXmlResult.java | 10 +- .../RelationshipTypeAndDirectionsTest.java | 50 +- .../java/apoc/result/VirtualNodeTest.java | 12 +- .../test/java/apoc/test/EnvSettingRule.java | 4 +- .../apoc/test/annotations/EnvSetting.java | 1 + .../test/java/apoc/util/BinaryTestUtil.java | 15 +- .../java/apoc/util/DateParseUtilTest.java | 40 +- .../apoc/util/FixedSizeStringWriterTest.java | 5 +- .../java/apoc/util/SortedArraySetTest.java | 23 +- .../test/java/apoc/util/UtilQuoteTest.java | 51 +- common/src/test/java/apoc/util/UtilTest.java | 47 +- .../AbstractResourceIterableTest.java | 9 +- .../util/collection/CollectionTestHelper.java | 4 +- .../apoc/util/collection/IterablesTest.java | 2 +- ...ultiThreadedGlobalGraphOperationsTest.java | 23 +- .../src/test/java/apoc/uuid/UuidUtilTest.java | 15 +- core/build.gradle | 8 - .../java/apoc/CoreApocGlobalComponents.java | 34 +- .../main/java/apoc/agg/CollAggregation.java | 16 +- core/src/main/java/apoc/agg/Graph.java | 23 +- .../main/java/apoc/agg/MaxAndMinItems.java | 54 +- core/src/main/java/apoc/agg/Median.java | 10 +- core/src/main/java/apoc/agg/Percentiles.java | 18 +- core/src/main/java/apoc/agg/Product.java | 5 +- core/src/main/java/apoc/agg/Statistics.java | 19 +- core/src/main/java/apoc/algo/Cover.java | 21 +- core/src/main/java/apoc/algo/PathFinding.java | 40 +- core/src/main/java/apoc/atomic/Atomic.java | 252 +- .../java/apoc/atomic/util/AtomicUtils.java | 48 +- .../java/apoc/bitwise/BitwiseOperations.java | 3 +- core/src/main/java/apoc/coll/Coll.java | 490 ++-- core/src/main/java/apoc/convert/Convert.java | 83 +- .../main/java/apoc/convert/ConvertConfig.java | 9 +- core/src/main/java/apoc/convert/Json.java | 103 +- core/src/main/java/apoc/create/Create.java | 90 +- core/src/main/java/apoc/cypher/Cypher.java | 222 +- .../java/apoc/cypher/CypherFunctions.java | 37 +- .../java/apoc/cypher/CypherInitializer.java | 116 +- core/src/main/java/apoc/cypher/Timeboxed.java | 60 +- .../main/java/apoc/data/url/ExtractURL.java | 31 +- core/src/main/java/apoc/date/Date.java | 529 +++-- core/src/main/java/apoc/diff/Diff.java | 15 +- core/src/main/java/apoc/example/Examples.java | 3 +- .../java/apoc/export/arrow/ArrowConfig.java | 1 - .../java/apoc/export/arrow/ArrowUtils.java | 17 +- .../java/apoc/export/arrow/ExportArrow.java | 64 +- .../export/arrow/ExportArrowFileStrategy.java | 34 +- .../apoc/export/arrow/ExportArrowService.java | 26 +- .../export/arrow/ExportArrowStrategy.java | 52 +- .../arrow/ExportArrowStreamStrategy.java | 31 +- .../export/arrow/ExportGraphFileStrategy.java | 26 +- .../export/arrow/ExportGraphStrategy.java | 55 +- .../arrow/ExportGraphStreamStrategy.java | 21 +- .../arrow/ExportResultFileStrategy.java | 19 +- .../export/arrow/ExportResultStrategy.java | 15 +- .../arrow/ExportResultStreamStrategy.java | 16 +- .../java/apoc/export/csv/CsvEntityLoader.java | 133 +- .../main/java/apoc/export/csv/CsvFormat.java | 232 +- .../java/apoc/export/csv/CsvHeaderField.java | 18 +- .../java/apoc/export/csv/CsvHeaderFields.java | 11 +- .../java/apoc/export/csv/CsvLoaderConfig.java | 27 +- .../apoc/export/csv/CsvLoaderConstants.java | 14 +- .../apoc/export/csv/CsvPropertyConverter.java | 16 +- .../main/java/apoc/export/csv/ExportCSV.java | 67 +- .../main/java/apoc/export/csv/ImportCsv.java | 60 +- .../java/apoc/export/cypher/ExportCypher.java | 114 +- .../MultiStatementCypherSubGraphExporter.java | 101 +- .../apoc/export/graphml/ExportGraphML.java | 69 +- .../apoc/export/graphml/XmlGraphMLReader.java | 119 +- .../apoc/export/graphml/XmlGraphMLWriter.java | 48 +- .../apoc/export/graphml/XmlNodeExport.java | 8 +- .../java/apoc/export/json/ExportJson.java | 65 +- .../java/apoc/export/json/ImportJson.java | 53 +- .../apoc/export/json/ImportJsonConfig.java | 15 +- .../java/apoc/export/json/JsonFormat.java | 65 +- .../export/json/JsonFormatSerializer.java | 38 +- .../java/apoc/export/json/JsonImporter.java | 128 +- core/src/main/java/apoc/graph/Graphs.java | 99 +- .../java/apoc/hashing/Fingerprinting.java | 137 +- .../apoc/hashing/FingerprintingConfig.java | 15 +- core/src/main/java/apoc/help/Help.java | 34 +- core/src/main/java/apoc/help/HelpResult.java | 3 +- .../apoc/index/QueuePoisoningCollector.java | 3 +- .../src/main/java/apoc/index/SchemaIndex.java | 144 +- core/src/main/java/apoc/label/Label.java | 8 +- core/src/main/java/apoc/load/LoadArrow.java | 59 +- core/src/main/java/apoc/load/LoadJson.java | 49 +- .../apoc/load/SkipWhitespaceInputStream.java | 14 +- core/src/main/java/apoc/load/Xml.java | 178 +- core/src/main/java/apoc/lock/Lock.java | 3 +- .../main/java/apoc/log/Neo4jLogStream.java | 37 +- core/src/main/java/apoc/map/Maps.java | 224 +- core/src/main/java/apoc/math/Maths.java | 17 +- core/src/main/java/apoc/math/Regression.java | 9 +- core/src/main/java/apoc/merge/Merge.java | 181 +- core/src/main/java/apoc/meta/Meta.java | 556 +++-- .../main/java/apoc/neighbors/Neighbors.java | 179 +- core/src/main/java/apoc/nodes/Grouping.java | 139 +- core/src/main/java/apoc/nodes/Nodes.java | 239 +- .../src/main/java/apoc/nodes/NodesConfig.java | 3 +- .../main/java/apoc/number/ArabicRoman.java | 9 +- core/src/main/java/apoc/number/Numbers.java | 147 +- .../main/java/apoc/number/exact/Exact.java | 188 +- .../src/main/java/apoc/path/LabelMatcher.java | 9 +- .../java/apoc/path/LabelMatcherGroup.java | 11 +- .../apoc/path/LabelSequenceEvaluator.java | 30 +- .../main/java/apoc/path/NodeEvaluators.java | 38 +- .../src/main/java/apoc/path/PathExplorer.java | 589 ++--- core/src/main/java/apoc/path/Paths.java | 20 +- .../path/RelationshipSequenceExpander.java | 28 +- .../src/main/java/apoc/periodic/Periodic.java | 229 +- .../java/apoc/refactor/GraphRefactoring.java | 185 +- .../java/apoc/refactor/rename/Rename.java | 315 +-- .../apoc/refactor/util/PropertiesManager.java | 30 +- .../apoc/refactor/util/RefactorConfig.java | 208 +- .../java/apoc/refactor/util/RefactorUtil.java | 18 +- .../main/java/apoc/schema/SchemaConfig.java | 26 +- core/src/main/java/apoc/schema/Schemas.java | 288 ++- core/src/main/java/apoc/scoring/Scoring.java | 8 +- .../java/apoc/search/ParallelNodeSearch.java | 141 +- core/src/main/java/apoc/spatial/Distance.java | 28 +- core/src/main/java/apoc/spatial/Geocode.java | 184 +- .../java/apoc/stats/DegreeDistribution.java | 30 +- core/src/main/java/apoc/stats/DegreeUtil.java | 14 +- .../apoc/temporal/TemporalProcedures.java | 61 +- core/src/main/java/apoc/text/Phonetic.java | 23 +- .../apoc/text/SorensenDiceCoefficient.java | 191 +- core/src/main/java/apoc/text/Strings.java | 291 ++- core/src/main/java/apoc/trigger/Trigger.java | 103 +- .../java/apoc/trigger/TriggerHandler.java | 141 +- .../trigger/TriggerHandlerNewProcedures.java | 80 +- .../main/java/apoc/trigger/TriggerInfo.java | 31 +- .../java/apoc/trigger/TriggerMetadata.java | 226 +- .../apoc/trigger/TriggerNewProcedures.java | 84 +- core/src/main/java/apoc/util/Utils.java | 47 +- core/src/main/java/apoc/version/Version.java | 1 - core/src/main/java/apoc/warmup/Warmup.java | 83 +- .../java/apoc/agg/CollAggregationTest.java | 57 +- .../java/apoc/agg/GraphAggregationTest.java | 84 +- .../agg/MaxAndMinItemsAggregationTest.java | 189 +- core/src/test/java/apoc/agg/MedianTest.java | 43 +- .../test/java/apoc/agg/PercentilesTest.java | 73 +- .../java/apoc/agg/ProductAggregationTest.java | 36 +- .../test/java/apoc/agg/StatisticsTest.java | 95 +- core/src/test/java/apoc/algo/CoverTest.java | 20 +- .../test/java/apoc/algo/PathFindingTest.java | 191 +- .../src/test/java/apoc/atomic/AtomicTest.java | 718 +++--- .../apoc/bitwise/BitwiseOperationsTest.java | 18 +- core/src/test/java/apoc/coll/CollTest.java | 1123 +++++---- .../java/apoc/convert/ConvertJsonTest.java | 972 ++++---- .../test/java/apoc/convert/ConvertTest.java | 111 +- .../src/test/java/apoc/create/CreateTest.java | 329 +-- .../apoc/cypher/CypherInitializerTest.java | 52 +- .../cypher/CypherIsVersionDifferentTest.java | 6 +- .../src/test/java/apoc/cypher/CypherTest.java | 234 +- .../java/apoc/data/url/ExtractURLTest.java | 145 +- core/src/test/java/apoc/date/DateTest.java | 936 ++++---- core/src/test/java/apoc/diff/DiffTest.java | 65 +- .../test/java/apoc/example/ExamplesTest.java | 15 +- .../test/java/apoc/export/BigGraphTest.java | 62 +- .../apoc/export/ExportCoreSecurityTest.java | 168 +- .../export/ExportStreamsStatementsTest.java | 95 +- .../export/ImportAndLoadCoreSecurityTest.java | 117 +- .../java/apoc/export/SecurityTestUtil.java | 66 +- .../java/apoc/export/arrow/ArrowTest.java | 322 ++- .../export/arrow/ExportArrowSecurityTest.java | 86 +- .../apoc/export/csv/CsvHeaderFieldTests.java | 18 +- .../export/csv/ExportCsvNeo4jAdminTest.java | 314 ++- .../java/apoc/export/csv/ExportCsvTest.java | 485 ++-- .../apoc/export/csv/ImportCsvLdbcTest.java | 217 +- .../java/apoc/export/csv/ImportCsvTest.java | 750 +++--- .../cypher/ExportCypherMultiRelTest.java | 183 +- .../apoc/export/cypher/ExportCypherTest.java | 2021 +++++++++------- .../export/cypher/ExportCypherTestUtils.java | 259 ++- .../export/graphml/ExportGraphMLTest.java | 710 +++--- .../export/graphml/ExportGraphMLTestUtil.java | 325 +-- .../java/apoc/export/json/ExportJsonTest.java | 352 +-- .../java/apoc/export/json/ImportJsonTest.java | 232 +- core/src/test/java/apoc/graph/GraphsTest.java | 965 +++++--- .../java/apoc/hashing/FingerprintingTest.java | 219 +- core/src/test/java/apoc/help/HelpTest.java | 48 +- .../test/java/apoc/index/SchemaIndexTest.java | 349 ++- core/src/test/java/apoc/label/LabelTest.java | 38 +- .../src/test/java/apoc/load/LoadJsonTest.java | 495 ++-- .../java/apoc/load/SimpleHttpHandler.java | 13 +- .../test/java/apoc/load/SimpleXmlTest.java | 13 +- .../load/SkipWhitespaceInputStreamTest.java | 8 +- core/src/test/java/apoc/load/XmlTest.java | 480 ++-- .../load/relative/LoadRelativePathTest.java | 51 +- core/src/test/java/apoc/lock/LockTest.java | 21 +- .../java/apoc/log/Neo4jLogStreamTest.java | 21 +- core/src/test/java/apoc/map/MapsTest.java | 286 ++- core/src/test/java/apoc/math/MathsTest.java | 138 +- .../test/java/apoc/math/RegressionTest.java | 62 +- core/src/test/java/apoc/merge/MergeTest.java | 260 ++- core/src/test/java/apoc/meta/MetaTest.java | 2054 ++++++++++------- .../java/apoc/neighbors/NeighborsTest.java | 136 +- .../test/java/apoc/nodes/GroupingTest.java | 240 +- core/src/test/java/apoc/nodes/NodesTest.java | 1160 ++++++---- .../java/apoc/number/ArabicRomanTest.java | 25 +- .../test/java/apoc/number/NumbersTest.java | 86 +- .../java/apoc/number/exact/ExactTest.java | 191 +- .../test/java/apoc/path/ExpandPathTest.java | 1189 +++++----- .../java/apoc/path/LabelSequenceTest.java | 62 +- .../test/java/apoc/path/NodeFilterTest.java | 294 +-- core/src/test/java/apoc/path/PathsTest.java | 105 +- .../test/java/apoc/path/RelSequenceTest.java | 120 +- .../src/test/java/apoc/path/SequenceTest.java | 145 +- .../src/test/java/apoc/path/SubgraphTest.java | 972 ++++---- .../java/apoc/periodic/BatchModeTest.java | 13 +- .../test/java/apoc/periodic/PeriodicTest.java | 700 +++--- .../java/apoc/periodic/PeriodicUtilsTest.java | 27 +- .../java/apoc/refactor/CloneSubgraphTest.java | 759 +++--- .../apoc/refactor/GraphRefactoringTest.java | 1037 ++++++--- .../java/apoc/refactor/rename/RenameTest.java | 824 ++++--- .../refactor/util/PropertiesManagerTest.java | 356 +-- .../test/java/apoc/schema/SchemasTest.java | 431 ++-- .../test/java/apoc/scoring/ScoringTest.java | 35 +- .../apoc/search/ParallelNodeSearchTest.java | 116 +- .../test/java/apoc/spatial/DistanceTest.java | 23 +- .../test/java/apoc/spatial/GeocodeTest.java | 240 +- .../test/java/apoc/spatial/SpatialTest.java | 284 ++- .../apoc/stats/DegreeDistributionTest.java | 81 +- .../apoc/temporal/TemporalProceduresTest.java | 118 +- .../src/test/java/apoc/text/PhoneticTest.java | 75 +- .../text/SorensenDiceCoefficientTest.java | 88 +- .../test/java/apoc/text/StringCleanTest.java | 27 +- core/src/test/java/apoc/text/StringsTest.java | 791 +++++-- .../apoc/trigger/TriggerDisabledTest.java | 52 +- .../trigger/TriggerNewProceduresTest.java | 418 ++-- .../java/apoc/trigger/TriggerRestartTest.java | 56 +- .../test/java/apoc/trigger/TriggerTest.java | 240 +- .../src/test/java/apoc/util/LogsUtilTest.java | 8 +- .../test/java/apoc/util/QueryUtilTest.java | 15 +- core/src/test/java/apoc/util/UtilTest.java | 76 +- core/src/test/java/apoc/util/UtilsTest.java | 247 +- .../src/test/java/apoc/warmup/WarmupTest.java | 29 +- it/src/test/java/apoc/it/common/UtilIT.java | 55 +- .../test/java/apoc/it/core/ApocSplitTest.java | 891 +++---- .../java/apoc/it/core/CollEnterpriseTest.java | 47 +- .../apoc/it/core/CypherEnterpriseTest.java | 34 +- .../test/java/apoc/it/core/ExportCsvIT.java | 44 +- .../java/apoc/it/core/ExportCsvS3Test.java | 191 +- .../ExportCypherEnterpriseFeaturesTest.java | 85 +- .../java/apoc/it/core/ExportCypherS3Test.java | 379 ++- .../apoc/it/core/ExportGraphMLS3Test.java | 94 +- .../java/apoc/it/core/ExportJsonS3Test.java | 285 ++- .../core/GraphRefactoringEnterpriseTest.java | 44 +- .../ImportJsonEnterpriseFeaturesTest.java | 61 +- .../apoc/it/core/LoadCoreEnterpriseTest.java | 144 +- .../it/core/MetaEnterpriseFeaturesTest.java | 62 +- .../core/SchemasEnterpriseFeaturesTest.java | 393 ++-- .../test/java/apoc/it/core/StartupTest.java | 118 +- .../it/core/TriggerClusterRoutingTest.java | 103 +- .../core/TriggerEnterpriseFeaturesTest.java | 196 +- .../apoc/it/core/WarmupEnterpriseTest.java | 21 +- .../java/apoc/processor/ApocProcessor.java | 29 +- .../apoc/processor/ExtensionClassWriter.java | 22 +- .../java/apoc/processor/SignatureVisitor.java | 12 +- .../apoc/processor/ApocProcessorTest.java | 109 +- .../ProcedureSignatureVisitorTest.java | 38 +- ...gregationFunctionSignatureVisitorTest.java | 42 +- .../UserFunctionSignatureVisitorTest.java | 38 +- .../src/main/java/apoc/algo/AlgoUtil.java | 41 +- .../src/main/java/apoc/csv/CsvTestUtil.java | 7 +- .../main/java/apoc/cypher/CypherTestUtil.java | 179 +- .../java/apoc/periodic/PeriodicTestUtils.java | 48 +- .../java/apoc/trigger/TriggerTestUtil.java | 14 +- .../src/main/java/apoc/util/FileTestUtil.java | 10 +- .../apoc/util/Neo4jContainerExtension.java | 39 +- .../apoc/util/SensitivePathGenerator.java | 14 +- .../java/apoc/util/StatusCodeMatcher.java | 3 +- .../java/apoc/util/TestContainerUtil.java | 110 +- .../src/main/java/apoc/util/TestUtil.java | 142 +- .../util/TestcontainersCausalCluster.java | 104 +- .../java/apoc/util/TransactionTestUtil.java | 103 +- .../main/java/apoc/util/s3/S3Container.java | 28 +- .../apoc/util/s3/S3ParamsExtractorTest.java | 27 +- .../main/java/apoc/util/s3/S3TestUtil.java | 35 +- .../src/main/java/apoc/xml/XmlTestUtils.java | 98 +- .../java/org/neo4j/test/rule/DbmsRule.java | 167 +- .../org/neo4j/test/rule/ExternalResource.java | 48 +- .../neo4j/test/rule/ImpermanentDbmsRule.java | 34 +- 407 files changed, 28955 insertions(+), 22006 deletions(-) diff --git a/build.gradle b/build.gradle index 13dbdec5b..820d7b387 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'com.github.johnrengelman.shadow' version '7.1.0' apply false id 'maven-publish' id "com.github.hierynomus.license-report" version"0.16.1" + id "com.diffplug.spotless" version "6.22.0" } downloadLicenses { @@ -35,8 +36,17 @@ repositories { } subprojects { + apply plugin: "com.diffplug.spotless" apply plugin: 'java-library' + spotless { + java { + target 'src/*/java/**/*.java' + removeUnusedImports() + palantirJavaFormat() + } + } + repositories { /*maven { // this contains the neo4j 4.0.0-beta jars diff --git a/common/build.gradle b/common/build.gradle index 957933c5f..16466b864 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,14 +3,6 @@ import org.gradle.api.internal.artifacts.DefaultExcludeRule plugins { id 'java' id 'maven-publish' - id "com.diffplug.spotless" version "6.7.2" -} - -spotless { - java { - target 'src/*/java/**/*.java' - removeUnusedImports() - } } archivesBaseName = "apoc" diff --git a/common/src/main/java/apoc/ApocConfig.java b/common/src/main/java/apoc/ApocConfig.java index dc109e200..42516d9a9 100644 --- a/common/src/main/java/apoc/ApocConfig.java +++ b/common/src/main/java/apoc/ApocConfig.java @@ -18,11 +18,32 @@ */ package apoc; +import static apoc.util.FileUtils.isFile; +import static java.lang.String.format; +import static org.neo4j.configuration.BootloaderSettings.lib_directory; +import static org.neo4j.configuration.BootloaderSettings.run_directory; +import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME; +import static org.neo4j.configuration.GraphDatabaseSettings.data_directory; +import static org.neo4j.configuration.GraphDatabaseSettings.load_csv_file_url_root; +import static org.neo4j.configuration.GraphDatabaseSettings.logs_directory; +import static org.neo4j.configuration.GraphDatabaseSettings.neo4j_home; +import static org.neo4j.configuration.GraphDatabaseSettings.plugin_dir; +import static org.neo4j.configuration.GraphDatabaseSettings.transaction_logs_root_path; +import static org.neo4j.internal.helpers.ProcessUtils.executeCommandWithOutput; + import apoc.export.util.ExportConfig; import inet.ipaddr.IPAddressString; - import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.URL; +import java.time.Duration; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Map; +import java.util.stream.Stream; import org.apache.commons.configuration2.Configuration; import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.commons.configuration2.builder.combined.CombinedConfigurationBuilder; @@ -44,53 +65,30 @@ import org.neo4j.logging.internal.LogService; import org.neo4j.util.Preconditions; -import java.io.IOException; -import java.lang.reflect.Field; -import java.net.URL; -import java.time.Duration; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Stream; - -import static apoc.util.FileUtils.isFile; -import static java.lang.String.format; -import static org.neo4j.configuration.BootloaderSettings.lib_directory; -import static org.neo4j.configuration.BootloaderSettings.run_directory; -import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME; -import static org.neo4j.configuration.GraphDatabaseSettings.data_directory; -import static org.neo4j.configuration.GraphDatabaseSettings.load_csv_file_url_root; -import static org.neo4j.configuration.GraphDatabaseSettings.logs_directory; -import static org.neo4j.configuration.GraphDatabaseSettings.neo4j_home; -import static org.neo4j.configuration.GraphDatabaseSettings.plugin_dir; -import static org.neo4j.configuration.GraphDatabaseSettings.transaction_logs_root_path; -import static org.neo4j.internal.helpers.ProcessUtils.executeCommandWithOutput; - public class ApocConfig extends LifecycleAdapter { public static final String SUN_JAVA_COMMAND = "sun.java.command"; public static final String APOC_IMPORT_FILE_ENABLED = "apoc.import.file.enabled"; public static final String APOC_EXPORT_FILE_ENABLED = "apoc.export.file.enabled"; public static final String APOC_IMPORT_FILE_USE_NEO4J_CONFIG = "apoc.import.file.use_neo4j_config"; public static final String APOC_TRIGGER_ENABLED = "apoc.trigger.enabled"; - public static final String APOC_IMPORT_FILE_ALLOW__READ__FROM__FILESYSTEM = "apoc.import.file.allow_read_from_filesystem"; + public static final String APOC_IMPORT_FILE_ALLOW__READ__FROM__FILESYSTEM = + "apoc.import.file.allow_read_from_filesystem"; public static final String APOC_CONFIG_JOBS_SCHEDULED_NUM_THREADS = "apoc.jobs.scheduled.num_threads"; public static final String APOC_CONFIG_JOBS_POOL_NUM_THREADS = "apoc.jobs.pool.num_threads"; public static final String APOC_CONFIG_JOBS_QUEUE_SIZE = "apoc.jobs.queue.size"; public static final String APOC_CONFIG_INITIALIZER = "apoc.initializer"; - public static final String LOAD_FROM_FILE_ERROR = "Import from files not enabled, please set apoc.import.file.enabled=true in your apoc.conf"; + public static final String LOAD_FROM_FILE_ERROR = + "Import from files not enabled, please set apoc.import.file.enabled=true in your apoc.conf"; public static final String APOC_MAX_DECOMPRESSION_RATIO = "apoc.max.decompression.ratio"; public static final Integer DEFAULT_MAX_DECOMPRESSION_RATIO = 200; private static final WebURLAccessRule webAccessRule = new WebURLAccessRule(); // These were earlier added via the Neo4j config using the ApocSettings.java class - private static final Map configDefaultValues = - Map.of( - APOC_EXPORT_FILE_ENABLED, false, - APOC_IMPORT_FILE_ENABLED, false, - APOC_IMPORT_FILE_USE_NEO4J_CONFIG, true, - APOC_TRIGGER_ENABLED, false - ); + private static final Map configDefaultValues = Map.of( + APOC_EXPORT_FILE_ENABLED, false, + APOC_IMPORT_FILE_ENABLED, false, + APOC_IMPORT_FILE_USE_NEO4J_CONFIG, true, + APOC_TRIGGER_ENABLED, false); private static final List NEO4J_DIRECTORY_CONFIGURATION_SETTING_NAMES = new ArrayList<>(Arrays.asList( data_directory, load_csv_file_url_root, @@ -99,13 +97,13 @@ public class ApocConfig extends LifecycleAdapter { transaction_logs_root_path, run_directory, lib_directory, - neo4j_home - )); + neo4j_home)); private static final String DEFAULT_PATH = "."; private static final String CONFIG_DIR = "config-dir="; - public static final String EXPORT_NOT_ENABLED_ERROR = "Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf."; - public static final String EXPORT_TO_FILE_ERROR = EXPORT_NOT_ENABLED_ERROR + - "\nOtherwise, if you are running in a cloud environment without filesystem access, use the `{stream:true}` config and null as a 'file' parameter to stream the export back to your client."; + public static final String EXPORT_NOT_ENABLED_ERROR = + "Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf."; + public static final String EXPORT_TO_FILE_ERROR = EXPORT_NOT_ENABLED_ERROR + + "\nOtherwise, if you are running in a cloud environment without filesystem access, use the `{stream:true}` config and null as a 'file' parameter to stream the export back to your client."; private final Config neo4jConfig; private final Log log; @@ -122,12 +120,18 @@ public class ApocConfig extends LifecycleAdapter { private Duration commandEvaluationTimeout; - public ApocConfig(Config neo4jConfig, LogService log, GlobalProcedures globalProceduresRegistry, DatabaseManagementService databaseManagementService) { + public ApocConfig( + Config neo4jConfig, + LogService log, + GlobalProcedures globalProceduresRegistry, + DatabaseManagementService databaseManagementService) { this.neo4jConfig = neo4jConfig; this.blockedIpRanges = neo4jConfig.get(GraphDatabaseInternalSettings.cypher_ip_blocklist); - this.commandEvaluationTimeout = neo4jConfig.get(GraphDatabaseInternalSettings.config_command_evaluation_timeout); + this.commandEvaluationTimeout = + neo4jConfig.get(GraphDatabaseInternalSettings.config_command_evaluation_timeout); if (this.commandEvaluationTimeout == null) { - this.commandEvaluationTimeout = GraphDatabaseInternalSettings.config_command_evaluation_timeout.defaultValue(); + this.commandEvaluationTimeout = + GraphDatabaseInternalSettings.config_command_evaluation_timeout.defaultValue(); } this.expandCommands = neo4jConfig.expandCommands(); this.log = log.getInternalLog(ApocConfig.class); @@ -189,7 +193,9 @@ public void init() { protected String determineNeo4jConfFolder() { String command = System.getProperty(SUN_JAVA_COMMAND); if (command == null) { - log.warn("system property %s is not set, assuming '.' as conf dir. This might cause `apoc.conf` not getting loaded.", SUN_JAVA_COMMAND); + log.warn( + "system property %s is not set, assuming '.' as conf dir. This might cause `apoc.conf` not getting loaded.", + SUN_JAVA_COMMAND); return DEFAULT_PATH; } else { final String neo4jConfFolder = Stream.of(command.split("--")) @@ -220,23 +226,24 @@ protected void loadConfiguration() { config = builder.getConfiguration(); // Command Expansion if needed - config.getKeys().forEachRemaining(configKey -> config.setProperty( - configKey, - evaluateIfCommand(configKey, config.getProperty(configKey).toString()) - )); + config.getKeys() + .forEachRemaining(configKey -> config.setProperty( + configKey, + evaluateIfCommand( + configKey, config.getProperty(configKey).toString()))); // set config settings not explicitly set in apoc.conf to their default value - configDefaultValues.forEach((k,v) -> { + configDefaultValues.forEach((k, v) -> { if (!config.containsKey(k)) { - config.setProperty(k, v); - log.info("setting APOC config to default value: " + k + "=" + v); + config.setProperty(k, v); + log.info("setting APOC config to default value: " + k + "=" + v); } }); addDbmsDirectoriesMetricsSettings(); for (Setting s : NEO4J_DIRECTORY_CONFIGURATION_SETTING_NAMES) { Object value = neo4jConfig.get(s); - if (value!=null) { + if (value != null) { config.setProperty(s.name(), value.toString()); } } @@ -245,13 +252,15 @@ protected void loadConfiguration() { config.setProperty(APOC_MAX_DECOMPRESSION_RATIO, DEFAULT_MAX_DECOMPRESSION_RATIO); } if (config.getInt(APOC_MAX_DECOMPRESSION_RATIO) == 0) { - throw new IllegalArgumentException(format("value 0 is not allowed for the config option %s", APOC_MAX_DECOMPRESSION_RATIO)); + throw new IllegalArgumentException( + format("value 0 is not allowed for the config option %s", APOC_MAX_DECOMPRESSION_RATIO)); } boolean allowFileUrls = neo4jConfig.get(GraphDatabaseSettings.allow_file_urls); config.setProperty(APOC_IMPORT_FILE_ALLOW__READ__FROM__FILESYSTEM, allowFileUrls); - - // todo - evaluate default timezone here [maybe is reusable], otherwise through db.execute('CALL dbms.listConfig()') + + // todo - evaluate default timezone here [maybe is reusable], otherwise through db.execute('CALL + // dbms.listConfig()') final Setting db_temporal_timezone = GraphDatabaseSettings.db_temporal_timezone; config.setProperty(db_temporal_timezone.name(), neo4jConfig.get(db_temporal_timezone)); } catch (ConfigurationException e) { @@ -261,7 +270,8 @@ protected void loadConfiguration() { private void addDbmsDirectoriesMetricsSettings() { try { - Class metricsSettingsClass = Class.forName("com.neo4j.kernel.impl.enterprise.configuration.MetricsSettings"); + Class metricsSettingsClass = + Class.forName("com.neo4j.kernel.impl.enterprise.configuration.MetricsSettings"); Field csvPathField = metricsSettingsClass.getDeclaredField("csvPath"); Setting dbms_directories_metrics = (Setting) csvPathField.get(null); NEO4J_DIRECTORY_CONFIGURATION_SETTING_NAMES.add(dbms_directories_metrics); @@ -311,7 +321,9 @@ public void checkReadAllowed(String url) throws IOException { public void checkWriteAllowed(ExportConfig exportConfig, String fileName) { if (!config.getBoolean(APOC_EXPORT_FILE_ENABLED)) { - if (exportConfig == null || (fileName != null && !fileName.equals("")) || !exportConfig.streamStatements()) { + if (exportConfig == null + || (fileName != null && !fileName.equals("")) + || !exportConfig.streamStatements()) { throw new RuntimeException(EXPORT_TO_FILE_ERROR); } } @@ -322,7 +334,8 @@ public void checkWriteAllowed(ExportConfig exportConfig, String fileName) { public void checkStorageEngine() { final List supportedTypes = Arrays.asList("standard", "aligned", "high_limit"); if (!supportedTypes.contains(neo4jConfig.get(GraphDatabaseSettings.db_format))) { - throw new RuntimeException("Record engine type unsupported; please use one of the following; standard, aligned or high_limit"); + throw new RuntimeException( + "Record engine type unsupported; please use one of the following; standard, aligned or high_limit"); } } @@ -330,7 +343,6 @@ public static ApocConfig apocConfig() { return theInstance; } - /* * delegate methods for Configuration */ @@ -355,7 +367,7 @@ public boolean isImportFolderConfigured() { // in case we're test database import path is TestDatabaseManagementServiceBuilder.EPHEMERAL_PATH String importFolder = getImportDir(); - if (importFolder==null) { + if (importFolder == null) { return false; } else { return !"/target/test data/neo4j".equals(importFolder); @@ -372,7 +384,7 @@ public int getInt(String key, int defaultValue) { } catch (ConversionException e) { Object o = getConfig().getProperty(key); if (o instanceof Duration) { - return (int) ((Duration)o).getSeconds(); + return (int) ((Duration) o).getSeconds(); } else { throw new IllegalArgumentException("don't know how to convert for config option " + key, e); } diff --git a/common/src/main/java/apoc/ApocConfigExtensionFactory.java b/common/src/main/java/apoc/ApocConfigExtensionFactory.java index b2797a941..5524473a8 100644 --- a/common/src/main/java/apoc/ApocConfigExtensionFactory.java +++ b/common/src/main/java/apoc/ApocConfigExtensionFactory.java @@ -37,8 +37,11 @@ public class ApocConfigExtensionFactory extends ExtensionFactory apocGlobalComponents; private final Collection registeredListeners = new ArrayList<>(); - public ApocLifecycle(LogService log, GraphDatabaseAPI db, Dependencies dependencies) { this.db = db; this.dependencies = dependencies; @@ -101,16 +108,14 @@ public static void withNonSystemDatabase(GraphDatabaseService db, Consumer @Override public void init() { withNonSystemDatabase(db, aVoid -> { - for (ApocGlobalComponents c: apocGlobalComponents) { + for (ApocGlobalComponents c : apocGlobalComponents) { services.putAll(c.getServices(db, dependencies)); } String databaseName = db.databaseName(); - services.values().forEach(lifecycle -> dependencies.registerComponentLifecycle().addResolver( - databaseName, - lifecycle.getClass(), - lifecycle)); - + services.values().forEach(lifecycle -> dependencies + .registerComponentLifecycle() + .addResolver(databaseName, lifecycle.getClass(), lifecycle)); }); } @@ -124,13 +129,12 @@ public void start() { userLog.error("failed to start service " + key, e); } }); - }); AvailabilityGuard availabilityGuard = dependencies.availabilityGuard(); - for (ApocGlobalComponents c: apocGlobalComponents) { - for (AvailabilityListener listener: c.getListeners(db, dependencies)) { - registeredListeners.add( listener ); + for (ApocGlobalComponents c : apocGlobalComponents) { + for (AvailabilityListener listener : c.getListeners(db, dependencies)) { + registeredListeners.add(listener); availabilityGuard.addListener(listener); } } @@ -153,8 +157,7 @@ public void stop() { registeredListeners.clear(); } - public Collection getRegisteredListeners() - { + public Collection getRegisteredListeners() { return registeredListeners; } } diff --git a/common/src/main/java/apoc/ApocGlobalComponents.java b/common/src/main/java/apoc/ApocGlobalComponents.java index 3035ab83b..5a12a30d0 100644 --- a/common/src/main/java/apoc/ApocGlobalComponents.java +++ b/common/src/main/java/apoc/ApocGlobalComponents.java @@ -18,17 +18,16 @@ */ package apoc; +import java.util.Collection; +import java.util.Map; import org.neo4j.annotations.service.Service; import org.neo4j.kernel.availability.AvailabilityListener; import org.neo4j.kernel.internal.GraphDatabaseAPI; import org.neo4j.kernel.lifecycle.Lifecycle; -import java.util.Collection; -import java.util.Map; - @Service public interface ApocGlobalComponents { - Map getServices(GraphDatabaseAPI db, ApocExtensionFactory.Dependencies dependencies); + Map getServices(GraphDatabaseAPI db, ApocExtensionFactory.Dependencies dependencies); Collection getContextClasses(); diff --git a/common/src/main/java/apoc/PoolExtensionFactory.java b/common/src/main/java/apoc/PoolExtensionFactory.java index 09e8b0aa8..45ed0ed79 100644 --- a/common/src/main/java/apoc/PoolExtensionFactory.java +++ b/common/src/main/java/apoc/PoolExtensionFactory.java @@ -36,7 +36,9 @@ public PoolExtensionFactory() { public interface Dependencies { GlobalProcedures globalProceduresRegistry(); + LogService log(); + ApocConfig apocConfig(); } @@ -44,5 +46,4 @@ public interface Dependencies { public Lifecycle newInstance(ExtensionContext context, Dependencies dependencies) { return new Pools(dependencies.log(), dependencies.globalProceduresRegistry(), dependencies.apocConfig()); } - } diff --git a/common/src/main/java/apoc/Pools.java b/common/src/main/java/apoc/Pools.java index 164c68960..b46d980c4 100644 --- a/common/src/main/java/apoc/Pools.java +++ b/common/src/main/java/apoc/Pools.java @@ -19,13 +19,6 @@ package apoc; import apoc.periodic.PeriodicUtils; -import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.graphdb.Transaction; -import org.neo4j.kernel.api.procedure.GlobalProcedures; -import org.neo4j.kernel.lifecycle.LifecycleAdapter; -import org.neo4j.logging.Log; -import org.neo4j.logging.internal.LogService; - import java.util.Iterator; import java.util.List; import java.util.Map; @@ -45,11 +38,17 @@ import java.util.concurrent.TimeoutException; import java.util.function.BiConsumer; import java.util.stream.Stream; +import org.neo4j.graphdb.GraphDatabaseService; +import org.neo4j.graphdb.Transaction; +import org.neo4j.kernel.api.procedure.GlobalProcedures; +import org.neo4j.kernel.lifecycle.LifecycleAdapter; +import org.neo4j.logging.Log; +import org.neo4j.logging.internal.LogService; public class Pools extends LifecycleAdapter { - public final static int DEFAULT_SCHEDULED_THREADS = Runtime.getRuntime().availableProcessors() / 4; - public final static int DEFAULT_POOL_THREADS = Runtime.getRuntime().availableProcessors() * 2; + public static final int DEFAULT_SCHEDULED_THREADS = Runtime.getRuntime().availableProcessors() / 4; + public static final int DEFAULT_POOL_THREADS = Runtime.getRuntime().availableProcessors() * 2; private final Log log; private final ApocConfig apocConfig; @@ -57,7 +56,7 @@ public class Pools extends LifecycleAdapter { private ScheduledExecutorService scheduledExecutorService; private ExecutorService defaultExecutorService; - private final Map jobList = new ConcurrentHashMap<>(); + private final Map jobList = new ConcurrentHashMap<>(); public Pools(LogService log, GlobalProcedures globalProceduresRegistry, ApocConfig apocConfig) { @@ -72,7 +71,8 @@ public Pools(LogService log, GlobalProcedures globalProceduresRegistry, ApocConf @Override public void init() { - int threads = Math.max(1, apocConfig.getInt(ApocConfig.APOC_CONFIG_JOBS_POOL_NUM_THREADS, DEFAULT_POOL_THREADS)); + int threads = + Math.max(1, apocConfig.getInt(ApocConfig.APOC_CONFIG_JOBS_POOL_NUM_THREADS, DEFAULT_POOL_THREADS)); int queueSize = Math.max(1, apocConfig.getInt(ApocConfig.APOC_CONFIG_JOBS_QUEUE_SIZE, threads * 5)); @@ -82,35 +82,56 @@ public void init() { t.setDaemon(true); return t; }; - this.singleExecutorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(queueSize), - threadFactory, new CallerBlocksPolicy()); - - this.defaultExecutorService = new ThreadPoolExecutor(threads / 2, threads, 30L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(queueSize), - threadFactory, new CallerBlocksPolicy()); + this.singleExecutorService = new ThreadPoolExecutor( + 1, + 1, + 0L, + TimeUnit.SECONDS, + new ArrayBlockingQueue<>(queueSize), + threadFactory, + new CallerBlocksPolicy()); + + this.defaultExecutorService = new ThreadPoolExecutor( + threads / 2, + threads, + 30L, + TimeUnit.SECONDS, + new ArrayBlockingQueue<>(queueSize), + threadFactory, + new CallerBlocksPolicy()); this.scheduledExecutorService = Executors.newScheduledThreadPool( - Math.max(1, apocConfig.getInt(ApocConfig.APOC_CONFIG_JOBS_SCHEDULED_NUM_THREADS, DEFAULT_SCHEDULED_THREADS)), - threadFactory - ); - - scheduledExecutorService.scheduleAtFixedRate(() -> { - for (Iterator> it = jobList.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = it.next(); - if (entry.getValue().isDone() || entry.getValue().isCancelled()) it.remove(); - } - },10,10,TimeUnit.SECONDS); + Math.max( + 1, + apocConfig.getInt( + ApocConfig.APOC_CONFIG_JOBS_SCHEDULED_NUM_THREADS, DEFAULT_SCHEDULED_THREADS)), + threadFactory); + + scheduledExecutorService.scheduleAtFixedRate( + () -> { + for (Iterator> it = + jobList.entrySet().iterator(); + it.hasNext(); ) { + Map.Entry entry = it.next(); + if (entry.getValue().isDone() || entry.getValue().isCancelled()) it.remove(); + } + }, + 10, + 10, + TimeUnit.SECONDS); } @Override public void shutdown() { - Stream.of(singleExecutorService, defaultExecutorService, scheduledExecutorService).forEach( service -> { - try { - service.shutdown(); - service.awaitTermination(10, TimeUnit.SECONDS); - } catch (InterruptedException e) { - throw new RuntimeException("Shutdown failed to complete with error: " + e.getMessage()); - } - }); + Stream.of(singleExecutorService, defaultExecutorService, scheduledExecutorService) + .forEach(service -> { + try { + service.shutdown(); + service.awaitTermination(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + throw new RuntimeException("Shutdown failed to complete with error: " + e.getMessage()); + } + }); } public ExecutorService getSingleExecutorService() { @@ -132,24 +153,21 @@ public Map getJobList() { static class CallerBlocksPolicy implements RejectedExecutionHandler { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { - // Submit again by directly injecting the task into the work queue, waiting if necessary, but also periodically checking if the pool has been + // Submit again by directly injecting the task into the work queue, waiting if necessary, but also + // periodically checking if the pool has been // shut down. - FutureTask task = new FutureTask<>( r, null ); + FutureTask task = new FutureTask<>(r, null); BlockingQueue queue = executor.getQueue(); while (!executor.isShutdown()) { try { - if ( queue.offer( task, 250, TimeUnit.MILLISECONDS ) ) - { - while ( !executor.isShutdown() ) - { - try - { - task.get( 250, TimeUnit.MILLISECONDS ); + if (queue.offer(task, 250, TimeUnit.MILLISECONDS)) { + while (!executor.isShutdown()) { + try { + task.get(250, TimeUnit.MILLISECONDS); return; // Success! - } - catch ( TimeoutException ignore ) - { - // This is fine an expected. We just want to check that the executor hasn't been shut down. + } catch (TimeoutException ignore) { + // This is fine an expected. We just want to check that the executor hasn't been shut + // down. } } } @@ -162,13 +180,12 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { public Future processBatch(List batch, GraphDatabaseService db, BiConsumer action) { return defaultExecutorService.submit(() -> { - try (Transaction tx = db.beginTx()) { - batch.forEach(t -> action.accept(tx, t)); - tx.commit(); - } - return null; + try (Transaction tx = db.beginTx()) { + batch.forEach(t -> action.accept(tx, t)); + tx.commit(); } - ); + return null; + }); } public static T force(Future future) throws ExecutionException { diff --git a/common/src/main/java/apoc/RegisterComponentFactory.java b/common/src/main/java/apoc/RegisterComponentFactory.java index 29bfdacb0..995eca539 100644 --- a/common/src/main/java/apoc/RegisterComponentFactory.java +++ b/common/src/main/java/apoc/RegisterComponentFactory.java @@ -20,7 +20,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - import org.neo4j.annotations.service.ServiceProvider; import org.neo4j.kernel.api.procedure.GlobalProcedures; import org.neo4j.kernel.extension.ExtensionFactory; @@ -54,6 +53,7 @@ public Lifecycle newInstance(ExtensionContext context, Dependencies dependencies public interface Dependencies { LogService log(); + GlobalProcedures globalProceduresRegistry(); } @@ -74,23 +74,25 @@ public Map> getResolvers() { @Override public void init() { - for (ApocGlobalComponents c: Services.loadAll(ApocGlobalComponents.class)) { - for (Class clazz: c.getContextClasses()) { + for (ApocGlobalComponents c : Services.loadAll(ApocGlobalComponents.class)) { + for (Class clazz : c.getContextClasses()) { resolvers.put(clazz, new ConcurrentHashMap<>()); } } - resolvers.forEach( - (clazz, dbFunctionMap) -> globalProceduresRegistry.registerComponent(clazz, context -> { + resolvers.forEach((clazz, dbFunctionMap) -> globalProceduresRegistry.registerComponent( + clazz, + context -> { String databaseName = context.graphDatabaseAPI().databaseName(); Object instance = dbFunctionMap.get(databaseName); if (instance == null) { - log.warn("couldn't find a instance for clazz %s and database %s", clazz.getName(), databaseName); + log.warn( + "couldn't find a instance for clazz %s and database %s", + clazz.getName(), databaseName); } return instance; - }, true) - ); + }, + true)); } - } } diff --git a/common/src/main/java/apoc/SystemPropertyKeys.java b/common/src/main/java/apoc/SystemPropertyKeys.java index 74858faea..bf0adbb17 100644 --- a/common/src/main/java/apoc/SystemPropertyKeys.java +++ b/common/src/main/java/apoc/SystemPropertyKeys.java @@ -18,7 +18,7 @@ */ package apoc; -public enum SystemPropertyKeys { +public enum SystemPropertyKeys { database, name, diff --git a/common/src/main/java/apoc/algo/PathFindingUtils.java b/common/src/main/java/apoc/algo/PathFindingUtils.java index 1aa96d6be..6f1fe1d3d 100644 --- a/common/src/main/java/apoc/algo/PathFindingUtils.java +++ b/common/src/main/java/apoc/algo/PathFindingUtils.java @@ -41,33 +41,29 @@ public GeoEstimateEvaluatorPointCustom(String pointPropertyKey) { } @Override - public Double getCost( Node node, Node goal) { + public Double getCost(Node node, Node goal) { double[] nodeCoordinates = getCoordinates(node); - if ( cachedGoal == null || !cachedGoal.equals( goal ) ) - { + if (cachedGoal == null || !cachedGoal.equals(goal)) { cachedGoalCoordinates = getCoordinates(goal); cachedGoal = goal; } - return distance(nodeCoordinates[0], nodeCoordinates[1], - cachedGoalCoordinates[0], cachedGoalCoordinates[1] ); + return distance(nodeCoordinates[0], nodeCoordinates[1], cachedGoalCoordinates[0], cachedGoalCoordinates[1]); } - private static double distance( double latitude1, double longitude1, - double latitude2, double longitude2 ) { - latitude1 = Math.toRadians( latitude1 ); - longitude1 = Math.toRadians( longitude1 ); - latitude2 = Math.toRadians( latitude2 ); - longitude2 = Math.toRadians( longitude2 ); - double cLa1 = Math.cos( latitude1 ); - double xA = EARTH_RADIUS * cLa1 * Math.cos( longitude1 ); - double yA = EARTH_RADIUS * cLa1 * Math.sin( longitude1 ); - double zA = EARTH_RADIUS * Math.sin( latitude1 ); - double cLa2 = Math.cos( latitude2 ); - double xB = EARTH_RADIUS * cLa2 * Math.cos( longitude2 ); - double yB = EARTH_RADIUS * cLa2 * Math.sin( longitude2 ); - double zB = EARTH_RADIUS * Math.sin( latitude2 ); - return Math.sqrt( ( xA - xB ) * ( xA - xB ) + ( yA - yB ) - * ( yA - yB ) + ( zA - zB ) * ( zA - zB ) ); + private static double distance(double latitude1, double longitude1, double latitude2, double longitude2) { + latitude1 = Math.toRadians(latitude1); + longitude1 = Math.toRadians(longitude1); + latitude2 = Math.toRadians(latitude2); + longitude2 = Math.toRadians(longitude2); + double cLa1 = Math.cos(latitude1); + double xA = EARTH_RADIUS * cLa1 * Math.cos(longitude1); + double yA = EARTH_RADIUS * cLa1 * Math.sin(longitude1); + double zA = EARTH_RADIUS * Math.sin(latitude1); + double cLa2 = Math.cos(latitude2); + double xB = EARTH_RADIUS * cLa2 * Math.cos(longitude2); + double yB = EARTH_RADIUS * cLa2 * Math.sin(longitude2); + double zB = EARTH_RADIUS * Math.sin(latitude2); + return Math.sqrt((xA - xB) * (xA - xB) + (yA - yB) * (yA - yB) + (zA - zB) * (zA - zB)); } // -- end from org.neo4j.graphalgo.impl.util.GeoEstimateEvaluator @@ -78,8 +74,7 @@ private double[] getCoordinates(Node node) { public static PathExpander buildPathExpander(String relationshipsAndDirections) { PathExpanderBuilder builder = PathExpanderBuilder.empty(); - for (Pair pair : RelationshipTypeAndDirections - .parse(relationshipsAndDirections)) { + for (Pair pair : RelationshipTypeAndDirections.parse(relationshipsAndDirections)) { if (pair.getLeft() == null) { if (pair.getRight() == null) { builder = PathExpanderBuilder.allTypesAndDirections(); diff --git a/common/src/main/java/apoc/coll/SetBackedList.java b/common/src/main/java/apoc/coll/SetBackedList.java index 6b4556308..43618e1a6 100644 --- a/common/src/main/java/apoc/coll/SetBackedList.java +++ b/common/src/main/java/apoc/coll/SetBackedList.java @@ -42,6 +42,7 @@ public ListIterator listIterator(int index) { Iterator it = set.iterator(); T current = null; int idx = 0; + { moveTo(index); } @@ -66,14 +67,18 @@ public boolean hasPrevious() { public T previous() { if (!hasPrevious()) throw new NoSuchElementException(); T tmp = current; - moveTo(idx-1); + moveTo(idx - 1); return tmp; } private void moveTo(int pos) { Iterator it2 = set.iterator(); T value = null; - int i=0; while (i++ runCypherQuery(Transaction tx, @Name("cypher") String statement, @Name("params") Map params) { + public static Stream runCypherQuery( + Transaction tx, @Name("cypher") String statement, @Name("params") Map params) { if (params == null) params = Collections.emptyMap(); - return tx.execute(withParamMapping(statement, params.keySet()), params).stream().map(MapResult::new); + return tx.execute(withParamMapping(statement, params.keySet()), params).stream() + .map(MapResult::new); } public static String withParamMapping(String fragment, Collection keys) { if (keys.isEmpty()) return fragment; - String declaration = " WITH " + join(", ", keys.stream().map(s -> format(" $`%s` as `%s` ", s, s)).collect(toList())); + String declaration = " WITH " + + join( + ", ", + keys.stream().map(s -> format(" $`%s` as `%s` ", s, s)).collect(toList())); return declaration + fragment; } - } diff --git a/common/src/main/java/apoc/date/DateUtils.java b/common/src/main/java/apoc/date/DateUtils.java index 6d5593d89..e7683afcd 100644 --- a/common/src/main/java/apoc/date/DateUtils.java +++ b/common/src/main/java/apoc/date/DateUtils.java @@ -21,19 +21,35 @@ import java.util.concurrent.TimeUnit; public class DateUtils { - public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss"; + public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static TimeUnit unit(String unit) { if (unit == null) return TimeUnit.MILLISECONDS; switch (unit.toLowerCase()) { - case "ms": case "milli": case "millis": case "milliseconds": return TimeUnit.MILLISECONDS; - case "s": case "second": case "seconds": return TimeUnit.SECONDS; - case "m": case "minute": case "minutes": return TimeUnit.MINUTES; - case "h": case "hour": case "hours": return TimeUnit.HOURS; - case "d": case "day": case "days": return TimeUnit.DAYS; + case "ms": + case "milli": + case "millis": + case "milliseconds": + return TimeUnit.MILLISECONDS; + case "s": + case "second": + case "seconds": + return TimeUnit.SECONDS; + case "m": + case "minute": + case "minutes": + return TimeUnit.MINUTES; + case "h": + case "hour": + case "hours": + return TimeUnit.HOURS; + case "d": + case "day": + case "days": + return TimeUnit.DAYS; } - throw new IllegalArgumentException("The unit: "+ unit + " is not correct"); + throw new IllegalArgumentException("The unit: " + unit + " is not correct"); } } diff --git a/common/src/main/java/apoc/export/cypher/FileManagerFactory.java b/common/src/main/java/apoc/export/cypher/FileManagerFactory.java index 8c937227f..fc37067cd 100644 --- a/common/src/main/java/apoc/export/cypher/FileManagerFactory.java +++ b/common/src/main/java/apoc/export/cypher/FileManagerFactory.java @@ -18,31 +18,30 @@ */ package apoc.export.cypher; -import java.io.OutputStream; +import static apoc.util.FileUtils.getOutputStream; + import apoc.export.util.ExportConfig; import apoc.util.Util; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringUtils; - +import java.io.OutputStream; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; - -import static apoc.util.FileUtils.getOutputStream; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; /** * @author mh * @since 06.12.17 */ public class FileManagerFactory { - private final static String DOT = "."; - + private static final String DOT = "."; + public static ExportFileManager createFileManager(String fileName, boolean separatedFiles) { return createFileManager(fileName, separatedFiles, ExportConfig.EMPTY); } - + public static ExportFileManager createFileManager(String fileName, boolean separatedFiles, ExportConfig config) { if (fileName == null || "".equals(fileName)) { return new StringExportCypherFileManager(separatedFiles, config); @@ -61,7 +60,8 @@ private static class PhysicalExportFileManager implements ExportFileManager { private final Map writerCache; private ExportConfig config; - public PhysicalExportFileManager(String fileType, String fileName, boolean separatedFiles, ExportConfig config) { + public PhysicalExportFileManager( + String fileType, String fileName, boolean separatedFiles, ExportConfig config) { this.fileType = StringUtils.isBlank(fileType) ? "" : fileType; this.fileName = fileName; this.separatedFiles = separatedFiles; @@ -71,7 +71,8 @@ public PhysicalExportFileManager(String fileType, String fileName, boolean separ @Override public PrintWriter getPrintWriter(String type) { - String newFileName = this.separatedFiles ? normalizeFileName(fileName, type) : normalizeFileName(fileName, null); + String newFileName = + this.separatedFiles ? normalizeFileName(fileName, type) : normalizeFileName(fileName, null); return writerCache.computeIfAbsent(newFileName, (key) -> { OutputStream outputStream = getOutputStream(newFileName, config); return outputStream == null ? null : new PrintWriter(outputStream); @@ -87,7 +88,7 @@ private String normalizeFileName(final String fileName, String suffix) { if (StringUtils.isBlank(suffix)) { return fileName; } - // in case of file without dot extension, we just add the suffix + // in case of file without dot extension, we just add the suffix if (StringUtils.isEmpty(fileType)) { return fileName + DOT + suffix; } @@ -142,8 +143,7 @@ public synchronized Object drain(String type) { StringWriter writer = writers.get(type); if (writer != null) { return Util.getStringOrCompressedData(writer, config); - } - else return null; + } else return null; } @Override @@ -151,5 +151,4 @@ public Boolean separatedFiles() { return this.separatedFiles; } } - } diff --git a/common/src/main/java/apoc/export/cypher/formatter/AbstractCypherFormatter.java b/common/src/main/java/apoc/export/cypher/formatter/AbstractCypherFormatter.java index 15899f331..0045831e1 100644 --- a/common/src/main/java/apoc/export/cypher/formatter/AbstractCypherFormatter.java +++ b/common/src/main/java/apoc/export/cypher/formatter/AbstractCypherFormatter.java @@ -18,10 +18,21 @@ */ package apoc.export.cypher.formatter; +import static apoc.export.cypher.formatter.CypherFormatterUtils.Q_UNIQUE_ID_LABEL; +import static apoc.export.cypher.formatter.CypherFormatterUtils.Q_UNIQUE_ID_REL; +import static apoc.export.cypher.formatter.CypherFormatterUtils.UNIQUE_ID_PROP; +import static apoc.export.cypher.formatter.CypherFormatterUtils.simpleKeyValue; + import apoc.export.util.ExportConfig; import apoc.export.util.ExportFormat; import apoc.export.util.Reporter; import apoc.util.Util; +import java.io.PrintWriter; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; import org.apache.commons.lang3.StringUtils; import org.neo4j.graphdb.Direction; import org.neo4j.graphdb.GraphDatabaseService; @@ -30,20 +41,8 @@ import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.RelationshipType; import org.neo4j.graphdb.Transaction; - -import java.io.PrintWriter; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import org.neo4j.graphdb.schema.ConstraintType; -import static apoc.export.cypher.formatter.CypherFormatterUtils.Q_UNIQUE_ID_LABEL; -import static apoc.export.cypher.formatter.CypherFormatterUtils.Q_UNIQUE_ID_REL; -import static apoc.export.cypher.formatter.CypherFormatterUtils.UNIQUE_ID_PROP; -import static apoc.export.cypher.formatter.CypherFormatterUtils.simpleKeyValue; - /** * @author AgileLARUS * @@ -51,552 +50,625 @@ */ abstract class AbstractCypherFormatter implements CypherFormatter { - private static final String STATEMENT_CONSTRAINTS = "CREATE CONSTRAINT %s%s FOR (node:%s) REQUIRE (%s) %s;"; - private static final String STATEMENT_CONSTRAINTS_REL = "CREATE CONSTRAINT %s%s FOR ()-[rel:%s]-() REQUIRE (%s) %s;"; - private static final String STATEMENT_DROP_CONSTRAINTS = "DROP CONSTRAINT %s;"; - - private static final String STATEMENT_NODE_FULLTEXT_IDX = "CREATE FULLTEXT INDEX %s FOR (n:%s) ON EACH [%s];"; - private static final String STATEMENT_REL_FULLTEXT_IDX = "CREATE FULLTEXT INDEX %s FOR ()-[rel:%s]-() ON EACH [%s];"; - public static final String PROPERTY_QUOTING_FORMAT = "%s.`%s`"; - private static final String ID_REL_KEY = "id"; - - @Override - public String statementForCleanUp(int batchSize) { - return "MATCH (n:" + Q_UNIQUE_ID_LABEL + ") " + - " WITH n LIMIT " + batchSize + - " REMOVE n:" + Q_UNIQUE_ID_LABEL + " REMOVE n." + Util.quote(UNIQUE_ID_PROP) + ";"; - } - - @Override - public String statementForNodeIndex(String indexType, String label, Iterable keys, boolean ifNotExists, String idxName) { - return String.format("CREATE %s INDEX%s%s FOR (n:%s) ON (%s);", - indexType, idxName, getIfNotExists(ifNotExists), Util.quote(label), getPropertiesQuoted(keys, "n.")); - } - - @Override - public String statementForIndexRelationship(String indexType, String type, Iterable keys, boolean ifNotExists, String idxName) { - return String.format("CREATE %s INDEX%s%s FOR ()-[rel:%s]-() ON (%s);", - indexType, idxName, getIfNotExists(ifNotExists), Util.quote(type), getPropertiesQuoted(keys, "rel.")); - } - - @Override - public String statementForNodeFullTextIndex(String name, Iterable