Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large String Writes #4260

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.janusgraph.graphdb.tinkerpop;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.T;
Expand Down Expand Up @@ -70,6 +71,21 @@ public void testPropertiesWriteAndRead(boolean useCustomId) {
assertEquals(4, g.V().properties().toList().size());
}

@ParameterizedTest
@ValueSource(ints = {500, 1_000, 1_000_000, 10_000_000, 20_000_000, 21_000_000})
public void testWriteLargeString(int stringLength) throws Exception {
setUp(false);
try (GraphTraversalSource g = traversal()) {
GraphTraversal<Vertex, Vertex> t = g.addV("largeStringTestLabel");
String largeStringPropertyKey = "largeString";
String largeStringValue = RandomStringUtils.random(stringLength, 'a', 'b', 'c', 'd', 'e', 'f');
Vertex initialVertex = t.property(largeStringPropertyKey, largeStringValue).next();

Vertex recalledVertex = g.V().hasLabel("largeStringTestLabel").has(largeStringPropertyKey, largeStringValue).next();
assertEquals(initialVertex.id(), recalledVertex.id());
}
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testGeoshapePointsWriteAndRead(boolean useCustomId, TestInfo testInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ scriptEngines: {
serializers:
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry], maxStringLength: 25000000 }}
# Older serialization versions for backwards compatibility:
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV1, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
Expand All @@ -46,7 +46,7 @@ metrics: {
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxContentLength: 25000000
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
Expand Down
Loading