Painguin | Tiến
Painguin | Tiến
Explore posts from servers
ATApache TinkerPop
Created by Painguin | Tiến on 5/8/2024 in #questions
`next(n)` with Gremlin JavaScript
No description
17 replies
ATApache TinkerPop
Created by Painguin | Tiến on 5/4/2024 in #questions
TraversalInterruptionTest taking a very long time to complete
There's a try & sleep step in these tests: https://github.com/tien/tinkerpop/blob/a919b90ebe31434e306609a2d2a37702eead02d7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java#L86 https://github.com/tien/tinkerpop/blob/a919b90ebe31434e306609a2d2a37702eead02d7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionComputerTest.java#L78 Which caused the last test case outlined below to take a very long time to complete (several hours to complete on CI) Testcase:
{"g_E_properties", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E().properties()},
{"g_E_properties", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E().properties()},
The test appear to also work when I remove the try->sleep & run it locally. Can this be removed? It's right now causing Janusgraph CI to take several hours to complete tests for every DB adapter. cc @spmallette
37 replies
ATApache TinkerPop
Created by Painguin | Tiến on 5/3/2024 in #questions
Running Tinkerpop test in Janusgraph repo
Hi I'm trying to run the below Tinkerpop test to test out some of the changes I've made to Janusgraph. By copying the test over from Tinkerpop repo into Janusgraph repo (just for testing one test).
@RunWith(Parameterized.class)
public class TraversalInterruptionTest extends AbstractGremlinProcessTest {
private static final Logger logger = LoggerFactory.getLogger(TraversalInterruptionTest.class);

@Parameterized.Parameters(name = "expectInterruption({0})")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
// ...
});
}

@Parameterized.Parameter(value = 0)
public String name;

@Parameterized.Parameter(value = 1)
public Function<GraphTraversalSource,GraphTraversal<?,?>> traversalBeforePause;

@Parameterized.Parameter(value = 2)
public UnaryOperator<GraphTraversal<?,?>> traversalAfterPause;

@Test
@LoadGraphWith(GRATEFUL)
public void shouldRespectThreadInterruptionInVertexStep() throws Exception {
// ...
}
}
@RunWith(Parameterized.class)
public class TraversalInterruptionTest extends AbstractGremlinProcessTest {
private static final Logger logger = LoggerFactory.getLogger(TraversalInterruptionTest.class);

@Parameterized.Parameters(name = "expectInterruption({0})")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
// ...
});
}

@Parameterized.Parameter(value = 0)
public String name;

@Parameterized.Parameter(value = 1)
public Function<GraphTraversalSource,GraphTraversal<?,?>> traversalBeforePause;

@Parameterized.Parameter(value = 2)
public UnaryOperator<GraphTraversal<?,?>> traversalAfterPause;

@Test
@LoadGraphWith(GRATEFUL)
public void shouldRespectThreadInterruptionInVertexStep() throws Exception {
// ...
}
}
But I'm getting
java.lang.NullPointerException: Cannot invoke "org.apache.tinkerpop.gremlin.GraphProvider.getStaticFeatures()" because "this.innerGraphProvider" is null
java.lang.NullPointerException: Cannot invoke "org.apache.tinkerpop.gremlin.GraphProvider.getStaticFeatures()" because "this.innerGraphProvider" is null
I need to be able to inject the graph implementation into this test somehow? How can I do that? Thank you.
11 replies
JJanusGraph
Created by Painguin | Tiến on 4/29/2024 in #questions
Server can't be started due to `lost+found` folder
I'm running JanusGraph as a docker container with a mounted volume at /var/lib/janusgraph. Experiencing this issue after restarting the container:
chown: cannot read directory '/var/lib/janusgraph/lost+found': Permission denied
chown: cannot read directory '/var/lib/janusgraph/lost+found': Permission denied
Look like it was created by the linux file system with root only permission. Why does JanusGraph need to read this dir in order to start? Can we have it ignore it instead?
4 replies
ATApache TinkerPop
Created by Painguin | Tiến on 4/24/2024 in #questions
Query optimisation
Hey, I'm optimising some queries, and found that these 2 seemingly identical queries behave very differently in term of performance
g.V().
union(
has("account", "id", "my_account"),
has("account", "id", "my_account").
out("owns")).
union(
out("completed").values("points"),
inE("rewarded").has("claimed", true).values("points")).
sum().
next()
g.V().
union(
has("account", "id", "my_account"),
has("account", "id", "my_account").
out("owns")).
union(
out("completed").values("points"),
inE("rewarded").has("claimed", true).values("points")).
sum().
next()
vs
g.V().
has("account", "id", "my_account").
union(identity(), out("owns")).
union(
out("completed").values("points"),
inE("rewarded").has("claimed", true).values("points")).
sum().
next()
g.V().
has("account", "id", "my_account").
union(identity(), out("owns")).
union(
out("completed").values("points"),
inE("rewarded").has("claimed", true).values("points")).
sum().
next()
The 2nd query performed about 10 times faster than the first. Can anyone with experience let me know what's the different for the 2? And what I should watch out for to avoid bad performing query like the first one? Thank you.
12 replies
JJanusGraph
Created by Painguin | Tiến on 4/24/2024 in #questions
Could not start BerkeleyJE transaction
Hey I've just encounter this issue and needed to restart the entire server for it to go away. I believe it's the issue being described here https://github.com/JanusGraph/janusgraph/issues/2120
28 replies
CDCloudflare Developers
Created by Painguin | Tiến on 4/9/2024 in #general-help
Dashboard authentication error 1001
No description
8 replies
CDCloudflare Developers
Created by Painguin | Tiến on 4/8/2024 in #workers-help
Worker calling it self
Hey what is the best way for a worker to call it self as of now? I'm doing this to get over the 1000k sub-requests limit per request.
5 replies
JJanusGraph
Created by Painguin | Tiến on 3/22/2024 in #questions
Custom ID best practice
Hey I'm looking into using custom ID for my DB vertices & came across this: https://github.com/JanusGraph/janusgraph/issues/1221#issuecomment-938060054 Where there is a mention of potentially moving to use UUID internally. Can I ask what's the overall consensus/traction on this? And does this mean it's preferable for new graphs to use custom id with UUID now? Thank you.
8 replies
JJanusGraph
Created by Painguin | Tiến on 3/6/2024 in #questions
Indexing on vertex label
Hi, I was under the assumption that vertex label are indexed by default. But this doesn't seems to be the case. I also can't to find a way to index label from consulting the documentation. Is this not possible? And if so what is the reason for this? Thank you.
10 replies
ATApache TinkerPop
Created by Painguin | Tiến on 3/4/2024 in #questions
Concurrent queries to authentication required sever resulted in 401 error
Hey guys, playing around with gremlin & encountered this very odd error where concurrent queries will break authentication:
import gremlin from "gremlin";

const g = gremlin.process.AnonymousTraversalSource.traversal().withRemote(
new gremlin.driver.DriverRemoteConnection("ws://localhost:8182/gremlin", {
authenticator: new gremlin.driver.auth.PlainTextSaslAuthenticator(
"admin",
"administrator"
),
})
);

// This will throws: Failed to authenticate (401)
await Promise.all([g.V().toList(), g.V().toList()]);

// This works as expected
await g.V().toList();
await g.V().toList();
import gremlin from "gremlin";

const g = gremlin.process.AnonymousTraversalSource.traversal().withRemote(
new gremlin.driver.DriverRemoteConnection("ws://localhost:8182/gremlin", {
authenticator: new gremlin.driver.auth.PlainTextSaslAuthenticator(
"admin",
"administrator"
),
})
);

// This will throws: Failed to authenticate (401)
await Promise.all([g.V().toList(), g.V().toList()]);

// This works as expected
await g.V().toList();
await g.V().toList();
12 replies
CDCloudflare Developers
Created by Painguin | Tiến on 3/1/2024 in #workers-help
Web socket 404 error when deployed
Hey noob question, but I'm getting 404 or 520 error when trying to establish a web socket connection from Cloudflare Worker. This only happen when the worker is deployed & not locally. Is this an issue with the origin server blocking connection from Cloudflare network? The origin server is fly.io btw, and I've also posted a support thread there: https://community.fly.io/t/websocket-connection-cant-be-established-from-cloudflare-worker/18489
5 replies
ATApache TinkerPop
Created by Painguin | Tiến on 2/26/2024 in #questions
Returned vertex properties (JS client)
Hi, I've got a question regarding the returned vertex value when using the JS client. How come non-array properties are parsed & returned as an array of length 1, as seen in the example below? Thank you.
{
"id": 4104,
"label": "account",
"properties": {
"createdAt": [
{
"id": { "relationId": "16p-360-1l1" },
"label": "createdAt",
"value": "2024-02-26T22:06:11.873Z",
"key": "createdAt"
}
],
"address": [
{
"id": { "relationId": "1kx-360-2dh" },
"label": "address",
"value": "some_address",
"key": "address"
}
]
}
}
{
"id": 4104,
"label": "account",
"properties": {
"createdAt": [
{
"id": { "relationId": "16p-360-1l1" },
"label": "createdAt",
"value": "2024-02-26T22:06:11.873Z",
"key": "createdAt"
}
],
"address": [
{
"id": { "relationId": "1kx-360-2dh" },
"label": "address",
"value": "some_address",
"key": "address"
}
]
}
}
5 replies
CDCloudflare Developers
Created by Painguin | Tiến on 2/23/2024 in #workers-help
KV calls limit from worker
Hi, I'm reaching the limit of 1000 KV call per worker requests, right now my request will do about 2000 calls. I can reduce the number of calls down to a near 1000+ by using bulk read, but there isn't seems to be any options for bulk writing? I've also submit a form asking to raise the limit, but I don't know what the criteria for that or how ez it's to get. Thank you
4 replies