Skip to content

Commit

Permalink
neptune add support for 3.7 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutierMat authored May 28, 2024
1 parent 4e22844 commit d4531b1
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 9 deletions.
1 change: 1 addition & 0 deletions neptune-tinkerpop/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.class
target/
*.kryo
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>3.4.13</version>
<version>3.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>3.4.13</version>
<version>3.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-test</artifactId>
<version>3.4.13</version>
<version>3.7.2</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.Compare;
import org.apache.tinkerpop.gremlin.process.traversal.Contains;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.T;
Expand Down Expand Up @@ -98,7 +99,7 @@ protected boolean testLabel(final Element element) {

// add comparison predicates to support the multi-label syntax `label1::label2::label3`

class LabelEquals implements BiPredicate<String, String> {
class LabelEquals implements PBiPredicate<String, String> {
public boolean test(String label, String otherLabel) {
if (label == null) return false;
for (String partialLabel: label.split(LABEL_DELIMITER)) {
Expand All @@ -110,7 +111,7 @@ public boolean test(String label, String otherLabel) {
}
}

class LabelWithin implements BiPredicate<String, List<String>> {
class LabelWithin implements PBiPredicate<String, List<String>> {
public boolean test(String label, List<String> labels) {
if (label == null) return false;
for (String partialLabel: label.split(LABEL_DELIMITER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.tinkergraph;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration2.Configuration;
import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.TestHelper;
Expand Down
2 changes: 1 addition & 1 deletion neptune-tinkerpop/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

runDir=$(pwd)

versions=("3.4.13" "3.6.2")
versions=("3.6.2" "3.7.2")
for version in "${versions[@]}"; do
(
cd $version
Expand Down
Binary file removed neptune-tinkerpop/gremlin-core-3.4.13-patches.zip
Binary file not shown.
Binary file modified neptune-tinkerpop/gremlin-core-3.6.2-patches.zip
Binary file not shown.
Binary file added neptune-tinkerpop/gremlin-core-3.7.2-patches.zip
Binary file not shown.
16 changes: 16 additions & 0 deletions tinkerpop-id-manager/3.6/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
java
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.apache.tinkerpop:tinkergraph-gremlin:3.6.2")
}

tasks.jar {
archiveFileName.set("${rootProject.name}.jar")
destinationDirectory.set(rootDir)
}
16 changes: 16 additions & 0 deletions tinkerpop-id-manager/3.7/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
java
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.apache.tinkerpop:tinkergraph-gremlin:3.7.2")
}

tasks.jar {
archiveFileName.set("${rootProject.name}-37.jar")
destinationDirectory.set(rootDir)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cloud.localstack;


import org.apache.tinkerpop.gremlin.tinkergraph.structure.AbstractTinkerGraph;

import java.util.UUID;

public class UUIDAnyIdManager implements AbstractTinkerGraph.IdManager<String> {
@Override
public String getNextId(final AbstractTinkerGraph graph) {
return UUID.randomUUID().toString();
}

@Override
public String convert(final Object id) {
if (null == id) {
return null;
}
if (!(id instanceof String)) {
throw new IllegalArgumentException(String.format("Expected an id that is String but received %s - [%s]", id.getClass(), id));
}
return (String) id;
}

@Override
public boolean allow(final Object id) {
return id instanceof String;
}
}
1 change: 0 additions & 1 deletion tinkerpop-id-manager/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repositories {
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
implementation("org.apache.tinkerpop:tinkergraph-gremlin:3.4.10")
}

tasks.getByName<Test>("test") {
Expand Down
2 changes: 2 additions & 0 deletions tinkerpop-id-manager/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
*/

rootProject.name = "tinkerpop-id-manager"

include("3.6", "3.7")
Binary file added tinkerpop-id-manager/tinkerpop-id-manager-37.jar
Binary file not shown.
Binary file modified tinkerpop-id-manager/tinkerpop-id-manager.jar
Binary file not shown.

0 comments on commit d4531b1

Please sign in to comment.