diff --git a/janusgraph-server/src/test/java/org/janusgraph/graphdb/tinkerpop/JanusGraphSerializerBaseIT.java b/janusgraph-server/src/test/java/org/janusgraph/graphdb/tinkerpop/JanusGraphSerializerBaseIT.java index 2c45cbce52..c2a1a6e789 100644 --- a/janusgraph-server/src/test/java/org/janusgraph/graphdb/tinkerpop/JanusGraphSerializerBaseIT.java +++ b/janusgraph-server/src/test/java/org/janusgraph/graphdb/tinkerpop/JanusGraphSerializerBaseIT.java @@ -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; @@ -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 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) { diff --git a/janusgraph-server/src/test/resources/janusgraph-server-with-serializers.yaml b/janusgraph-server/src/test/resources/janusgraph-server-with-serializers.yaml index 9a105a8b8e..d7467a2baa 100644 --- a/janusgraph-server/src/test/resources/janusgraph-server-with-serializers.yaml +++ b/janusgraph-server/src/test/resources/janusgraph-server-with-serializers.yaml @@ -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] }} @@ -46,7 +46,7 @@ metrics: { maxInitialLineLength: 4096 maxHeaderSize: 8192 maxChunkSize: 8192 -maxContentLength: 65536 +maxContentLength: 25000000 maxAccumulationBufferComponents: 1024 resultIterationBatchSize: 64 writeBufferLowWaterMark: 32768