Skip to content
Merged
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
35 changes: 17 additions & 18 deletions bolt/src/test/java/com/arcadedb/bolt/BoltChunkedIOTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -35,7 +34,7 @@ class BoltChunkedIOTest {
// ============ BoltChunkedOutput tests ============

@Test
void writeEmptyMessage() throws IOException {
void writeEmptyMessage() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand All @@ -49,7 +48,7 @@ void writeEmptyMessage() throws IOException {
}

@Test
void writeSmallMessage() throws IOException {
void writeSmallMessage() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand All @@ -74,7 +73,7 @@ void writeSmallMessage() throws IOException {
}

@Test
void writeMessageExactlyMaxChunkSize() throws IOException {
void writeMessageExactlyMaxChunkSize() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand All @@ -92,7 +91,7 @@ void writeMessageExactlyMaxChunkSize() throws IOException {
}

@Test
void writeMessageLargerThanMaxChunkSize() throws IOException {
void writeMessageLargerThanMaxChunkSize() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand Down Expand Up @@ -122,7 +121,7 @@ void writeMessageLargerThanMaxChunkSize() throws IOException {
}

@Test
void writeRawBytes() throws IOException {
void writeRawBytes() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand All @@ -133,7 +132,7 @@ void writeRawBytes() throws IOException {
}

@Test
void writeRawInt() throws IOException {
void writeRawInt() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final BoltChunkedOutput output = new BoltChunkedOutput(baos);

Expand All @@ -150,7 +149,7 @@ void writeRawInt() throws IOException {
// ============ BoltChunkedInput tests ============

@Test
void readEmptyMessage() throws IOException {
void readEmptyMessage() throws Exception {
// Just end marker
final byte[] input = { 0x00, 0x00 };
final BoltChunkedInput chunkedInput = new BoltChunkedInput(new ByteArrayInputStream(input));
Expand All @@ -160,7 +159,7 @@ void readEmptyMessage() throws IOException {
}

@Test
void readSmallMessage() throws IOException {
void readSmallMessage() throws Exception {
// Size (5) + data + end marker
final byte[] input = {
0x00, 0x05, // chunk size = 5
Expand All @@ -174,7 +173,7 @@ void readSmallMessage() throws IOException {
}

@Test
void readMultiChunkMessage() throws IOException {
void readMultiChunkMessage() throws Exception {
// Two chunks: 3 bytes + 2 bytes
final byte[] input = {
0x00, 0x03, // first chunk size = 3
Expand All @@ -190,7 +189,7 @@ void readMultiChunkMessage() throws IOException {
}

@Test
void readRawBytes() throws IOException {
void readRawBytes() throws Exception {
final byte[] input = { 0x60, 0x60, (byte) 0xB0, 0x17, 0x00, 0x00 };
final BoltChunkedInput chunkedInput = new BoltChunkedInput(new ByteArrayInputStream(input));

Expand All @@ -199,7 +198,7 @@ void readRawBytes() throws IOException {
}

@Test
void readRawInt() throws IOException {
void readRawInt() throws Exception {
final byte[] input = { 0x00, 0x00, 0x01, 0x04 };
final BoltChunkedInput chunkedInput = new BoltChunkedInput(new ByteArrayInputStream(input));

Expand All @@ -208,7 +207,7 @@ void readRawInt() throws IOException {
}

@Test
void readRawShort() throws IOException {
void readRawShort() throws Exception {
final byte[] input = { 0x00, 0x05 };
final BoltChunkedInput chunkedInput = new BoltChunkedInput(new ByteArrayInputStream(input));

Expand All @@ -217,7 +216,7 @@ void readRawShort() throws IOException {
}

@Test
void readLargeChunkSize() throws IOException {
void readLargeChunkSize() throws Exception {
// Chunk size 0xFFFF (65535)
final byte[] input = new byte[65535 + 4]; // size header + data + end marker
input[0] = (byte) 0xFF;
Expand All @@ -235,7 +234,7 @@ void readLargeChunkSize() throws IOException {
}

@Test
void available() throws IOException {
void available() throws Exception {
final byte[] input = { 0x01, 0x02, 0x03 };
final BoltChunkedInput chunkedInput = new BoltChunkedInput(new ByteArrayInputStream(input));

Expand All @@ -245,7 +244,7 @@ void available() throws IOException {
// ============ Round-trip tests ============

@Test
void roundTripSmallMessage() throws IOException {
void roundTripSmallMessage() throws Exception {
final byte[] originalMessage = { 0x01, 0x02, 0x03, 0x04, 0x05 };

// Write
Expand All @@ -261,7 +260,7 @@ void roundTripSmallMessage() throws IOException {
}

@Test
void roundTripLargeMessage() throws IOException {
void roundTripLargeMessage() throws Exception {
// Message larger than max chunk size
final byte[] originalMessage = new byte[100000];
for (int i = 0; i < originalMessage.length; i++) {
Expand All @@ -281,7 +280,7 @@ void roundTripLargeMessage() throws IOException {
}

@Test
void roundTripEmptyMessage() throws IOException {
void roundTripEmptyMessage() throws Exception {
final byte[] originalMessage = new byte[0];

// Write
Expand Down
22 changes: 12 additions & 10 deletions console/src/test/java/com/arcadedb/console/ConsoleBatchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ void okSqlCreationIfNotExists() throws Exception {
@Test
void okBatchMultiLine() throws Exception {
Console.execute(new String[] { "-b",
"create database console;" +
"create vertex type Batchtest;" +
"create vertex Batchtest set id = 1;" +
"create vertex Batchtest set id = 2;" +
"create vertex Batchtest set id = 3;" +
"LET x=SELECT FROM Batchtest;" +
"if($x.size()>0){ \n" +
" return true; \n" +
"} \n" +
"return false;" });
"""
create database console;\
create vertex type Batchtest;\
create vertex Batchtest set id = 1;\
create vertex Batchtest set id = 2;\
create vertex Batchtest set id = 3;\
LET x=SELECT FROM Batchtest;\
if($x.size()>0){\s
return true;\s
}\s
return false;\
""" });

final Database db = new DatabaseFactory("./target/databases/console").open();
assertThat(db.getSchema().existsType("Batchtest")).isTrue();
Expand Down
16 changes: 0 additions & 16 deletions e2e-perf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@
<name>ArcadeDB performance tests</name>
<packaging>jar</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
17 changes: 0 additions & 17 deletions e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,6 @@
<packaging>jar</packaging>
<name>ArcadeDB End-to-End Tests</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
68 changes: 39 additions & 29 deletions engine/src/main/java/com/arcadedb/GlobalConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ public Object call(final Object value) {
Integer.class, 300),

SQL_PARSER_IMPLEMENTATION("arcadedb.sql.parserImplementation", SCOPE.DATABASE,
"SQL parser implementation to use. 'antlr' (default) uses the new ANTLR4-based parser with improved error messages. " +
"'javacc' uses the legacy JavaCC-based parser for backward compatibility.",
"""
SQL parser implementation to use. 'antlr' (default) uses the new ANTLR4-based parser with improved error messages. \
'javacc' uses the legacy JavaCC-based parser for backward compatibility.""",
String.class, "antlr", Set.of("antlr", "javacc")),

// OPENCYPHER
Expand All @@ -270,18 +271,21 @@ public Object call(final Object value) {
"Maximum number of OpenCypher execution plans to keep in cache (frequency-based eviction)", Integer.class, 300),

OPENCYPHER_BULK_CREATE_BATCH_SIZE("arcadedb.opencypher.bulkCreateBatchSize", SCOPE.DATABASE,
"Batch size for bulk CREATE operations. When a CREATE follows an UNWIND producing multiple rows, records are accumulated and created in batches to reduce transaction overhead. " +
"Higher values improve performance but consume more memory. Default: 20000. Recommended range: 10000-100000. Set to 0 to disable batching.",
"""
Batch size for bulk CREATE operations. When a CREATE follows an UNWIND producing multiple rows, records are accumulated and created in batches to reduce transaction overhead. \
Higher values improve performance but consume more memory. Default: 20000. Recommended range: 10000-100000. Set to 0 to disable batching.""",
Integer.class, 20_000),

OPENCYPHER_LOAD_CSV_ALLOW_FILE_URLS("arcadedb.opencypher.loadCsv.allowFileUrls", SCOPE.DATABASE,
"Allow LOAD CSV to access local files via file:/// URLs and bare file paths. "
+ "Disable for security in multi-tenant server deployments.",
"""
Allow LOAD CSV to access local files via file:/// URLs and bare file paths. \
Disable for security in multi-tenant server deployments.""",
Boolean.class, true),

OPENCYPHER_LOAD_CSV_IMPORT_DIRECTORY("arcadedb.opencypher.loadCsv.importDirectory", SCOPE.DATABASE,
"Root directory for LOAD CSV file:/// URLs. When set, file paths are resolved relative to this "
+ "directory and path traversal (../) is blocked. Empty string means no restriction.",
"""
Root directory for LOAD CSV file:/// URLs. When set, file paths are resolved relative to this \
directory and path traversal (../) is blocked. Empty string means no restriction.""",
String.class, ""),

// COMMAND
Expand All @@ -292,9 +296,10 @@ public Object call(final Object value) {
Integer.class, 100),

GREMLIN_ENGINE("arcadedb.gremlin.engine", SCOPE.DATABASE,
"Gremlin engine to use. 'java' (default, secure) uses the native Gremlin parser - recommended for production. " +
"'groovy' enables the legacy Groovy engine with security restrictions (use only if needed for compatibility). " +
"'auto' attempts Java first, falls back to Groovy if needed (not recommended for security-critical deployments).",
"""
Gremlin engine to use. 'java' (default, secure) uses the native Gremlin parser - recommended for production. \
'groovy' enables the legacy Groovy engine with security restrictions (use only if needed for compatibility). \
'auto' attempts Java first, falls back to Groovy if needed (not recommended for security-critical deployments).""",
String.class, "java", Set.of("auto", "groovy", "java")),

/**
Expand All @@ -320,10 +325,11 @@ This setting is intended as a safety measure against excessive resource consumpt

// INDEXES
INDEX_BUILD_CHUNK_SIZE_MB("arcadedb.index.buildChunkSizeMB", SCOPE.DATABASE,
"Size in MB for transaction chunks during bulk index creation with WAL disabled. " +
"Larger chunks reduce commit overhead but use more memory. " +
"Smaller chunks reduce memory pressure but add commit overhead. " +
"Recommended: 50MB for typical workloads, 100MB for high-memory systems, 25MB for constrained environments.",
"""
Size in MB for transaction chunks during bulk index creation with WAL disabled. \
Larger chunks reduce commit overhead but use more memory. \
Smaller chunks reduce memory pressure but add commit overhead. \
Recommended: 50MB for typical workloads, 100MB for high-memory systems, 25MB for constrained environments.""",
Long.class, 50L),

INDEX_COMPACTION_RAM_MB("arcadedb.indexCompactionRAM", SCOPE.DATABASE, "Maximum amount of RAM to use for index compaction, in MB",
Expand All @@ -333,29 +339,33 @@ This setting is intended as a safety measure against excessive resource consumpt
"Minimum number of mutable pages for an index to be schedule for automatic compaction. 0 = disabled", Integer.class, 10),

VECTOR_INDEX_LOCATION_CACHE_SIZE("arcadedb.vectorIndex.locationCacheSize", SCOPE.DATABASE,
"Maximum number of vector locations to cache in memory per vector index. " +
"Set to -1 for unlimited (backward compatible). " +
"Each entry uses ~56 bytes. Recommended: 100000 for datasets with 1M+ vectors (~5.6MB), " +
"-1 for smaller datasets.",
"""
Maximum number of vector locations to cache in memory per vector index. \
Set to -1 for unlimited (backward compatible). \
Each entry uses ~56 bytes. Recommended: 100000 for datasets with 1M+ vectors (~5.6MB), \
-1 for smaller datasets.""",
Integer.class, -1),

VECTOR_INDEX_GRAPH_BUILD_CACHE_SIZE("arcadedb.vectorIndex.graphBuildCacheSize", SCOPE.DATABASE,
"Maximum number of vectors to cache in memory during HNSW graph building. " +
"Higher values speed up construction but use more RAM. " +
"RAM usage = cacheSize * (dimensions * 4 + 64) bytes. " +
"Recommended: 100000 for 768-dim vectors (~30MB), scale based on dimensionality.",
"""
Maximum number of vectors to cache in memory during HNSW graph building. \
Higher values speed up construction but use more RAM. \
RAM usage = cacheSize * (dimensions * 4 + 64) bytes. \
Recommended: 100000 for 768-dim vectors (~30MB), scale based on dimensionality.""",
Integer.class, 100_000),

VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD("arcadedb.vectorIndex.mutationsBeforeRebuild", SCOPE.DATABASE,
"Number of mutations (inserts/updates/deletes) before rebuilding the HNSW graph index. " +
"Higher values reduce rebuild cost but may return slightly stale results in queries. " +
"Lower values provide fresher results but rebuild more frequently. " +
"Recommended: 50-200 for read-heavy, 200-500 for write-heavy workloads.",
"""
Number of mutations (inserts/updates/deletes) before rebuilding the HNSW graph index. \
Higher values reduce rebuild cost but may return slightly stale results in queries. \
Lower values provide fresher results but rebuild more frequently. \
Recommended: 50-200 for read-heavy, 200-500 for write-heavy workloads.""",
Integer.class, 100),

VECTOR_INDEX_GRAPH_BUILD_DIAGNOSTICS("arcadedb.vectorIndex.graphBuildDiagnostics", SCOPE.DATABASE,
"Enable diagnostic logging during vector graph build progress (heap/off-heap memory and index file sizes). " +
"This provides visibility during graph construction; disable if any logging overhead is a concern.",
"""
Enable diagnostic logging during vector graph build progress (heap/off-heap memory and index file sizes). \
This provides visibility during graph construction; disable if any logging overhead is a concern.""",
Boolean.class, true),

// NETWORK
Expand Down
Loading
Loading