salman_walmart
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
await flightLegT
.fold()
.coalesce(
.unfold(),
.mergeV(
new Map([
[t.id, shellFlightLegId], // ID should be string
[t.label, 'flight'] // Label should be string
])
)
.option(
merge.onCreate,
new Map([
['purgeDate', poflVertexAttrs.purgeDate], // Ensure this is of the correct type
['flightNumber', flightLegKey.flightNumber.toString()], // Ensure this is a string
['instanceNumber', flightLegInstanceNumber], // Ensure this is of the correct type
['flightSuffix', flightLegSuffix], // Ensure this is a string
['creationTimestamp', Date.now()], // Date.now() returns a number
['carrierCode', flightLegKey.carrierCode], // Ensure this is a string
['isShellFlight', true] // Boolean value
])
)
)
.project('v', 'status')
.by()
.by(.choose(.hasLabel('flight'), .constant('merged'), .constant('created')))
.next();
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
This is how attempted to change to mergeV but it doesnt work due to type issues
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
Hi @spmallette this query worked but when I put my code in production I am getting ton of {"detailedMessage":"Failed to complete operation due to conflicting concurrent operations. Please retry. 0 transactions are currently rolling back.","code":"ConcurrentModificationException","requestId":"15c91b13-772f-4a98-a7fa-35630de30679","message":"Failed to complete operation due to conflicting concurrent operations. Please retry. 0 transactions are currently rolling back."} (500)" which is causing issues in my lambda. I have heard that changing coalesce/addV to mergeV might prevent this, is it true, I almost changed to mergeV and mergeE everywhere except this particular code where I am unable to do it
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
sure Thanks I will try that @spmallette
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
yes pretty much and later I would build an alert on that log, I am just trying to log that shell flight was created with ${vertexID}
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
hey @Dave do you suggest using next() and then putting check whether we get data in the middle of a non blocking transaction, could you please give me details of it
16 replies
ATApache TinkerPop
•Created by salman_walmart on 8/12/2024 in #questions
logging and alerting inside a gremlin step
yeah this is really a typescript lambda and I wanted to log and alert , that a database search for a flight didnt give me a result, so I am creating a shell flight in DB and want to alert and log it in a single step asynchronously, without adding an extra blocking DB call(this is all a part of a bigger gremlin transaction gtx). Database we use is AWS Neptune. I tried several ways to log and alert it using different steps but couldn't do it. However, if I use __.fail('No data found') it prints the logs and works fine, but I dont want to do failure, I want to add the dummy record(shell flight) and log it.
16 replies
ATApache TinkerPop
•Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
In my application I am connecting to aws Neptune from my flink/java apps and reading/writing data from/into Neptune using gremlin/java I wanted to have Integration tests for the same
7 replies
ATApache TinkerPop
•Created by salman_walmart on 1/3/2024 in #questions
Integration tests for AWS Neptune DB
Hi @spmallette @Kennh thanks for your response., yes I would run these integration tests every commit, which will spin up the graph server and allow me to test my gremlin queries in my application as a part of my gradle build , something like this https://java.testcontainers.org/modules/databases/mongodb/ or may be some docker image for neptune/tinkerGraph
7 replies