Skip to content

Commit 77f9b0f

Browse files
committed
* Added GremlinLang to go driver to replace Bytecode. Clean up and updates will be needed when connection is set up.
* update graph binary serializer to 4.0.0 spec * Updated datetime, added GValue, updated Options strategy, removed unneeded strategy package name, added NewTraversalStrategy to allow custom strategies. (#3056) * Replace websockets with http. Changed connection pooling to be delegated to aio http library. Added POC changes to request serialization just to make happy path work. Full connection configuration and response chunking not yet implemented. (#3057) * update gremlinlang to use slices to store instructions instead * update strategies test after gremlinlang change * update serializer to use marker * fix strategies translation and add missing strategies * Remove result set map container as it is no longer needed. * Removed concept of session as it is no longer needed. * Read response status code from graph binary response. * Removed response status attributes as they no longer exist. * Read response status message and exception strings. * Remove gremlin-socket-server from docker compose. * Removed socket server tests. * Changed transporter to delegate most of the request creation to client library by using http.NewRequest. Removed requestId as it's no longer used. Made some small logging changes. * Removed unused request op attribute. * Removed unused request processor. * Added some comments, refactored error handling and resource closing. * Removed reference to partial content status code. Added some comments and did some minor cleanup. * Removed reference to response metadata. * Removed unused synchronized mpa. * Removed tests for custom type serialization. Removed response id as it is no longer used. Adjusted expected serialized request bytes according to TP4 format. Adjusted bytes for testing deserialization according to TP4 format. Removed serializer unwrapping of single item results as it was causing serialization test to fail. (#3066) fix various gremlinlang and serializer bugs in go for http
1 parent d4f0356 commit 77f9b0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2167
-2653
lines changed

.github/workflows/build-test.yml

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -354,40 +354,28 @@ jobs:
354354
run: |
355355
mvn clean install -pl $EXCLUDE_MODULES -q -DskipTests -Dci
356356
mvn verify -pl :neo4j-gremlin -DincludeNeo4j
357-
# go:
358-
# name: go
359-
# timeout-minutes: 20
360-
# needs: cache-gremlin-server-docker-image
361-
# runs-on: ubuntu-latest
362-
# steps:
363-
# - name: Checkout
364-
# uses: actions/checkout@v5
365-
# - name: Setup Go
366-
# uses: actions/setup-go@v5
367-
# with:
368-
# go-version: '1.25'
369-
# - name: Get Cached Server Base Image
370-
# uses: actions/cache@v4
371-
# id: gremlin-server-test-docker-image
372-
# with:
373-
# path: |
374-
# ./gremlin-server/*
375-
# ~/.m2/repository/org/apache/tinkerpop/*
376-
# key: ${{ github.sha }}
377-
# - name: Load Docker Image
378-
# working-directory: ./gremlin-server
379-
# run: docker load --input gremlin-server.tar
380-
# - name: Build with Maven
381-
# working-directory: .
382-
# run: |
383-
# touch gremlin-go/.glv
384-
# EXCLUDE="${EXCLUDE_MODULES/,-:gremlin-python},$EXCLUDE_FOR_GLV"
385-
# mvn clean install -pl $EXCLUDE -q -DskipTests -Dci
386-
# mvn verify -pl :gremlin-go
387-
# - name: Upload to Codecov
388-
# uses: codecov/codecov-action@v5
389-
# with:
390-
# working-directory: ./gremlin-go
391-
# - name: Go-Vet
392-
# working-directory: ./gremlin-go
393-
# run: go vet ./...
357+
go:
358+
name: go
359+
timeout-minutes: 20
360+
needs: cache-gremlin-server-docker-image
361+
runs-on: ubuntu-latest
362+
steps:
363+
- uses: actions/checkout@v5
364+
- name: Setup Go
365+
uses: actions/setup-go@v5
366+
with:
367+
go-version: '1.25'
368+
- name: Build with Maven
369+
working-directory: .
370+
run: |
371+
touch gremlin-go/.glv
372+
EXCLUDE="${EXCLUDE_MODULES/,-:gremlin-python},$EXCLUDE_FOR_GLV"
373+
mvn clean install -pl $EXCLUDE -q -DskipTests -Dci
374+
mvn verify -pl :gremlin-go
375+
- name: Upload to Codecov
376+
uses: codecov/codecov-action@v5
377+
with:
378+
working-directory: ./gremlin-go
379+
- name: Go-Vet
380+
working-directory: ./gremlin-go
381+
run: go vet ./...

gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.antlr.v4.runtime.tree.TerminalNode;
2424
import org.apache.commons.lang3.StringUtils;
2525
import org.apache.tinkerpop.gremlin.language.grammar.GremlinParser;
26+
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
2627
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy;
2728
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
2829
import org.apache.tinkerpop.gremlin.util.DatetimeHelper;
@@ -41,7 +42,8 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor {
4142
private final static List<String> STRATEGY_WITH_MAP_OPTS = Collections.unmodifiableList(Arrays.asList(
4243
"OptionsStrategy",
4344
"ReferenceElementStrategy", "ComputerFinalizationStrategy", "ProfileStrategy",
44-
"ComputerVerificationStrategy", "StandardVerificationStrategy", "VertexProgramRestrictionStrategy"));
45+
"ComputerVerificationStrategy", "StandardVerificationStrategy", "VertexProgramRestrictionStrategy",
46+
"MessagePassingReductionStrategy"));
4547
private final static List<String> STRATEGY_WITH_STRING_SLICE = Collections.unmodifiableList(Arrays.asList(
4648
"ReservedKeysVerificationStrategy", "ProductiveByStrategy"));
4749

gremlin-go/build/generate.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ radishGremlinFile.withWriter('UTF-8') { Writer writer ->
121121
' traversalFn := traversalFns[0]\n' +
122122
' translationMap[scenarioName] = traversalFns[1:]\n' +
123123
' traversal := traversalFn(g, parameters)\n' +
124-
' for key, value := range sideEffects {\n' +
125-
' traversal.Bytecode.AddSource("withSideEffect", key, value)\n' +
126-
' }\n' +
127124
' return traversal, nil\n' +
128125
' } else {\n' +
129126
' return nil, errors.New("scenario for traversal not recognized")\n' +

gremlin-go/driver/anonymousTraversal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ type anonymousTraversal struct {
337337

338338
var T__ AnonymousTraversal = &anonymousTraversal{
339339
func() *GraphTraversal {
340-
return NewGraphTraversal(nil, NewBytecode(nil), nil)
340+
return NewGraphTraversal(nil, NewGremlinLang(nil), nil)
341341
},
342342
}
343343

gremlin-go/driver/authInfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (d *DynamicAuth) GetHeader() http.Header {
8989
return d.fn().GetHeader()
9090
}
9191

92-
// GetHeader calls the stored function to get basic authentication dynamically.
92+
// GetBasicAuth calls the stored function to get basic authentication dynamically.
9393
func (d *DynamicAuth) GetBasicAuth() (bool, string, string) {
9494
return d.fn().GetBasicAuth()
9595
}

gremlin-go/driver/bytecode.go

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)