From 22157fad8945931c24929ed9d784fec3c8435215 Mon Sep 17 00:00:00 2001 From: Yan Levin Date: Fri, 21 Aug 2026 18:57:27 -0500 Subject: [PATCH 1/5] Add interpreter tests for uncovered Cypher paths --- .../estore/planner/LogicalPlanBuilder.java | 8 +++ .../function/CountFunctionSingleExpr.java | 9 ++-- .../test/java/org/estore/CaptureModeTest.java | 53 ++++++++++++++++++ .../java/org/estore/CaseExpressionTest.java | 16 ++++++ .../java/org/estore/IncomingRelationTest.java | 38 +++++++++++++ .../org/estore/MultiDimensionalArrayTest.java | 54 +++++++++++++++++++ .../java/org/estore/NodePropScanTest.java | 33 ++++++++++++ .../org/estore/PropertiesFunctionTest.java | 30 +++++++++++ .../test/java/org/estore/SimpleQueryTest.java | 4 ++ .../org/estore/ToIntegerFunctionTest.java | 12 +++++ .../java/org/estore/VarLengthRangeTest.java | 39 ++++++++++++++ 11 files changed, 293 insertions(+), 3 deletions(-) create mode 100644 estore/src/test/java/org/estore/CaptureModeTest.java create mode 100644 estore/src/test/java/org/estore/IncomingRelationTest.java create mode 100644 estore/src/test/java/org/estore/NodePropScanTest.java create mode 100644 estore/src/test/java/org/estore/PropertiesFunctionTest.java create mode 100644 estore/src/test/java/org/estore/VarLengthRangeTest.java diff --git a/estore/src/main/java/org/estore/planner/LogicalPlanBuilder.java b/estore/src/main/java/org/estore/planner/LogicalPlanBuilder.java index 34bd264..66c2a45 100644 --- a/estore/src/main/java/org/estore/planner/LogicalPlanBuilder.java +++ b/estore/src/main/java/org/estore/planner/LogicalPlanBuilder.java @@ -604,6 +604,14 @@ public Object visitOC_MapLiteral(CypherParser.OC_MapLiteralContext ctx) { return null; } + @Override + public Object visitOC_Atom(CypherParser.OC_AtomContext ctx) { + if (ctx.COUNT() != null) { + return new CountFunctionExpr(); + } + return visitChildren(ctx); + } + @Override public Object visitOC_FunctionInvocation(CypherParser.OC_FunctionInvocationContext ctx) { LogicalExpr expr = null; diff --git a/estore/src/main/java/org/estore/planner/expressions/function/CountFunctionSingleExpr.java b/estore/src/main/java/org/estore/planner/expressions/function/CountFunctionSingleExpr.java index 00999d6..7a58a44 100644 --- a/estore/src/main/java/org/estore/planner/expressions/function/CountFunctionSingleExpr.java +++ b/estore/src/main/java/org/estore/planner/expressions/function/CountFunctionSingleExpr.java @@ -20,14 +20,17 @@ public CountFunctionSingleExpr(CountFunctionExpr expr) { @Override public Table evaluate(Table v) { + String keyName = getName(); + Table result = new Table(Arrays.asList(new String[] {keyName})); if (arg instanceof VarExpr) { - String keyName = getName(); - Table result = new Table(Arrays.asList(new String[] {keyName})); String variable = ((VarExpr) arg).evaluate(null); - result.get(keyName).add(v.get(variable).size()); return result; } + if (arg == null) { + result.get(keyName).add(v.getSize()); + return result; + } return null; } diff --git a/estore/src/test/java/org/estore/CaptureModeTest.java b/estore/src/test/java/org/estore/CaptureModeTest.java new file mode 100644 index 0000000..a950d21 --- /dev/null +++ b/estore/src/test/java/org/estore/CaptureModeTest.java @@ -0,0 +1,53 @@ +package org.estore; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.estore.example.Person; +import org.estore.planner.util.Table; +import org.junit.jupiter.api.Test; + +public class CaptureModeTest { + + @Test + void iterativeDfsCapturesPersonChain() throws Exception { + Estore db = + new Estore( + CaptureModeTest.class.getName(), + new EstoreOptions().useUnsafe(true).useDfs(true)); + Person charlie = new Person("Charlie", 25); + Person bob = new Person("Bob", 30, charlie); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice); + + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN p"); + assertEquals(3, result.getSize()); + } + + @Test + void recursiveDfsCapturesPersonChain() throws Exception { + Estore db = + new Estore( + CaptureModeTest.class.getName(), + new EstoreOptions().useUnsafe(true).useDfs(true).useRecursion(true)); + Person charlie = new Person("Charlie", 25); + Person bob = new Person("Bob", 30, charlie); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice); + + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN p"); + assertEquals(3, result.getSize()); + } + + @Test + void depthLimitedCaptureStops() throws Exception { + Estore db = + new Estore(CaptureModeTest.class.getName(), new EstoreOptions().useUnsafe(true)); + Person charlie = new Person("Charlie", 25); + Person bob = new Person("Bob", 30, charlie); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice, 2, 0); + + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN p"); + assertEquals(2, result.getSize()); + } +} diff --git a/estore/src/test/java/org/estore/CaseExpressionTest.java b/estore/src/test/java/org/estore/CaseExpressionTest.java index fa84d0c..d79d0dc 100644 --- a/estore/src/test/java/org/estore/CaseExpressionTest.java +++ b/estore/src/test/java/org/estore/CaseExpressionTest.java @@ -31,4 +31,20 @@ void caseReturnsThenWhenPredicateIsTrue() throws Exception { "MATCH (p:`org.estore.example.Person`) RETURN CASE WHEN p.age > 15 THEN 1 ELSE 0 END"); assertEquals(1L, result.get("CASE").get(0)); } + + @Test + void caseMatchesSubject() throws Exception { + Table result = + db.query( + "MATCH (p:`org.estore.example.Person`) RETURN CASE p.name WHEN 'A' THEN 1 ELSE 0 END"); + assertEquals(1L, result.get("CASE").get(0)); + } + + @Test + void caseWithoutElseIsNullWhenNoWhenMatches() throws Exception { + Table result = + db.query( + "MATCH (p:`org.estore.example.Person`) RETURN CASE WHEN p.age > 99 THEN 1 END"); + assertEquals(null, result.get("CASE").get(0)); + } } diff --git a/estore/src/test/java/org/estore/IncomingRelationTest.java b/estore/src/test/java/org/estore/IncomingRelationTest.java new file mode 100644 index 0000000..4681b81 --- /dev/null +++ b/estore/src/test/java/org/estore/IncomingRelationTest.java @@ -0,0 +1,38 @@ +package org.estore; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.estore.example.Person; +import org.estore.planner.util.Table; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class IncomingRelationTest { + private Estore db; + + @BeforeEach + void setUp() throws Exception { + db = new Estore(IncomingRelationTest.class.getName(), new EstoreOptions().useUnsafe(true)); + Person bob = new Person("Bob", 30); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice); + } + + @Test + void incomingTypedEdgeFindsReferrer() throws Exception { + Table result = + db.query( + "MATCH (b:`org.estore.example.Person`)<-[:friend]-(a:`org.estore.example.Person`) RETURN a"); + assertEquals(1, result.getSize()); + assertEquals("Alice", ((Person) result.get("a").get(0)).name); + } + + @Test + void incomingVarLengthFindsReferrer() throws Exception { + Table result = + db.query( + "MATCH (a:`org.estore.example.Person`)<-[*1..2]-(b:`org.estore.example.Person`) RETURN b"); + assertEquals(1, result.getSize()); + assertEquals("Alice", ((Person) result.get("b").get(0)).name); + } +} diff --git a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java index 3802598..601b449 100644 --- a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java +++ b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java @@ -249,4 +249,58 @@ public void testArrayTable_unsafe() throws Exception { + "}) RETURN m"); assertEquals(target, ((Long) result.get("m").get(0)).longValue()); } + + @Test + public void testArrayTable_dfs() throws Exception { + Estore dfsStore = + new Estore( + MultiDimensionalArrayTest.class.getName() + "Dfs", + new EstoreOptions().useUnsafe(false).useDfs(true)); + Long[][] grid = new Long[10][10]; + long target = rand.nextLong(0, Long.MAX_VALUE); + int ti = 4; + int tj = 6; + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + grid[i][j] = (i == ti && j == tj) ? target : rand.nextLong(0, Long.MAX_VALUE); + } + } + dfsStore.captureAll(grid); + + Table result = + dfsStore.query( + "MATCH (n:`" + + grid.getClass().getName() + + "`)-[]->()-[]->(m {value:" + + target + + "}) RETURN m"); + assertEquals(target, ((Long) result.get("m").get(0)).longValue()); + } + + @Test + public void testIntMatrix2D_dfs() throws Exception { + Estore dfsStore = + new Estore( + MultiDimensionalArrayTest.class.getName() + "IntDfs", + new EstoreOptions().useUnsafe(false).useDfs(true)); + int[][] grid = new int[8][8]; + int target = 4242; + int ti = 1; + int tj = 4; + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j++) { + grid[i][j] = (i == ti && j == tj) ? target : rand.nextInt(0, 10000); + } + } + dfsStore.captureAll(grid); + + Table result = + dfsStore.query( + "MATCH (n:`" + + grid.getClass().getName() + + "`)-[]->()-[]->(m {value:" + + target + + "}) RETURN m"); + assertEquals(target, ((Integer) result.get("m").get(0)).intValue()); + } } diff --git a/estore/src/test/java/org/estore/NodePropScanTest.java b/estore/src/test/java/org/estore/NodePropScanTest.java new file mode 100644 index 0000000..c7905d6 --- /dev/null +++ b/estore/src/test/java/org/estore/NodePropScanTest.java @@ -0,0 +1,33 @@ +package org.estore; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.estore.example.Person; +import org.estore.planner.util.Table; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class NodePropScanTest { + private Estore db; + + @BeforeEach + void setUp() throws Exception { + db = new Estore(NodePropScanTest.class.getName(), new EstoreOptions().useUnsafe(true)); + Person bob = new Person("Bob", 30); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice); + } + + @Test + void unlabeledPropertyMatchFindsPersonByName() { + Table result = db.query("MATCH (n {name:'Alice'}) RETURN n"); + assertEquals(1, result.getSize()); + assertEquals("Alice", ((Person) result.get("n").get(0)).name); + } + + @Test + void unlabeledPropertyMatchExcludesWrongName() { + Table result = db.query("MATCH (n {name:'Nobody'}) RETURN n"); + assertEquals(0, result.getSize()); + } +} diff --git a/estore/src/test/java/org/estore/PropertiesFunctionTest.java b/estore/src/test/java/org/estore/PropertiesFunctionTest.java new file mode 100644 index 0000000..9bd713b --- /dev/null +++ b/estore/src/test/java/org/estore/PropertiesFunctionTest.java @@ -0,0 +1,30 @@ +package org.estore; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.HashMap; +import org.estore.example.Person; +import org.estore.planner.util.Table; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class PropertiesFunctionTest { + private Estore db; + + @BeforeEach + void setUp() throws Exception { + db = + new Estore( + PropertiesFunctionTest.class.getName(), + new EstoreOptions().useUnsafe(true)); + db.captureAll(new Person("A", 20)); + } + + @Test + void propertiesReturnsPrimitiveFields() { + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN properties(p)"); + HashMap props = (HashMap) result.get("PROPERTIES(p)").get(0); + assertEquals("A", props.get("name")); + assertEquals(20, props.get("age")); + } +} diff --git a/estore/src/test/java/org/estore/SimpleQueryTest.java b/estore/src/test/java/org/estore/SimpleQueryTest.java index 7402565..cdc291d 100644 --- a/estore/src/test/java/org/estore/SimpleQueryTest.java +++ b/estore/src/test/java/org/estore/SimpleQueryTest.java @@ -24,5 +24,9 @@ void createsAndFindsSingleNode() { Table count = db.query("MATCH (n:`SimpleNode`) RETURN COUNT(n)"); assertEquals(1, count.getSize()); assertEquals(1, count.get("COUNT(n)").get(0)); + + Table star = db.query("MATCH (n:`SimpleNode`) RETURN COUNT(*)"); + assertEquals(1, star.getSize()); + assertEquals(1, star.get("COUNT(*)").get(0)); } } diff --git a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java index d799a17..9d4da5e 100644 --- a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java +++ b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java @@ -21,4 +21,16 @@ void toIntegerConvertsStringLiteral() throws Exception { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger('9')"); assertEquals(9, result.get("TOINTEGER(9)").get(0)); } + + @Test + void toIntegerConvertsProperty() throws Exception { + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger(p.age)"); + assertEquals(20, result.get("TOINTEGER(p.age)").get(0)); + } + + @Test + void toIntegerReturnsNullForNonNumericString() throws Exception { + Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger('nope')"); + assertEquals(null, result.get("TOINTEGER(nope)").get(0)); + } } diff --git a/estore/src/test/java/org/estore/VarLengthRangeTest.java b/estore/src/test/java/org/estore/VarLengthRangeTest.java new file mode 100644 index 0000000..514b98d --- /dev/null +++ b/estore/src/test/java/org/estore/VarLengthRangeTest.java @@ -0,0 +1,39 @@ +package org.estore; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.estore.example.Person; +import org.estore.planner.util.Table; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class VarLengthRangeTest { + private Estore db; + + @BeforeEach + void setUp() throws Exception { + db = new Estore(VarLengthRangeTest.class.getName(), new EstoreOptions().useUnsafe(true)); + Person charlie = new Person("Charlie", 25); + Person bob = new Person("Bob", 30, charlie); + Person alice = new Person("Alice", 28, bob); + db.captureAll(alice); + } + + @Test + void exactTwoHopsFindsCharlie() throws Exception { + Table result = + db.query( + "MATCH (a:`org.estore.example.Person`)-[*2]->(b:`org.estore.example.Person`) RETURN b"); + assertEquals(1, result.getSize()); + assertEquals("Charlie", ((Person) result.get("b").get(0)).name); + } + + @Test + void twoOrMoreHopsFindsCharlie() throws Exception { + Table result = + db.query( + "MATCH (a:`org.estore.example.Person`)-[*2..]->(b:`org.estore.example.Person`) RETURN b"); + assertEquals(1, result.getSize()); + assertEquals("Charlie", ((Person) result.get("b").get(0)).name); + } +} From 0edd310868de3aa490624a5fd4b524ff0b1e3c4e Mon Sep 17 00:00:00 2001 From: Yan Levin Date: Sat, 22 Aug 2026 13:17:10 -0500 Subject: [PATCH 2/5] removed unsafes from new tests --- estore/src/test/java/org/estore/CaptureModeTest.java | 10 +++------- .../src/test/java/org/estore/CaseExpressionTest.java | 2 +- .../src/test/java/org/estore/IncomingRelationTest.java | 2 +- .../java/org/estore/MultiDimensionalArrayTest.java | 5 +---- estore/src/test/java/org/estore/NodePropScanTest.java | 2 +- .../test/java/org/estore/PropertiesFunctionTest.java | 5 +---- estore/src/test/java/org/estore/SimpleQueryTest.java | 2 +- .../test/java/org/estore/ToIntegerFunctionTest.java | 2 +- .../src/test/java/org/estore/VarLengthRangeTest.java | 2 +- 9 files changed, 11 insertions(+), 21 deletions(-) diff --git a/estore/src/test/java/org/estore/CaptureModeTest.java b/estore/src/test/java/org/estore/CaptureModeTest.java index a950d21..429415c 100644 --- a/estore/src/test/java/org/estore/CaptureModeTest.java +++ b/estore/src/test/java/org/estore/CaptureModeTest.java @@ -10,10 +10,7 @@ public class CaptureModeTest { @Test void iterativeDfsCapturesPersonChain() throws Exception { - Estore db = - new Estore( - CaptureModeTest.class.getName(), - new EstoreOptions().useUnsafe(true).useDfs(true)); + Estore db = new Estore(CaptureModeTest.class.getName(), new EstoreOptions().useDfs(true)); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); Person alice = new Person("Alice", 28, bob); @@ -28,7 +25,7 @@ void recursiveDfsCapturesPersonChain() throws Exception { Estore db = new Estore( CaptureModeTest.class.getName(), - new EstoreOptions().useUnsafe(true).useDfs(true).useRecursion(true)); + new EstoreOptions().useDfs(true).useRecursion(true)); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); Person alice = new Person("Alice", 28, bob); @@ -40,8 +37,7 @@ void recursiveDfsCapturesPersonChain() throws Exception { @Test void depthLimitedCaptureStops() throws Exception { - Estore db = - new Estore(CaptureModeTest.class.getName(), new EstoreOptions().useUnsafe(true)); + Estore db = new Estore(CaptureModeTest.class.getName()); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); Person alice = new Person("Alice", 28, bob); diff --git a/estore/src/test/java/org/estore/CaseExpressionTest.java b/estore/src/test/java/org/estore/CaseExpressionTest.java index d79d0dc..3627193 100644 --- a/estore/src/test/java/org/estore/CaseExpressionTest.java +++ b/estore/src/test/java/org/estore/CaseExpressionTest.java @@ -12,7 +12,7 @@ public class CaseExpressionTest { @BeforeEach void setUp() throws Exception { - db = new Estore(CaseExpressionTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(CaseExpressionTest.class.getName()); db.captureAll(new Person("A", 20)); } diff --git a/estore/src/test/java/org/estore/IncomingRelationTest.java b/estore/src/test/java/org/estore/IncomingRelationTest.java index 4681b81..8d1e31c 100644 --- a/estore/src/test/java/org/estore/IncomingRelationTest.java +++ b/estore/src/test/java/org/estore/IncomingRelationTest.java @@ -12,7 +12,7 @@ public class IncomingRelationTest { @BeforeEach void setUp() throws Exception { - db = new Estore(IncomingRelationTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(IncomingRelationTest.class.getName()); Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); db.captureAll(alice); diff --git a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java index 601b449..1c5e6e6 100644 --- a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java +++ b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java @@ -225,10 +225,7 @@ public void testDeleteArrayIndex() throws Exception { @Test public void testArrayTable_unsafe() throws Exception { - Estore unsafeStore = - new Estore( - MultiDimensionalArrayTest.class.getName() + "Unsafe", - new EstoreOptions().useUnsafe(true)); + Estore unsafeStore = new Estore(MultiDimensionalArrayTest.class.getName() + "Unsafe"); Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 4; diff --git a/estore/src/test/java/org/estore/NodePropScanTest.java b/estore/src/test/java/org/estore/NodePropScanTest.java index c7905d6..c5a6b83 100644 --- a/estore/src/test/java/org/estore/NodePropScanTest.java +++ b/estore/src/test/java/org/estore/NodePropScanTest.java @@ -12,7 +12,7 @@ public class NodePropScanTest { @BeforeEach void setUp() throws Exception { - db = new Estore(NodePropScanTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(NodePropScanTest.class.getName()); Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); db.captureAll(alice); diff --git a/estore/src/test/java/org/estore/PropertiesFunctionTest.java b/estore/src/test/java/org/estore/PropertiesFunctionTest.java index 9bd713b..56fd311 100644 --- a/estore/src/test/java/org/estore/PropertiesFunctionTest.java +++ b/estore/src/test/java/org/estore/PropertiesFunctionTest.java @@ -13,10 +13,7 @@ public class PropertiesFunctionTest { @BeforeEach void setUp() throws Exception { - db = - new Estore( - PropertiesFunctionTest.class.getName(), - new EstoreOptions().useUnsafe(true)); + db = new Estore(PropertiesFunctionTest.class.getName()); db.captureAll(new Person("A", 20)); } diff --git a/estore/src/test/java/org/estore/SimpleQueryTest.java b/estore/src/test/java/org/estore/SimpleQueryTest.java index cdc291d..67a4ab5 100644 --- a/estore/src/test/java/org/estore/SimpleQueryTest.java +++ b/estore/src/test/java/org/estore/SimpleQueryTest.java @@ -12,7 +12,7 @@ public class SimpleQueryTest { @BeforeEach void setUp() throws Exception { - db = new Estore(SimpleQueryTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(SimpleQueryTest.class.getName()); } @Test diff --git a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java index 9d4da5e..80c2cca 100644 --- a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java +++ b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java @@ -12,7 +12,7 @@ public class ToIntegerFunctionTest { @BeforeEach void setUp() throws Exception { - db = new Estore(ToIntegerFunctionTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(ToIntegerFunctionTest.class.getName()); db.captureAll(new Person("A", 20)); } diff --git a/estore/src/test/java/org/estore/VarLengthRangeTest.java b/estore/src/test/java/org/estore/VarLengthRangeTest.java index 514b98d..5cbe525 100644 --- a/estore/src/test/java/org/estore/VarLengthRangeTest.java +++ b/estore/src/test/java/org/estore/VarLengthRangeTest.java @@ -12,7 +12,7 @@ public class VarLengthRangeTest { @BeforeEach void setUp() throws Exception { - db = new Estore(VarLengthRangeTest.class.getName(), new EstoreOptions().useUnsafe(true)); + db = new Estore(VarLengthRangeTest.class.getName()); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); Person alice = new Person("Alice", 28, bob); From 7cedd56582898ccf033f1ce754b5dd59ac387ea5 Mon Sep 17 00:00:00 2001 From: Yan Levin Date: Sat, 22 Aug 2026 17:50:41 -0500 Subject: [PATCH 3/5] remove throw Exception from tests which previously used unsafes --- README.md | 2 +- estore/scripts/gen_usecase_data.py | 5 +- estore/src/main/java/org/estore/Estore.java | 44 +- .../main/java/org/estore/EstoreOptions.java | 11 - estore/src/main/java/org/estore/Main.java | 4 +- .../java/org/estore/compiler/ImplCodeGen.java | 3 +- .../org/estore/planner/util/ClassInfo.java | 9 +- .../planner/util/ClassInfoUnsafeImpl.java | 269 -------- .../org/estore/AggregateFunctionTest.java | 12 +- .../org/estore/AnonymousRelationTest.java | 6 +- .../test/java/org/estore/ArithmeticTest.java | 6 +- .../test/java/org/estore/CaptureModeTest.java | 6 +- .../java/org/estore/CaseExpressionTest.java | 10 +- .../java/org/estore/CountDistinctTest.java | 6 +- .../java/org/estore/CreateInstanceTest.java | 39 +- .../DbMetadataTest/EstoreMetadataTest.java | 115 ++-- .../estore/DbMetadataTest/H2MetadataTest.java | 44 +- .../java/org/estore/IncomingRelationTest.java | 6 +- .../org/estore/MultiDimensionalArrayTest.java | 41 +- .../src/test/java/org/estore/MyFirstTest.java | 4 +- .../java/org/estore/NodePropScanTest.java | 2 +- .../org/estore/PropertiesFunctionTest.java | 2 +- .../test/java/org/estore/SimpleQueryTest.java | 2 +- .../org/estore/ToIntegerFunctionTest.java | 8 +- .../java/org/estore/TypeFunctionTest.java | 6 +- .../java/org/estore/VarLengthRangeTest.java | 6 +- .../java/org/estore/compiler/CodeGenTest.java | 11 +- .../org/estore/compiler/ImplCodeGenTest.java | 17 +- .../java/org/estore/compiler/UtilTest.java | 8 +- .../apachecommons/DualHashBidiMapTest.java | 7 +- .../apachecommons/GrowthListTest.java | 8 +- .../apachecommons/PatriciaTrieTest.java | 5 +- .../eclipse/FastListTest.java | 5 +- .../eclipse/HashBagTest.java | 5 +- .../eclipse/HashBiMapTest.java | 5 +- .../fastutil/FastutilTest.java | 12 +- .../guava/HashBiMapTest.java | 5 +- .../guava/LinkedListMultimapTest.java | 8 +- .../guava/MinMaxPriorityQueueTest.java | 8 +- .../datastructuretests/jcf/ArrayListTest.java | 5 +- .../datastructuretests/jcf/HashSetTest.java | 5 +- .../eval/datastructure/EclipseTest.java | 16 +- .../estore/eval/datastructure/GuavaTest.java | 8 +- .../estore/eval/datastructure/JCFTest.java | 16 +- .../estore/eval/ldbc/finbench/Fin001Test.java | 10 +- .../org/estore/eval/ldbc/snb/Snb01Test.java | 10 +- .../relational/EqualsRelationExprTest.java | 25 +- .../planner/filter/WhereBooleanLogicTest.java | 19 +- .../InGraphReflectionTestArrayStack100.java | 6 +- .../InGraphReflectionTestArrayStack1000.java | 6 +- .../InGraphReflectionTestArrayStack10000.java | 6 +- ...InGraphReflectionTestArrayStack100000.java | 6 +- .../InGraphReflectionTestFastList100.java | 6 +- .../InGraphReflectionTestFastList1000.java | 6 +- .../InGraphReflectionTestFastList10000.java | 6 +- .../InGraphReflectionTestFastList100000.java | 6 +- ...phReflectionTestImmutableArrayList100.java | 6 +- ...hReflectionTestImmutableArrayList1000.java | 6 +- ...ReflectionTestImmutableArrayList10000.java | 6 +- ...eflectionTestImmutableArrayList100000.java | 6 +- .../InGraphReflectionTestUnifiedMap100.java | 6 +- .../InGraphReflectionTestUnifiedMap1000.java | 6 +- .../InGraphReflectionTestUnifiedMap10000.java | 6 +- ...InGraphReflectionTestUnifiedMap100000.java | 6 +- .../InGraphReflectionTestUnifiedSet100.java | 6 +- .../InGraphReflectionTestUnifiedSet1000.java | 6 +- .../InGraphReflectionTestUnifiedSet10000.java | 6 +- ...InGraphReflectionTestUnifiedSet100000.java | 6 +- .../InGraphUnsafeTestArrayStack100.java | 49 -- .../InGraphUnsafeTestArrayStack1000.java | 49 -- .../InGraphUnsafeTestArrayStack10000.java | 49 -- .../InGraphUnsafeTestArrayStack100000.java | 49 -- .../eclipse/InGraphUnsafeTestFastList100.java | 43 -- .../InGraphUnsafeTestFastList1000.java | 43 -- .../InGraphUnsafeTestFastList10000.java | 43 -- .../InGraphUnsafeTestFastList100000.java | 43 -- ...nGraphUnsafeTestImmutableArrayList100.java | 48 -- ...GraphUnsafeTestImmutableArrayList1000.java | 48 -- ...raphUnsafeTestImmutableArrayList10000.java | 48 -- ...aphUnsafeTestImmutableArrayList100000.java | 48 -- .../InGraphUnsafeTestUnifiedMap100.java | 48 -- .../InGraphUnsafeTestUnifiedMap1000.java | 48 -- .../InGraphUnsafeTestUnifiedMap10000.java | 48 -- .../InGraphUnsafeTestUnifiedMap100000.java | 48 -- .../InGraphUnsafeTestUnifiedSet100.java | 46 -- .../InGraphUnsafeTestUnifiedSet1000.java | 46 -- .../InGraphUnsafeTestUnifiedSet10000.java | 46 -- .../InGraphUnsafeTestUnifiedSet100000.java | 46 -- .../InGraphReflectionTestArrayTable100.java | 6 +- .../InGraphReflectionTestArrayTable1000.java | 6 +- .../InGraphReflectionTestArrayTable10000.java | 6 +- ...InGraphReflectionTestArrayTable100000.java | 6 +- .../InGraphReflectionTestHashMultiset100.java | 6 +- .../guava/InGraphUnsafeTestArrayTable100.java | 52 -- .../InGraphUnsafeTestArrayTable1000.java | 52 -- .../InGraphUnsafeTestArrayTable10000.java | 52 -- .../InGraphUnsafeTestArrayTable100000.java | 52 -- .../InGraphReflectionTestArrayDeque100.java | 6 +- .../InGraphReflectionTestArrayDeque1000.java | 6 +- .../InGraphReflectionTestArrayDeque10000.java | 6 +- ...InGraphReflectionTestArrayDeque100000.java | 6 +- .../InGraphReflectionTestArrayList100.java | 6 +- .../InGraphReflectionTestArrayList1000.java | 6 +- .../InGraphReflectionTestArrayList10000.java | 6 +- .../InGraphReflectionTestArrayList100000.java | 6 +- ...InGraphReflectionTestArrayList1000000.java | 6 +- .../jcf/InGraphReflectionTestHashMap100.java | 6 +- .../jcf/InGraphReflectionTestHashMap1000.java | 6 +- .../InGraphReflectionTestHashMap10000.java | 6 +- .../InGraphReflectionTestHashMap100000.java | 6 +- .../InGraphReflectionTestLinkedList100.java | 6 +- .../InGraphReflectionTestLinkedList1000.java | 6 +- .../InGraphReflectionTestLinkedList10000.java | 6 +- ...InGraphReflectionTestLinkedList100000.java | 6 +- .../jcf/InGraphReflectionTestVector100.java | 6 +- .../jcf/InGraphReflectionTestVector1000.java | 6 +- .../jcf/InGraphReflectionTestVector10000.java | 6 +- .../InGraphReflectionTestVector100000.java | 6 +- .../jcf/InGraphUnsafeTestArrayDeque100.java | 39 -- .../jcf/InGraphUnsafeTestArrayDeque1000.java | 39 -- .../jcf/InGraphUnsafeTestArrayDeque10000.java | 39 -- .../InGraphUnsafeTestArrayDeque100000.java | 39 -- .../jcf/InGraphUnsafeTestArrayList100.java | 43 -- .../jcf/InGraphUnsafeTestArrayList1000.java | 42 -- .../jcf/InGraphUnsafeTestArrayList10000.java | 39 -- .../jcf/InGraphUnsafeTestArrayList100000.java | 39 -- .../jcf/InGraphUnsafeTestHashMap100.java | 40 -- .../jcf/InGraphUnsafeTestHashMap1000.java | 40 -- .../jcf/InGraphUnsafeTestHashMap10000.java | 40 -- .../jcf/InGraphUnsafeTestHashMap100000.java | 40 -- .../jcf/InGraphUnsafeTestLinkedList100.java | 39 -- .../jcf/InGraphUnsafeTestLinkedList1000.java | 41 -- .../jcf/InGraphUnsafeTestLinkedList10000.java | 41 -- .../InGraphUnsafeTestLinkedList100000.java | 41 -- .../jcf/InGraphUnsafeTestVector100.java | 39 -- .../jcf/InGraphUnsafeTestVector1000.java | 39 -- .../jcf/InGraphUnsafeTestVector10000.java | 39 -- .../jcf/InGraphUnsafeTestVector100000.java | 39 -- .../finbench/ArcadeDBEmbeddedTest001.java | 2 +- .../ldbc/finbench/ArcadeDBEmbeddedTest01.java | 2 +- .../ldbc/finbench/ArcadeDBEmbeddedTest03.java | 2 +- .../ldbc/finbench/ArcadeDBEmbeddedTest10.java | 2 +- .../ldbc/finbench/ArcadeDBEmbeddedTest3.java | 2 +- .../finbench/InGraphReflectionTest001.java | 7 +- .../finbench/InGraphReflectionTest01.java | 7 +- .../finbench/InGraphReflectionTest03.java | 7 +- .../finbench/InGraphReflectionTest10.java | 7 +- .../ldbc/finbench/InGraphReflectionTest3.java | 7 +- .../ldbc/finbench/InGraphUnsafeTest001.java | 432 ------------- .../ldbc/finbench/InGraphUnsafeTest01.java | 436 ------------- .../ldbc/finbench/InGraphUnsafeTest03.java | 431 ------------- .../ldbc/finbench/InGraphUnsafeTest10.java | 431 ------------- .../ldbc/finbench/InGraphUnsafeTest3.java | 431 ------------- .../finbench/Neo4jImpermanantTest001.java | 2 +- .../ldbc/finbench/Neo4jImpermanantTest01.java | 2 +- .../ldbc/finbench/Neo4jImpermanantTest03.java | 2 +- .../ldbc/finbench/Neo4jImpermanantTest10.java | 2 +- .../ldbc/finbench/Neo4jImpermanantTest3.java | 2 +- .../ldbc/snb/InGraphReflectionTest01.java | 7 +- .../ldbc/snb/InGraphReflectionTest03.java | 7 +- .../ldbc/snb/InGraphReflectionTest1.java | 7 +- .../ldbc/snb/InGraphReflectionTest10.java | 7 +- .../ldbc/snb/InGraphReflectionTest3.java | 7 +- .../estore/ldbc/snb/InGraphUnsafeTest01.java | 585 ----------------- .../estore/ldbc/snb/InGraphUnsafeTest03.java | 595 ------------------ .../estore/ldbc/snb/InGraphUnsafeTest1.java | 595 ------------------ .../estore/ldbc/snb/InGraphUnsafeTest10.java | 594 ----------------- .../estore/ldbc/snb/InGraphUnsafeTest3.java | 594 ----------------- .../ldbc/snb/Neo4jImpermanantTest01.java | 2 +- .../ldbc/snb/Neo4jImpermanantTest03.java | 2 +- .../ldbc/snb/Neo4jImpermanantTest1.java | 2 +- .../ldbc/snb/Neo4jImpermanantTest10.java | 2 +- .../ldbc/snb/Neo4jImpermanantTest3.java | 2 +- .../h2/InGraphReflectionMetaDataTest.java | 15 +- .../h2/InGraphUnsafeMetaDataTest.java | 112 ---- .../estore/metadata/h2/JDBCMetaDataTest.java | 11 +- ...e-arraystack-100-ingraph-unsafe.dockerfile | 32 - ...-arraystack-1000-ingraph-unsafe.dockerfile | 32 - ...arraystack-10000-ingraph-unsafe.dockerfile | 32 - ...rraystack-100000-ingraph-unsafe.dockerfile | 32 - ...pse-fastlist-100-ingraph-unsafe.dockerfile | 32 - ...se-fastlist-1000-ingraph-unsafe.dockerfile | 32 - ...e-fastlist-10000-ingraph-unsafe.dockerfile | 32 - ...-fastlist-100000-ingraph-unsafe.dockerfile | 32 - ...blearraylist-100-ingraph-unsafe.dockerfile | 32 - ...learraylist-1000-ingraph-unsafe.dockerfile | 32 - ...earraylist-10000-ingraph-unsafe.dockerfile | 32 - ...arraylist-100000-ingraph-unsafe.dockerfile | 32 - ...e-unifiedmap-100-ingraph-unsafe.dockerfile | 32 - ...-unifiedmap-1000-ingraph-unsafe.dockerfile | 32 - ...unifiedmap-10000-ingraph-unsafe.dockerfile | 32 - ...nifiedmap-100000-ingraph-unsafe.dockerfile | 32 - ...e-unifiedset-100-ingraph-unsafe.dockerfile | 32 - ...-unifiedset-1000-ingraph-unsafe.dockerfile | 32 - ...unifiedset-10000-ingraph-unsafe.dockerfile | 32 - ...nifiedset-100000-ingraph-unsafe.dockerfile | 32 - ...a-arraytable-100-ingraph-unsafe.dockerfile | 32 - ...-arraytable-1000-ingraph-unsafe.dockerfile | 32 - ...arraytable-10000-ingraph-unsafe.dockerfile | 32 - ...rraytable-100000-ingraph-unsafe.dockerfile | 32 - .../h2metadata-ingraph-unsafe.dockerfile | 32 - ...f-arraydeque-100-ingraph-unsafe.dockerfile | 32 - ...-arraydeque-1000-ingraph-unsafe.dockerfile | 32 - ...arraydeque-10000-ingraph-unsafe.dockerfile | 32 - ...rraydeque-100000-ingraph-unsafe.dockerfile | 32 - ...cf-arraylist-100-ingraph-unsafe.dockerfile | 32 - ...f-arraylist-1000-ingraph-unsafe.dockerfile | 32 - ...-arraylist-10000-ingraph-unsafe.dockerfile | 32 - ...arraylist-100000-ingraph-unsafe.dockerfile | 32 - .../jcf-hashmap-100-ingraph-unsafe.dockerfile | 32 - ...jcf-hashmap-1000-ingraph-unsafe.dockerfile | 32 - ...cf-hashmap-10000-ingraph-unsafe.dockerfile | 32 - ...f-hashmap-100000-ingraph-unsafe.dockerfile | 32 - ...f-linkedlist-100-ingraph-unsafe.dockerfile | 32 - ...-linkedlist-1000-ingraph-unsafe.dockerfile | 32 - ...linkedlist-10000-ingraph-unsafe.dockerfile | 32 - ...inkedlist-100000-ingraph-unsafe.dockerfile | 32 - .../jcf-vector-100-ingraph-unsafe.dockerfile | 32 - .../jcf-vector-1000-ingraph-unsafe.dockerfile | 32 - ...jcf-vector-10000-ingraph-unsafe.dockerfile | 32 - ...cf-vector-100000-ingraph-unsafe.dockerfile | 32 - ...bc-finbench-0.01-ingraph-unsafe.dockerfile | 39 -- ...dbc-finbench-0.1-ingraph-unsafe.dockerfile | 37 -- ...dbc-finbench-0.3-ingraph-unsafe.dockerfile | 37 -- ...ldbc-finbench-10-ingraph-unsafe.dockerfile | 37 -- .../ldbc-finbench-3-ingraph-unsafe.dockerfile | 37 -- .../ldbc-snb-0.1-ingraph-unsafe.dockerfile | 39 -- .../ldbc-snb-0.3-ingraph-unsafe.dockerfile | 39 -- .../ldbc-snb-1-ingraph-unsafe.dockerfile | 39 -- .../ldbc-snb-10-ingraph-unsafe.dockerfile | 39 -- .../ldbc-snb-3-ingraph-unsafe.dockerfile | 39 -- eval/test.py | 8 +- s | 5 +- 233 files changed, 476 insertions(+), 9824 deletions(-) delete mode 100644 estore/src/main/java/org/estore/planner/util/ClassInfoUnsafeImpl.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack1000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack10000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList1000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList10000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList1000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList10000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap1000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap10000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet1000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet10000.java delete mode 100644 eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100000.java delete mode 100644 eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100.java delete mode 100644 eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable1000.java delete mode 100644 eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable10000.java delete mode 100644 eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque1000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque10000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList1000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList10000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap1000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap10000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList1000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList10000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector1000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector10000.java delete mode 100644 eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100000.java delete mode 100644 eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest001.java delete mode 100644 eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest01.java delete mode 100644 eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest03.java delete mode 100644 eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest10.java delete mode 100644 eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest3.java delete mode 100644 eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest01.java delete mode 100644 eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest03.java delete mode 100644 eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest1.java delete mode 100644 eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest10.java delete mode 100644 eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest3.java delete mode 100644 eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphUnsafeMetaDataTest.java delete mode 100644 eval/images/eclipse-arraystack-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-arraystack-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-arraystack-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-arraystack-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-fastlist-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-fastlist-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-fastlist-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-fastlist-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-immutablearraylist-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-immutablearraylist-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-immutablearraylist-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-immutablearraylist-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedmap-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedmap-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedmap-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedmap-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedset-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedset-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedset-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/eclipse-unifiedset-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/guava-arraytable-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/guava-arraytable-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/guava-arraytable-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/guava-arraytable-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/h2metadata-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraydeque-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraydeque-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraydeque-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraydeque-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraylist-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraylist-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraylist-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-arraylist-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-hashmap-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-hashmap-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-hashmap-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-hashmap-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-linkedlist-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-linkedlist-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-linkedlist-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-linkedlist-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-vector-100-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-vector-1000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-vector-10000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/jcf-vector-100000-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-finbench-0.01-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-finbench-0.1-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-finbench-0.3-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-finbench-10-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-finbench-3-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-snb-0.1-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-snb-0.3-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-snb-1-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-snb-10-ingraph-unsafe.dockerfile delete mode 100644 eval/images/ldbc-snb-3-ingraph-unsafe.dockerfile diff --git a/README.md b/README.md index 6998c5e..c8dce0a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Application. Person bob = new Person("Bob", 30, charlie); Person alice = new Person("Alice", 28, bob); - Estore db = new Estore("exampleDb", new EstoreOptions().useUnsafe(false)); + Estore db = new Estore("exampleDb"); db.captureAll(alice); // MATCH finds Person objects; RETURN puts them in column p diff --git a/estore/scripts/gen_usecase_data.py b/estore/scripts/gen_usecase_data.py index d148744..d3ba88f 100644 --- a/estore/scripts/gen_usecase_data.py +++ b/estore/scripts/gen_usecase_data.py @@ -28,7 +28,6 @@ def generate_json(data_type): queries = ["getCatalogs", "getSchemas", "getTables"] implementations = { "egraph-reflection": "\\ToolReflection", - "egraph-unsafe": "\\ToolUnsafe", "jdbc": "\\JDBC" } test_class = "H2MetadataTest" @@ -36,7 +35,6 @@ def generate_json(data_type): queries = ["dbName", "options", "dynamicClass"] implementations = { "egraph-reflection": "\\ToolReflection", - "egraph-unsafe": "\\ToolUnsafe", } test_class = "EstoreMetadataTest" @@ -61,10 +59,9 @@ def generate_json(data_type): } } else: - use_unsafe = "true" if impl == "egraph-unsafe" else "false" queryName = query[0].upper() + query[1:] if data_type == 'egraph' else query[3:] suffix = "ESTORE" if data_type == 'h2' else "" - command = f"mvn test -Dtest={test_class}#test{queryName}{suffix}Repeat -DuseUnsafe={use_unsafe} -Dprofile=true" + command = f"mvn test -Dtest={test_class}#test{queryName}{suffix}Repeat -Dprofile=true" # print(command) metrics = ["Parse Tree Generation Time", "Query Plan AST Building Time", "Query Execution Time", "Total Query Time"] metric_data = {metric: [] for metric in metrics} diff --git a/estore/src/main/java/org/estore/Estore.java b/estore/src/main/java/org/estore/Estore.java index b1f07b8..e873f50 100644 --- a/estore/src/main/java/org/estore/Estore.java +++ b/estore/src/main/java/org/estore/Estore.java @@ -20,7 +20,6 @@ import org.estore.planner.LogicalPlanBuilder; import org.estore.planner.util.ClassInfo; import org.estore.planner.util.Table; -import sun.misc.Unsafe; public class Estore implements Serializable { private String name; @@ -34,7 +33,6 @@ public class Estore implements Serializable { */ private HashMap runtimeClassInfoMap; - private Unsafe unsafe; private EstoreOptions options; private int id; private ArrayList dynamicClasses; @@ -63,25 +61,19 @@ public HashMap getLabelClassInfoMap() { return labelClassInfoMap; } - public Estore(String name) throws Exception { + public Estore(String name) { this(name, EstoreOptions.getDefaultOptions()); } - public Estore(String name, EstoreOptions options) throws Exception { + public Estore(String name, EstoreOptions options) { this.name = name; this.options = options; - this.unsafe = null; this.id = 0; datastore = new HashMap(); labelObjectMap = new LabelMap(); labelClassInfoMap = new HashMap(); runtimeClassInfoMap = new HashMap(); dynamicClasses = new ArrayList(); - if (options.getUseUnsafe()) { - Field f = Unsafe.class.getDeclaredField("theUnsafe"); - f.setAccessible(true); - unsafe = (Unsafe) f.get(null); - } } public void addDynamicClass(Class klass) { @@ -121,7 +113,7 @@ public void insert(Object obj) throws EstoreException { } datastore.put(objHashCode, obj); if (labelObjectMap.get(className) == null) { - cInfo = labelObjectMap.putNew(objClass, new ArrayList(), options, unsafe); + cInfo = labelObjectMap.putNew(objClass, new ArrayList()); labelClassInfoMap.put(className, cInfo); } labelObjectMap.get(className).add(obj); @@ -178,15 +170,14 @@ public void captureAllBfs(Object obj) throws EstoreException { if (current instanceof Class) { if (labelClassInfoMap.get(Class.class.getName()) == null) { ClassInfo classCInfo = - labelObjectMap.putNew( - Class.class, new ArrayList<>(), options, unsafe); + labelObjectMap.putNew(Class.class, new ArrayList<>()); labelClassInfoMap.put(Class.class.getName(), classCInfo); } cInfo = labelClassInfoMap.get(Class.class.getName()); labelObjectMap.put(className, labelList); labelClassInfoMap.put(className, cInfo); /* for query execution by label */ } else { - cInfo = labelObjectMap.putNew(objClass, labelList, options, unsafe); + cInfo = labelObjectMap.putNew(objClass, labelList); labelClassInfoMap.put(className, cInfo); } } else { @@ -274,15 +265,14 @@ public void captureAllDfs(Object obj) throws EstoreException { if (current instanceof Class) { if (labelClassInfoMap.get(Class.class.getName()) == null) { ClassInfo classCInfo = - labelObjectMap.putNew( - Class.class, new ArrayList<>(), options, unsafe); + labelObjectMap.putNew(Class.class, new ArrayList<>()); labelClassInfoMap.put(Class.class.getName(), classCInfo); } cInfo = labelClassInfoMap.get(Class.class.getName()); labelObjectMap.put(className, labelList); labelClassInfoMap.put(className, cInfo); } else { - cInfo = labelObjectMap.putNew(objClass, labelList, options, unsafe); + cInfo = labelObjectMap.putNew(objClass, labelList); labelClassInfoMap.put(className, cInfo); } } else { @@ -366,15 +356,14 @@ public void captureAllDfsRec(Object obj) throws EstoreException { ArrayList labelList = new ArrayList(); if (obj instanceof Class) { if (labelClassInfoMap.get(Class.class.getName()) == null) { - ClassInfo classCInfo = - labelObjectMap.putNew(Class.class, new ArrayList<>(), options, unsafe); + ClassInfo classCInfo = labelObjectMap.putNew(Class.class, new ArrayList<>()); labelClassInfoMap.put(Class.class.getName(), classCInfo); } cInfo = labelClassInfoMap.get(Class.class.getName()); labelObjectMap.put(className, labelList); labelClassInfoMap.put(className, cInfo); } else { - cInfo = labelObjectMap.putNew(objClass, labelList, options, unsafe); + cInfo = labelObjectMap.putNew(objClass, labelList); labelClassInfoMap.put(className, cInfo); } } else { @@ -457,15 +446,14 @@ public void captureAll(Object obj, int maxDepth, int currDepth) throws EstoreExc ArrayList labelList = new ArrayList(); if (obj instanceof Class) { if (labelClassInfoMap.get(Class.class.getName()) == null) { - ClassInfo classCInfo = - labelObjectMap.putNew(Class.class, new ArrayList<>(), options, unsafe); + ClassInfo classCInfo = labelObjectMap.putNew(Class.class, new ArrayList<>()); labelClassInfoMap.put(Class.class.getName(), classCInfo); } cInfo = labelClassInfoMap.get(Class.class.getName()); labelObjectMap.put(className, labelList); labelClassInfoMap.put(className, cInfo); } else { - cInfo = labelObjectMap.putNew(objClass, labelList, options, unsafe); + cInfo = labelObjectMap.putNew(objClass, labelList); labelClassInfoMap.put(className, cInfo); } } else { @@ -555,7 +543,7 @@ private ClassInfo getOrCreateClassInfo(Class clazz) { String key = clazz.getName(); ClassInfo cInfo = runtimeClassInfoMap.get(key); if (cInfo != null) return cInfo; - cInfo = ClassInfo.getClassInfo(options.getUseUnsafe(), unsafe, clazz); + cInfo = ClassInfo.getClassInfo(clazz); try { for (Field f : getDeclaredFieldsIncludingSuper(clazz)) { try { @@ -694,12 +682,8 @@ public String getString(Object obj, String fieldName) throws EstoreException { } public static class LabelMap extends HashMap> { - public ClassInfo putNew( - Class classInstance, - ArrayList value, - EstoreOptions options, - Unsafe unsafe) { - ClassInfo cInfo = ClassInfo.getClassInfo(options.getUseUnsafe(), unsafe, classInstance); + public ClassInfo putNew(Class classInstance, ArrayList value) { + ClassInfo cInfo = ClassInfo.getClassInfo(classInstance); if (classInstance.isArray()) { super.put(classInstance.getName(), value); return cInfo; diff --git a/estore/src/main/java/org/estore/EstoreOptions.java b/estore/src/main/java/org/estore/EstoreOptions.java index 0b4213a..845fe14 100644 --- a/estore/src/main/java/org/estore/EstoreOptions.java +++ b/estore/src/main/java/org/estore/EstoreOptions.java @@ -1,7 +1,6 @@ package org.estore; public class EstoreOptions { - private boolean useUnsafe; private boolean useDfs; private boolean useRecursion; private boolean profileParseTreeGenTime; @@ -10,7 +9,6 @@ public class EstoreOptions { private boolean profileTotalQueryTime; public EstoreOptions() { - useUnsafe = true; useDfs = false; useRecursion = false; profileParseTreeGenTime = false; @@ -23,11 +21,6 @@ public static EstoreOptions getDefaultOptions() { return new EstoreOptions(); } - public EstoreOptions useUnsafe(boolean flag) { - useUnsafe = flag; - return this; - } - public EstoreOptions useDfs(boolean flag) { useDfs = flag; return this; @@ -66,10 +59,6 @@ public EstoreOptions profileTotalQueryTime(boolean flag) { return this; } - public boolean getUseUnsafe() { - return useUnsafe; - } - public boolean getUseDfs() { return useDfs; } diff --git a/estore/src/main/java/org/estore/Main.java b/estore/src/main/java/org/estore/Main.java index cb3991a..767ae06 100644 --- a/estore/src/main/java/org/estore/Main.java +++ b/estore/src/main/java/org/estore/Main.java @@ -10,11 +10,9 @@ public class Main { public static void main(String[] args) { boolean exit = false; int port = 1234; - boolean unsafeFlag = false; if (args.length > 0) { try { port = Integer.parseInt(args[0]); - unsafeFlag = Boolean.parseBoolean(args[1]); } catch (Exception e) { System.err.println("Invalid argument"); System.exit(1); @@ -22,7 +20,7 @@ public static void main(String[] args) { } try (ServerSocket serverSocket = new ServerSocket(port)) { - Estore estore = new Estore("testDb", new EstoreOptions().useUnsafe(unsafeFlag)); + Estore estore = new Estore("testDb"); while (!exit) { try (Socket clientSocket = serverSocket.accept(); BufferedReader in = diff --git a/estore/src/main/java/org/estore/compiler/ImplCodeGen.java b/estore/src/main/java/org/estore/compiler/ImplCodeGen.java index 9e01f8c..a7eac52 100644 --- a/estore/src/main/java/org/estore/compiler/ImplCodeGen.java +++ b/estore/src/main/java/org/estore/compiler/ImplCodeGen.java @@ -9,6 +9,7 @@ import com.github.javaparser.ast.expr.MethodCallExpr; import com.github.javaparser.ast.visitor.VoidVisitorAdapter; import java.io.File; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.antlr.v4.runtime.CharStreams; @@ -133,7 +134,7 @@ private static String getDefaultOutputFilePath(String inputFilePath) { return Paths.get(parentDir, "Transformed" + fileName).toString(); } - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws IOException { String inputFilePath = args.length > 0 ? args[0] : DEFAULT_INPUT_FILE_PATH; String outputFilePath = args.length > 1 ? args[1] : getDefaultOutputFilePath(inputFilePath); CompilationUnit cu = StaticJavaParser.parse(Files.newInputStream(Paths.get(inputFilePath))); diff --git a/estore/src/main/java/org/estore/planner/util/ClassInfo.java b/estore/src/main/java/org/estore/planner/util/ClassInfo.java index 7eae885..eaee9f9 100644 --- a/estore/src/main/java/org/estore/planner/util/ClassInfo.java +++ b/estore/src/main/java/org/estore/planner/util/ClassInfo.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.List; import java.util.Set; -import sun.misc.Unsafe; public abstract class ClassInfo { protected HashMap referenceFieldTypeMap; @@ -14,15 +13,11 @@ public abstract class ClassInfo { protected HashMap primitiveFieldTypeMap; public Class classInstance; - public static ClassInfo getClassInfo(boolean useUnsafe, Unsafe unsafe, Class classInstance) { + public static ClassInfo getClassInfo(Class classInstance) { if (classInstance.isArray()) { return new ArrayClassInfoReflectionImpl(classInstance); } - if (useUnsafe) { - return new ClassInfoUnsafeImpl(unsafe, classInstance); - } else { - return new ClassInfoReflectionImpl(classInstance); - } + return new ClassInfoReflectionImpl(classInstance); } public abstract void addPrimitiveField(Field field); diff --git a/estore/src/main/java/org/estore/planner/util/ClassInfoUnsafeImpl.java b/estore/src/main/java/org/estore/planner/util/ClassInfoUnsafeImpl.java deleted file mode 100644 index 5d9cb97..0000000 --- a/estore/src/main/java/org/estore/planner/util/ClassInfoUnsafeImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -package org.estore.planner.util; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import sun.misc.Unsafe; - -public class ClassInfoUnsafeImpl extends ClassInfo { - protected Unsafe unsafe; - protected HashMap primitiveFieldMap = new HashMap(); - protected HashMap referenceFieldMap = new HashMap(); - protected Set staticFields; - - public ClassInfoUnsafeImpl(Unsafe unsafe, Class classInstance) { - primitiveFieldMap = new HashMap(); - referenceFieldMap = new HashMap(); - referenceFieldTypeMap = new HashMap(); - primitiveFieldTypeMap = new HashMap(); - staticFields = new HashSet(); - this.classInstance = classInstance; - this.unsafe = unsafe; - } - - @Override - public void addPrimitiveField(Field field) { - String fieldName = field.getName(); - if (Modifier.isStatic(field.getModifiers())) { - staticFields.add(fieldName); - primitiveFieldMap.put(fieldName, unsafe.staticFieldOffset(field)); - } else { - primitiveFieldMap.put(fieldName, unsafe.objectFieldOffset(field)); - } - primitiveFieldTypeMap.put(fieldName, field.getType().getName()); - } - - @Override - public void addReferenceField(Field field) { - String fieldName = field.getName(); - if (Modifier.isStatic(field.getModifiers())) { - staticFields.add(fieldName); - referenceFieldMap.put(fieldName, unsafe.staticFieldOffset(field)); - } else { - referenceFieldMap.put(fieldName, unsafe.objectFieldOffset(field)); - } - if (field.getType().isArray()) { - referenceFieldTypeMap.put(fieldName, field.getType().getComponentType().getName()); - } else { - referenceFieldTypeMap.put(fieldName, field.getType().getName()); - } - } - - @Override - public Object getPrimitiveField(String fieldName, String fieldType, Object instance) { - String classFieldType = primitiveFieldTypeMap.get(fieldName); - if (classFieldType == null) { - return null; - } - long fieldOffset; - - /* Note: classFieldType is guaranteed to exist since field names and types are - * checked with an instance's Class instance before this method is invoked - * on an instance to get its value. The null check is avoided for speedup - */ - try { - switch (classFieldType) { - case "byte": - if (fieldType != null && !TypeUtils.isDecimalType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getByte(instance, fieldOffset); - case "short": - if (fieldType != null && !TypeUtils.isDecimalType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getShort(instance, fieldOffset); - case "int": - if (fieldType != null && !TypeUtils.isDecimalType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getInt(instance, fieldOffset); - case "long": - if (fieldType != null && !TypeUtils.isDecimalType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getLong(instance, fieldOffset); - case "float": - if (fieldType != null && !TypeUtils.isFloatingType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getFloat(instance, fieldOffset); - case "double": - if (fieldType != null && !TypeUtils.isFloatingType(fieldType)) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getDouble(instance, fieldOffset); - case "boolean": - if (fieldType != null && !fieldType.equals("boolean")) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getBoolean(instance, fieldOffset); - case "char": - if (fieldType != null && !fieldType.equals("char")) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getChar(instance, fieldOffset); - case "java.lang.String": - if (fieldType != null && !fieldType.equals("java.lang.String")) { - return null; - } - fieldOffset = primitiveFieldMap.get(fieldName); - return unsafe.getObject(instance, fieldOffset); - default: - return null; - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - @Override - public List getReferenceField(String fieldName, Object instance) { - long fieldOffset = referenceFieldMap.get(fieldName); - if (fieldOffset < 0) { - return null; - } - try { - Object obj = null; - List elements = new ArrayList(); - if (staticFields.contains(fieldName)) { - obj = unsafe.getObject(instance.getClass(), fieldOffset); - } else { - obj = unsafe.getObject(instance, fieldOffset); - } - if (obj == null) { - return elements; - } - Class objClass = obj.getClass(); - if (objClass.isArray()) { - if (obj instanceof byte[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(byte[].class); - int arrayIndexScale = unsafe.arrayIndexScale(byte[].class); - int length = ((byte[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getByte(obj, offset)); - } - } else if (obj instanceof short[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(short[].class); - int arrayIndexScale = unsafe.arrayIndexScale(short[].class); - int length = ((short[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getShort(obj, offset)); - } - } else if (obj instanceof int[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(int[].class); - int arrayIndexScale = unsafe.arrayIndexScale(int[].class); - int length = ((int[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getInt(obj, offset)); - } - } else if (obj instanceof long[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(long[].class); - int arrayIndexScale = unsafe.arrayIndexScale(long[].class); - int length = ((long[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getLong(obj, offset)); - } - } else if (obj instanceof float[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(float[].class); - int arrayIndexScale = unsafe.arrayIndexScale(float[].class); - int length = ((float[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getFloat(obj, offset)); - } - } else if (obj instanceof double[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(double[].class); - int arrayIndexScale = unsafe.arrayIndexScale(double[].class); - int length = ((double[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getDouble(obj, offset)); - } - } else if (obj instanceof boolean[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(boolean[].class); - int arrayIndexScale = unsafe.arrayIndexScale(boolean[].class); - int length = ((boolean[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getBoolean(obj, offset)); - } - } else if (obj instanceof char[]) { - int arrayBaseOffset = unsafe.arrayBaseOffset(char[].class); - int arrayIndexScale = unsafe.arrayIndexScale(char[].class); - int length = ((char[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getChar(obj, offset)); - } - } else { - int arrayBaseOffset = unsafe.arrayBaseOffset(Object[].class); - int arrayIndexScale = unsafe.arrayIndexScale(Object[].class); - int length = ((Object[]) obj).length; - - for (int j = 0; j < length; j++) { - int offset = arrayBaseOffset + arrayIndexScale * j; - elements.add(unsafe.getObject(obj, offset)); - } - } - return elements; - } else { - elements.add(obj); - return elements; - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - @Override - public boolean containsPrimitiveFieldWithName(String fieldName) { - return primitiveFieldMap.get(fieldName) != null; - } - - @Override - public boolean containsReferenceFieldWithName(String fieldName, Object instance) { - return referenceFieldMap.get(fieldName) != null; - } - - @Override - public Set getReferenceFieldNames(Object instance) { - return referenceFieldMap.keySet(); - } - - @Override - public Set getPrimitiveFieldNames() { - return primitiveFieldMap.keySet(); - } - - @Override - public int getReferenceFieldCount() { - return referenceFieldMap.size(); - } -} diff --git a/estore/src/test/java/org/estore/AggregateFunctionTest.java b/estore/src/test/java/org/estore/AggregateFunctionTest.java index 0a83a28..59c98b6 100644 --- a/estore/src/test/java/org/estore/AggregateFunctionTest.java +++ b/estore/src/test/java/org/estore/AggregateFunctionTest.java @@ -11,8 +11,8 @@ public class AggregateFunctionTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = new Estore(AggregateFunctionTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setUp() throws EstoreException { + db = new Estore(AggregateFunctionTest.class.getName()); Person c = new Person("C", 30); Person b = new Person("B", 40, c); Person a = new Person("A", 20, b); @@ -20,25 +20,25 @@ void setUp() throws Exception { } @Test - void maxReturnsLargestAge() throws Exception { + void maxReturnsLargestAge() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN max(p.age)"); assertEquals(40, result.get("MAX(p.age)").get(0)); } @Test - void minReturnsSmallestAge() throws Exception { + void minReturnsSmallestAge() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN min(p.age)"); assertEquals(20, result.get("MIN(p.age)").get(0)); } @Test - void sumReturnsTotalAge() throws Exception { + void sumReturnsTotalAge() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN sum(p.age)"); assertEquals(90, result.get("SUM(p.age)").get(0)); } @Test - void avgReturnsMeanAge() throws Exception { + void avgReturnsMeanAge() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN avg(p.age)"); assertEquals(30.0, result.get("AVG(p.age)").get(0)); } diff --git a/estore/src/test/java/org/estore/AnonymousRelationTest.java b/estore/src/test/java/org/estore/AnonymousRelationTest.java index 30ce756..8861e4d 100644 --- a/estore/src/test/java/org/estore/AnonymousRelationTest.java +++ b/estore/src/test/java/org/estore/AnonymousRelationTest.java @@ -11,12 +11,12 @@ public class AnonymousRelationTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = new Estore(AnonymousRelationTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(AnonymousRelationTest.class.getName()); } @Test - void bareArrowMatchesEmptyBrackets() throws Exception { + void bareArrowMatchesEmptyBrackets() throws EstoreException { Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); db.captureAll(alice); diff --git a/estore/src/test/java/org/estore/ArithmeticTest.java b/estore/src/test/java/org/estore/ArithmeticTest.java index 9c61ee3..645892e 100644 --- a/estore/src/test/java/org/estore/ArithmeticTest.java +++ b/estore/src/test/java/org/estore/ArithmeticTest.java @@ -10,12 +10,12 @@ public class ArithmeticTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = new Estore(ArithmeticTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(ArithmeticTest.class.getName()); } @Test - void fourOperationsAndCountDivide() throws Exception { + void fourOperationsAndCountDivide() { db.query("CREATE (n:`ArithNode`)"); db.query("CREATE (n:`ArithNode`)"); diff --git a/estore/src/test/java/org/estore/CaptureModeTest.java b/estore/src/test/java/org/estore/CaptureModeTest.java index 429415c..a4481d1 100644 --- a/estore/src/test/java/org/estore/CaptureModeTest.java +++ b/estore/src/test/java/org/estore/CaptureModeTest.java @@ -9,7 +9,7 @@ public class CaptureModeTest { @Test - void iterativeDfsCapturesPersonChain() throws Exception { + void iterativeDfsCapturesPersonChain() throws EstoreException { Estore db = new Estore(CaptureModeTest.class.getName(), new EstoreOptions().useDfs(true)); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); @@ -21,7 +21,7 @@ void iterativeDfsCapturesPersonChain() throws Exception { } @Test - void recursiveDfsCapturesPersonChain() throws Exception { + void recursiveDfsCapturesPersonChain() throws EstoreException { Estore db = new Estore( CaptureModeTest.class.getName(), @@ -36,7 +36,7 @@ void recursiveDfsCapturesPersonChain() throws Exception { } @Test - void depthLimitedCaptureStops() throws Exception { + void depthLimitedCaptureStops() throws EstoreException { Estore db = new Estore(CaptureModeTest.class.getName()); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); diff --git a/estore/src/test/java/org/estore/CaseExpressionTest.java b/estore/src/test/java/org/estore/CaseExpressionTest.java index 3627193..41c7630 100644 --- a/estore/src/test/java/org/estore/CaseExpressionTest.java +++ b/estore/src/test/java/org/estore/CaseExpressionTest.java @@ -11,13 +11,13 @@ public class CaseExpressionTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(CaseExpressionTest.class.getName()); db.captureAll(new Person("A", 20)); } @Test - void caseReturnsElseWhenPredicateIsFalse() throws Exception { + void caseReturnsElseWhenPredicateIsFalse() { Table result = db.query( "MATCH (p:`org.estore.example.Person`) RETURN CASE WHEN p.age > 25 THEN 1 ELSE 0 END"); @@ -25,7 +25,7 @@ void caseReturnsElseWhenPredicateIsFalse() throws Exception { } @Test - void caseReturnsThenWhenPredicateIsTrue() throws Exception { + void caseReturnsThenWhenPredicateIsTrue() { Table result = db.query( "MATCH (p:`org.estore.example.Person`) RETURN CASE WHEN p.age > 15 THEN 1 ELSE 0 END"); @@ -33,7 +33,7 @@ void caseReturnsThenWhenPredicateIsTrue() throws Exception { } @Test - void caseMatchesSubject() throws Exception { + void caseMatchesSubject() { Table result = db.query( "MATCH (p:`org.estore.example.Person`) RETURN CASE p.name WHEN 'A' THEN 1 ELSE 0 END"); @@ -41,7 +41,7 @@ void caseMatchesSubject() throws Exception { } @Test - void caseWithoutElseIsNullWhenNoWhenMatches() throws Exception { + void caseWithoutElseIsNullWhenNoWhenMatches() { Table result = db.query( "MATCH (p:`org.estore.example.Person`) RETURN CASE WHEN p.age > 99 THEN 1 END"); diff --git a/estore/src/test/java/org/estore/CountDistinctTest.java b/estore/src/test/java/org/estore/CountDistinctTest.java index fbf2a49..702e122 100644 --- a/estore/src/test/java/org/estore/CountDistinctTest.java +++ b/estore/src/test/java/org/estore/CountDistinctTest.java @@ -11,12 +11,12 @@ public class CountDistinctTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = new Estore(CountDistinctTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(CountDistinctTest.class.getName()); } @Test - void countDistinctIsOneWhenCountIsTwo() throws Exception { + void countDistinctIsOneWhenCountIsTwo() throws EstoreException { // Keanu -> Carrie -> Guy // Keanu -> Liam -> Guy Person guy = new Person("Guy", 40); diff --git a/estore/src/test/java/org/estore/CreateInstanceTest.java b/estore/src/test/java/org/estore/CreateInstanceTest.java index d0a39f1..3f6bc9c 100644 --- a/estore/src/test/java/org/estore/CreateInstanceTest.java +++ b/estore/src/test/java/org/estore/CreateInstanceTest.java @@ -27,14 +27,7 @@ public class CreateInstanceTest { @BeforeEach public void initDatabase() { - try { - estore = - new Estore( - CreateInstanceTest.class.getName(), - new EstoreOptions().useUnsafe(true).useDfs(false)); - } catch (Exception e) { - e.printStackTrace(); - } + estore = new Estore(CreateInstanceTest.class.getName(), new EstoreOptions().useDfs(false)); } /* @@ -48,7 +41,7 @@ public void initDatabase() { * } * * @RepeatedTest(50) - * void testNodeAddPropertyESTOREEval() throws Exception { + * void testNodeAddPropertyESTOREEval() { * long t1 = System.currentTimeMillis(); * estore.add(A.class); */ @@ -68,7 +61,7 @@ public void initDatabase() { * } * * @Test - * void createDropNodeLongStringPropertyESTOREEval() throws Exception { + * void createDropNodeLongStringPropertyESTOREEval() { * String testPropertyKey = "testProperty"; * String propertyValue = RandomStringUtils.randomAlphanumeric(255); * @@ -83,7 +76,7 @@ public void initDatabase() { * } * * @Test - * void createObjectWithJ() throws Exception { + * void createObjectWithJ() { * estore.add("create (n: `Val` {value: 30}) return n"); * Object[] objs = estore.query(true, "match (n: `Val`) return n"); * @@ -96,7 +89,7 @@ public void initDatabase() { * } * * @Test - * void createObjectWithD() throws Exception { + * void createObjectWithD() { * estore.add("create (n: `Val` {value: 30.0}) return n"); * Object[] objs = estore.query(true, "match (n: `Val`) return n"); * @@ -109,7 +102,7 @@ public void initDatabase() { * } * * @Test - * void createObjectWithString() throws Exception { + * void createObjectWithString() { * estore.add("create (n: `Val` {value: 'something'}) return n"); * Object[] objs = estore.query(true, "match (n: `Val`) return n"); * @@ -123,7 +116,7 @@ public void initDatabase() { * } * * @Test - * void createObjectWithManyTypes() throws Exception { + * void createObjectWithManyTypes() { * estore.add("create (n: `Val` {i: 30, d: 30.0, s: 'something'}) return n"); * Object[] objs = estore.query(true, "match (n: `Val`) return n"); * @@ -423,7 +416,7 @@ void testNodeAddPropertyCypher() { } @Test - void testNodeAddPropertyCypher2() throws Exception { + void testNodeAddPropertyCypher2() throws ReflectiveOperationException { Table result = estore.query("CREATE (n:`DummyClass3` {name:'Uki', age:30}) RETURN n"); Object obj = result.get("n").get(0); Class objClass = obj.getClass(); @@ -434,7 +427,7 @@ void testNodeAddPropertyCypher2() throws Exception { } @Test - void testArrayList() throws Exception { + void testArrayList() throws EstoreException { ArrayList a = new ArrayList(); a.add(10L); a.add(20L); @@ -448,7 +441,7 @@ void testArrayList() throws Exception { } @Test - void testLinkedList() throws Exception { + void testLinkedList() throws EstoreException { LinkedList a = new LinkedList(); ThreadLocalRandom rand = ThreadLocalRandom.current(); for (long j = 0; j < 10000; j++) { @@ -466,7 +459,7 @@ void testLinkedList() throws Exception { } @Test - void testLinkedList2() throws Exception { + void testLinkedList2() throws EstoreException { LinkedList a = new LinkedList(); ThreadLocalRandom rand = ThreadLocalRandom.current(); for (int j = 0; j < 100000; j++) { @@ -486,7 +479,7 @@ void testLinkedList2() throws Exception { } @Test - void testLinkedList3() throws Exception { + void testLinkedList3() throws EstoreException { LinkedList a = new LinkedList(); ThreadLocalRandom rand = ThreadLocalRandom.current(); for (int j = 0; j < 50; j++) { @@ -505,7 +498,7 @@ void testLinkedList3() throws Exception { } @Test - void testArrayDeque() throws Exception { + void testArrayDeque() throws EstoreException { ArrayDeque a = new ArrayDeque(); a.add(10L); a.add(20L); @@ -538,7 +531,7 @@ void testArrayListIteration() { } @Test - void testVector() throws Exception { + void testVector() throws EstoreException { Vector a = new Vector(); a.add(10L); a.add(20L); @@ -551,7 +544,7 @@ void testVector() throws Exception { } @Test - void testHashMap() throws Exception { + void testHashMap() throws EstoreException { HashMap a = new HashMap(); a.put(10L, 10L); a.put(20L, 20L); @@ -564,7 +557,7 @@ void testHashMap() throws Exception { } @Test - void testConcurrentHashMap() throws Exception { + void testConcurrentHashMap() throws EstoreException { ConcurrentHashMap a = new ConcurrentHashMap(); a.put("TABLE1", 10L); a.put("TABLE2", 20L); diff --git a/estore/src/test/java/org/estore/DbMetadataTest/EstoreMetadataTest.java b/estore/src/test/java/org/estore/DbMetadataTest/EstoreMetadataTest.java index 1361da0..53cc555 100644 --- a/estore/src/test/java/org/estore/DbMetadataTest/EstoreMetadataTest.java +++ b/estore/src/test/java/org/estore/DbMetadataTest/EstoreMetadataTest.java @@ -3,40 +3,39 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.estore.Estore; +import org.estore.EstoreException; import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class EstoreMetadataTest { - private Estore estore1, estore2, estore_u1, estore_u2, estore_u3, estore_r1, estore_r2; + private Estore estore1, estore2, estore_d1, estore_d2, estore_d3, estore_b1, estore_b2; @BeforeEach - public void setup() throws Exception { - String unsafeOpt = System.getProperty("useUnsafe"); - Boolean unsafeFlag = (unsafeOpt != null) && (unsafeOpt.equals("true")); + public void setup() { String profileOpt = System.getProperty("profile"); Boolean profileFlag = (profileOpt != null) && (profileOpt.equals("true")); estore1 = new Estore( EstoreMetadataTest.class.getName(), - new EstoreOptions().useUnsafe(unsafeFlag).profile(profileFlag)); + new EstoreOptions().profile(profileFlag)); estore2 = new Estore( EstoreMetadataTest.class.getName() + "2", - new EstoreOptions().useUnsafe(unsafeFlag).profile(false)); + new EstoreOptions().profile(false)); } @Test - public void testDbName() throws Exception { + public void testDbName() throws EstoreException { estore1.captureAll(estore2); Table res = estore1.query("MATCH (n: `org.estore.Estore`) RETURN n.name"); assertEquals(EstoreMetadataTest.class.getName() + "2", res.get("n.name").get(0)); } @Test - public void testDbNameRepeat() throws Exception { + public void testDbNameRepeat() throws EstoreException { estore1.captureAll(estore2); Table res = null; for (int i = 0; i < 5; i++) { @@ -46,84 +45,78 @@ public void testDbNameRepeat() throws Exception { } @Test - public void testOptions() throws Exception { - estore_u1 = + public void testOptions() throws EstoreException { + estore_d1 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe1", - new EstoreOptions().useUnsafe(true)); - estore_u2 = + EstoreMetadataTest.class.getName() + "Dfs1", + new EstoreOptions().useDfs(true)); + estore_d2 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe2", - new EstoreOptions().useUnsafe(true)); - estore_u3 = + EstoreMetadataTest.class.getName() + "Dfs2", + new EstoreOptions().useDfs(true)); + estore_d3 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe3", - new EstoreOptions().useUnsafe(true)); - estore_r1 = + EstoreMetadataTest.class.getName() + "Dfs3", + new EstoreOptions().useDfs(true)); + estore_b1 = new Estore( - EstoreMetadataTest.class.getName() + "Reflection1", - new EstoreOptions().useUnsafe(false)); - estore_r2 = + EstoreMetadataTest.class.getName() + "Bfs1", + new EstoreOptions().useDfs(false)); + estore_b2 = new Estore( - EstoreMetadataTest.class.getName() + "Reflection2", - new EstoreOptions().useUnsafe(false)); - estore1.captureAll(estore_u1); - estore1.captureAll(estore_u2); - estore1.captureAll(estore_u3); - estore1.captureAll(estore_r1); - estore1.captureAll(estore_r2); + EstoreMetadataTest.class.getName() + "Bfs2", + new EstoreOptions().useDfs(false)); + estore1.captureAll(estore_d1); + estore1.captureAll(estore_d2); + estore1.captureAll(estore_d3); + estore1.captureAll(estore_b1); + estore1.captureAll(estore_b2); Table res = estore1.query( - "MATCH (n: `org.estore.Estore`)-[:options]->(m {useUnsafe: true}) RETURN n"); + "MATCH (n: `org.estore.Estore`)-[:options]->(m {useDfs: true}) RETURN n"); assertEquals(3, res.getSize()); } @Test - public void testOptionsRepeat() throws Exception { - estore_u1 = + public void testOptionsRepeat() throws EstoreException { + estore_d1 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe1", - new EstoreOptions().useUnsafe(true)); - estore_u2 = + EstoreMetadataTest.class.getName() + "Dfs1", + new EstoreOptions().useDfs(true)); + estore_d2 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe2", - new EstoreOptions().useUnsafe(true)); - estore_u3 = + EstoreMetadataTest.class.getName() + "Dfs2", + new EstoreOptions().useDfs(true)); + estore_d3 = new Estore( - EstoreMetadataTest.class.getName() + "Unsafe3", - new EstoreOptions().useUnsafe(true)); - estore_r1 = + EstoreMetadataTest.class.getName() + "Dfs3", + new EstoreOptions().useDfs(true)); + estore_b1 = new Estore( - EstoreMetadataTest.class.getName() + "Reflection1", - new EstoreOptions().useUnsafe(false)); - estore_r2 = + EstoreMetadataTest.class.getName() + "Bfs1", + new EstoreOptions().useDfs(false)); + estore_b2 = new Estore( - EstoreMetadataTest.class.getName() + "Reflection2", - new EstoreOptions().useUnsafe(false)); - estore1.captureAll(estore_u1); - estore1.captureAll(estore_u2); - estore1.captureAll(estore_u3); - estore1.captureAll(estore_r1); - estore1.captureAll(estore_r2); + EstoreMetadataTest.class.getName() + "Bfs2", + new EstoreOptions().useDfs(false)); + estore1.captureAll(estore_d1); + estore1.captureAll(estore_d2); + estore1.captureAll(estore_d3); + estore1.captureAll(estore_b1); + estore1.captureAll(estore_b2); Table res = null; for (int i = 0; i < 5; i++) { res = estore1.query( - "MATCH (n: `org.estore.Estore`)-[:options]->(m {useUnsafe: true}) RETURN n"); + "MATCH (n: `org.estore.Estore`)-[:options]->(m {useDfs: true}) RETURN n"); } assertEquals(3, res.getSize()); } @Test - public void testDynamicClass() throws Exception { + public void testDynamicClass() throws EstoreException { estore2.query("CREATE (n: `Sample`)"); estore1.captureAll(estore2); - // Table res = - // estore1.query( - // "MATCH (n:" - // + " - // `org.estore.Estore`)-[:dynamicClasses]->(:`java.util.ArrayList`)-[:elementData]->(m" - // + " {name: 'Sample'}) RETURN m"); Table res = estore1.query( "MATCH (n:" @@ -133,7 +126,7 @@ public void testDynamicClass() throws Exception { } @Test - public void testDynamicClassRepeat() throws Exception { + public void testDynamicClassRepeat() throws EstoreException { estore2.query("CREATE (n: `Sample`)"); estore1.captureAll(estore2); Table res = null; @@ -142,8 +135,6 @@ public void testDynamicClassRepeat() throws Exception { estore1.query( "MATCH (n:" + " `org.estore.Estore`)-[:dynamicClasses]->()-[:elementData]" - // dynamicClasses is an arraylist of , - // but Class doesn't have element data + "->(m {name: 'Sample'}) RETURN m"); } assertEquals(1, res.getSize()); diff --git a/estore/src/test/java/org/estore/DbMetadataTest/H2MetadataTest.java b/estore/src/test/java/org/estore/DbMetadataTest/H2MetadataTest.java index 27479cb..ab8ec6d 100644 --- a/estore/src/test/java/org/estore/DbMetadataTest/H2MetadataTest.java +++ b/estore/src/test/java/org/estore/DbMetadataTest/H2MetadataTest.java @@ -8,10 +8,12 @@ import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Statement; import java.util.HashSet; import java.util.Set; import org.estore.Estore; +import org.estore.EstoreException; import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.AfterEach; @@ -23,27 +25,24 @@ public class H2MetadataTest { private Estore estore1; @BeforeEach - public void setup() throws Exception { - String unsafeOpt = System.getProperty("useUnsafe"); - Boolean unsafeFlag = (unsafeOpt != null) && (unsafeOpt.equals("true")); + public void setup() throws ClassNotFoundException, SQLException { String profileOpt = System.getProperty("profile"); Boolean profileFlag = (profileOpt != null) && (profileOpt.equals("true")); estore1 = new Estore( - H2MetadataTest.class.getName(), - new EstoreOptions().useUnsafe(unsafeFlag).profile(profileFlag)); + H2MetadataTest.class.getName(), new EstoreOptions().profile(profileFlag)); Class.forName("org.h2.Driver"); h2Conn1 = DriverManager.getConnection("jdbc:h2:mem:h2TestDb1", "sa", ""); } @Test - public void testConnection() throws Exception { + public void testConnection() { assertNotNull(h2Conn1, "Connection should not be null"); } @Test - public void testSimpleQueryExecution() throws Exception { + public void testSimpleQueryExecution() throws SQLException { // test the connection works by executing a simple query try (Statement stmt = h2Conn1.createStatement()) { ResultSet rs = stmt.executeQuery("SELECT 1"); @@ -53,7 +52,7 @@ public void testSimpleQueryExecution() throws Exception { } @Test - public void testCatalogsESTORE() throws Exception { + public void testCatalogsESTORE() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t1 = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t1); @@ -69,7 +68,7 @@ public void testCatalogsESTORE() throws Exception { } @Test - public void testCatalogsESTORERepeat() throws Exception { + public void testCatalogsESTORERepeat() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t1 = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t1); @@ -88,7 +87,7 @@ public void testCatalogsESTORERepeat() throws Exception { } @Test - public void testCatalogsJDBC() throws Exception { + public void testCatalogsJDBC() throws SQLException { long t1 = System.nanoTime(); DatabaseMetaData meta1 = h2Conn1.getMetaData(); ResultSet res1 = meta1.getCatalogs(); @@ -105,7 +104,7 @@ public void testCatalogsJDBC() throws Exception { } @Test - public void testCatalogsJDBCRepeat() throws Exception { + public void testCatalogsJDBCRepeat() throws SQLException { ResultSet res1 = null; for (int i = 0; i < 5; i++) { long t1 = System.nanoTime(); @@ -125,7 +124,7 @@ public void testCatalogsJDBCRepeat() throws Exception { } @Test - public void testSchemasESTORE() throws Exception { + public void testSchemasESTORE() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t1 = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t1); @@ -152,7 +151,7 @@ public void testSchemasESTORE() throws Exception { } @Test - public void testSchemasESTORERepeat() throws Exception { + public void testSchemasESTORERepeat() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t1 = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t1); @@ -180,7 +179,7 @@ public void testSchemasESTORERepeat() throws Exception { } @Test - public void testSchemasJDBC() throws Exception { + public void testSchemasJDBC() throws SQLException { long t1 = System.nanoTime(); DatabaseMetaData meta1 = h2Conn1.getMetaData(); ResultSet res1 = meta1.getSchemas(); @@ -198,7 +197,7 @@ public void testSchemasJDBC() throws Exception { } @Test - public void testSchemasJDBCRepeat() throws Exception { + public void testSchemasJDBCRepeat() throws SQLException { ResultSet res1 = null; for (int i = 0; i < 5; i++) { long t1 = System.nanoTime(); @@ -219,7 +218,7 @@ public void testSchemasJDBCRepeat() throws Exception { } @Test - public void testTablesESTORE() throws Exception { + public void testTablesESTORE() throws ClassNotFoundException, SQLException, EstoreException { // Create new tables Statement stmt = h2Conn1.createStatement(); stmt.execute( @@ -252,7 +251,8 @@ public void testTablesESTORE() throws Exception { } @Test - public void testTablesESTORERepeat() throws Exception { + public void testTablesESTORERepeat() + throws ClassNotFoundException, SQLException, EstoreException { // Create new tables Statement stmt = h2Conn1.createStatement(); stmt.execute( @@ -283,7 +283,7 @@ public void testTablesESTORERepeat() throws Exception { } @Test - public void testTablesJDBC() throws Exception { + public void testTablesJDBC() throws SQLException { // Create new tables Statement stmt = h2Conn1.createStatement(); stmt.execute( @@ -307,7 +307,7 @@ public void testTablesJDBC() throws Exception { } @Test - public void testTablesJDBCRepeat() throws Exception { + public void testTablesJDBCRepeat() throws SQLException { // Create new tables Statement stmt = h2Conn1.createStatement(); stmt.execute( @@ -334,7 +334,7 @@ public void testTablesJDBCRepeat() throws Exception { } @Test - public void testDbNameESTORE() throws Exception { + public void testDbNameESTORE() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t1 = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t1); @@ -350,7 +350,7 @@ public void testDbNameESTORE() throws Exception { } @Test - public void testUsersESTORE() throws Exception { + public void testUsersESTORE() throws ClassNotFoundException, SQLException, EstoreException { // create new user Statement stmt = h2Conn1.createStatement(); stmt.execute("CREATE USER IF NOT EXISTS USER1 PASSWORD 'password1'"); @@ -376,7 +376,7 @@ public void testUsersESTORE() throws Exception { } @AfterEach - public void drop() throws Exception { + public void drop() throws SQLException { if (h2Conn1 != null) { h2Conn1.close(); } diff --git a/estore/src/test/java/org/estore/IncomingRelationTest.java b/estore/src/test/java/org/estore/IncomingRelationTest.java index 8d1e31c..03b2e5b 100644 --- a/estore/src/test/java/org/estore/IncomingRelationTest.java +++ b/estore/src/test/java/org/estore/IncomingRelationTest.java @@ -11,7 +11,7 @@ public class IncomingRelationTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(IncomingRelationTest.class.getName()); Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); @@ -19,7 +19,7 @@ void setUp() throws Exception { } @Test - void incomingTypedEdgeFindsReferrer() throws Exception { + void incomingTypedEdgeFindsReferrer() { Table result = db.query( "MATCH (b:`org.estore.example.Person`)<-[:friend]-(a:`org.estore.example.Person`) RETURN a"); @@ -28,7 +28,7 @@ void incomingTypedEdgeFindsReferrer() throws Exception { } @Test - void incomingVarLengthFindsReferrer() throws Exception { + void incomingVarLengthFindsReferrer() { Table result = db.query( "MATCH (a:`org.estore.example.Person`)<-[*1..2]-(b:`org.estore.example.Person`) RETURN b"); diff --git a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java index 1c5e6e6..26a3bf8 100644 --- a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java +++ b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java @@ -17,16 +17,13 @@ public class MultiDimensionalArrayTest { private ThreadLocalRandom rand; @BeforeEach - public void setup() throws Exception { + public void setup() { rand = ThreadLocalRandom.current(); - db = - new Estore( - MultiDimensionalArrayTest.class.getName(), - new EstoreOptions().useUnsafe(false)); + db = new Estore(MultiDimensionalArrayTest.class.getName()); } @Test - public void testSimple3DMatrix() throws Exception { + public void testSimple3DMatrix() throws EstoreException { String[][][] m = new String[][][] {{{"a", "b"}, {"c", "d"}}, {{"e", "f"}, {"g", "h"}}}; db.captureAll(m); @@ -39,7 +36,7 @@ public void testSimple3DMatrix() throws Exception { } @Test - public void testLongMatrix2D_varLength() throws Exception { + public void testLongMatrix2D_varLength() throws EstoreException { Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 3; @@ -62,7 +59,7 @@ public void testLongMatrix2D_varLength() throws Exception { } @Test - public void testLongMatrix2D_indexed() throws Exception { + public void testLongMatrix2D_indexed() throws EstoreException { Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 2; @@ -87,7 +84,7 @@ public void testLongMatrix2D_indexed() throws Exception { } @Test - public void testIntMatrix2D_varLength() throws Exception { + public void testIntMatrix2D_varLength() throws EstoreException { int[][] grid = new int[8][8]; int target = 4242; int ti = 1; @@ -110,7 +107,7 @@ public void testIntMatrix2D_varLength() throws Exception { } @Test - public void testIntMatrix2D_indexed() throws Exception { + public void testIntMatrix2D_indexed() throws EstoreException { int[][] grid = new int[8][8]; int target = 7777; int ti = 0; @@ -135,7 +132,7 @@ public void testIntMatrix2D_indexed() throws Exception { } @Test - public void testObjectMatrix3D_varLength() throws Exception { + public void testObjectMatrix3D_varLength() throws EstoreException { Object[][][] cube = new Object[4][4][4]; long target = rand.nextLong(0, Long.MAX_VALUE); int a = 1; @@ -164,7 +161,7 @@ public void testObjectMatrix3D_varLength() throws Exception { } @Test - public void testObjectMatrix3D_indexed() throws Exception { + public void testObjectMatrix3D_indexed() throws EstoreException { Object[][][] cube = new Object[3][3][3]; long target = rand.nextLong(0, Long.MAX_VALUE); int a = 0; @@ -196,7 +193,7 @@ public void testObjectMatrix3D_indexed() throws Exception { } @Test - public void testCaptureInsertsAllDims() throws Exception { + public void testCaptureInsertsAllDims() throws EstoreException { Long[][] grid = new Long[2][2]; grid[0][0] = 1L; grid[0][1] = 2L; @@ -213,7 +210,7 @@ public void testCaptureInsertsAllDims() throws Exception { } @Test - public void testDeleteArrayIndex() throws Exception { + public void testDeleteArrayIndex() throws EstoreException { Long[] arr = new Long[] {10L, 20L, 30L}; db.captureAll(arr); @@ -224,8 +221,8 @@ public void testDeleteArrayIndex() throws Exception { } @Test - public void testArrayTable_unsafe() throws Exception { - Estore unsafeStore = new Estore(MultiDimensionalArrayTest.class.getName() + "Unsafe"); + public void testArrayTable() throws EstoreException { + Estore gridStore = new Estore(MultiDimensionalArrayTest.class.getName() + "Unsafe"); Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 4; @@ -235,10 +232,10 @@ public void testArrayTable_unsafe() throws Exception { grid[i][j] = (i == ti && j == tj) ? target : rand.nextLong(0, Long.MAX_VALUE); } } - unsafeStore.captureAll(grid); + gridStore.captureAll(grid); Table result = - unsafeStore.query( + gridStore.query( "MATCH (n:`" + grid.getClass().getName() + "`)-[]->()-[]->(m {value:" @@ -248,11 +245,11 @@ public void testArrayTable_unsafe() throws Exception { } @Test - public void testArrayTable_dfs() throws Exception { + public void testArrayTable_dfs() throws EstoreException { Estore dfsStore = new Estore( MultiDimensionalArrayTest.class.getName() + "Dfs", - new EstoreOptions().useUnsafe(false).useDfs(true)); + new EstoreOptions().useDfs(true)); Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 4; @@ -275,11 +272,11 @@ public void testArrayTable_dfs() throws Exception { } @Test - public void testIntMatrix2D_dfs() throws Exception { + public void testIntMatrix2D_dfs() throws EstoreException { Estore dfsStore = new Estore( MultiDimensionalArrayTest.class.getName() + "IntDfs", - new EstoreOptions().useUnsafe(false).useDfs(true)); + new EstoreOptions().useDfs(true)); int[][] grid = new int[8][8]; int target = 4242; int ti = 1; diff --git a/estore/src/test/java/org/estore/MyFirstTest.java b/estore/src/test/java/org/estore/MyFirstTest.java index 8f746b0..92ca660 100644 --- a/estore/src/test/java/org/estore/MyFirstTest.java +++ b/estore/src/test/java/org/estore/MyFirstTest.java @@ -12,8 +12,8 @@ public class MyFirstTest { private Estore db; @BeforeEach - void setup() throws Exception { - db = new Estore(MyFirstTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setup() { + db = new Estore(MyFirstTest.class.getName()); } @Test diff --git a/estore/src/test/java/org/estore/NodePropScanTest.java b/estore/src/test/java/org/estore/NodePropScanTest.java index c5a6b83..e84c29e 100644 --- a/estore/src/test/java/org/estore/NodePropScanTest.java +++ b/estore/src/test/java/org/estore/NodePropScanTest.java @@ -11,7 +11,7 @@ public class NodePropScanTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(NodePropScanTest.class.getName()); Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); diff --git a/estore/src/test/java/org/estore/PropertiesFunctionTest.java b/estore/src/test/java/org/estore/PropertiesFunctionTest.java index 56fd311..ee5d1b0 100644 --- a/estore/src/test/java/org/estore/PropertiesFunctionTest.java +++ b/estore/src/test/java/org/estore/PropertiesFunctionTest.java @@ -12,7 +12,7 @@ public class PropertiesFunctionTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(PropertiesFunctionTest.class.getName()); db.captureAll(new Person("A", 20)); } diff --git a/estore/src/test/java/org/estore/SimpleQueryTest.java b/estore/src/test/java/org/estore/SimpleQueryTest.java index 67a4ab5..49d12c3 100644 --- a/estore/src/test/java/org/estore/SimpleQueryTest.java +++ b/estore/src/test/java/org/estore/SimpleQueryTest.java @@ -11,7 +11,7 @@ public class SimpleQueryTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() { db = new Estore(SimpleQueryTest.class.getName()); } diff --git a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java index 80c2cca..87704a4 100644 --- a/estore/src/test/java/org/estore/ToIntegerFunctionTest.java +++ b/estore/src/test/java/org/estore/ToIntegerFunctionTest.java @@ -11,25 +11,25 @@ public class ToIntegerFunctionTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(ToIntegerFunctionTest.class.getName()); db.captureAll(new Person("A", 20)); } @Test - void toIntegerConvertsStringLiteral() throws Exception { + void toIntegerConvertsStringLiteral() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger('9')"); assertEquals(9, result.get("TOINTEGER(9)").get(0)); } @Test - void toIntegerConvertsProperty() throws Exception { + void toIntegerConvertsProperty() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger(p.age)"); assertEquals(20, result.get("TOINTEGER(p.age)").get(0)); } @Test - void toIntegerReturnsNullForNonNumericString() throws Exception { + void toIntegerReturnsNullForNonNumericString() { Table result = db.query("MATCH (p:`org.estore.example.Person`) RETURN toInteger('nope')"); assertEquals(null, result.get("TOINTEGER(nope)").get(0)); } diff --git a/estore/src/test/java/org/estore/TypeFunctionTest.java b/estore/src/test/java/org/estore/TypeFunctionTest.java index d4f7251..17caa95 100644 --- a/estore/src/test/java/org/estore/TypeFunctionTest.java +++ b/estore/src/test/java/org/estore/TypeFunctionTest.java @@ -11,12 +11,12 @@ public class TypeFunctionTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = new Estore(TypeFunctionTest.class.getName(), new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(TypeFunctionTest.class.getName()); } @Test - void typeReturnsEdgeName() throws Exception { + void typeReturnsEdgeName() throws EstoreException { Person bob = new Person("Bob", 30); Person alice = new Person("Alice", 28, bob); db.captureAll(alice); diff --git a/estore/src/test/java/org/estore/VarLengthRangeTest.java b/estore/src/test/java/org/estore/VarLengthRangeTest.java index 5cbe525..5e3ac86 100644 --- a/estore/src/test/java/org/estore/VarLengthRangeTest.java +++ b/estore/src/test/java/org/estore/VarLengthRangeTest.java @@ -11,7 +11,7 @@ public class VarLengthRangeTest { private Estore db; @BeforeEach - void setUp() throws Exception { + void setUp() throws EstoreException { db = new Estore(VarLengthRangeTest.class.getName()); Person charlie = new Person("Charlie", 25); Person bob = new Person("Bob", 30, charlie); @@ -20,7 +20,7 @@ void setUp() throws Exception { } @Test - void exactTwoHopsFindsCharlie() throws Exception { + void exactTwoHopsFindsCharlie() { Table result = db.query( "MATCH (a:`org.estore.example.Person`)-[*2]->(b:`org.estore.example.Person`) RETURN b"); @@ -29,7 +29,7 @@ void exactTwoHopsFindsCharlie() throws Exception { } @Test - void twoOrMoreHopsFindsCharlie() throws Exception { + void twoOrMoreHopsFindsCharlie() { Table result = db.query( "MATCH (a:`org.estore.example.Person`)-[*2..]->(b:`org.estore.example.Person`) RETURN b"); diff --git a/estore/src/test/java/org/estore/compiler/CodeGenTest.java b/estore/src/test/java/org/estore/compiler/CodeGenTest.java index a63eccb..74ab011 100644 --- a/estore/src/test/java/org/estore/compiler/CodeGenTest.java +++ b/estore/src/test/java/org/estore/compiler/CodeGenTest.java @@ -23,14 +23,7 @@ public class CodeGenTest { @BeforeEach public void initDatabase() { - try { - estore = - new Estore( - CodeGenTest.class.getName(), - new EstoreOptions().useUnsafe(true).useDfs(false)); - } catch (Exception e) { - e.printStackTrace(); - } + estore = new Estore(CodeGenTest.class.getName(), new EstoreOptions().useDfs(false)); } @Test @@ -205,7 +198,7 @@ void testCreateLabelNode() throws EstoreException { } @Test - void testNodeAddPropertyCypher2() throws Exception { + void testNodeAddPropertyCypher2() throws ReflectiveOperationException { Table result = estore.query("CREATE (n:`DummyClass4` {name:'Uki', age:30}) RETURN n"); Object obj = result.get("n").get(0); Class objClass = obj.getClass(); diff --git a/estore/src/test/java/org/estore/compiler/ImplCodeGenTest.java b/estore/src/test/java/org/estore/compiler/ImplCodeGenTest.java index ab1b03f..a804f50 100644 --- a/estore/src/test/java/org/estore/compiler/ImplCodeGenTest.java +++ b/estore/src/test/java/org/estore/compiler/ImplCodeGenTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -14,7 +15,7 @@ public class ImplCodeGenTest { private static final Path RESOURCES = Paths.get("src/test/resources/org/estore/compiler"); - private void runTransform(Path fixture, Path input, Path output) throws Exception { + private void runTransform(Path fixture, Path input, Path output) throws IOException { Files.copy(RESOURCES.resolve(fixture), input); if (output != null) { ImplCodeGen.main(new String[] {input.toString(), output.toString()}); @@ -23,12 +24,12 @@ private void runTransform(Path fixture, Path input, Path output) throws Exceptio } } - private String readString(Path path) throws Exception { + private String readString(Path path) throws IOException { return new String(Files.readAllBytes(path), StandardCharsets.UTF_8); } @Test - void transformsMinimalSourceWithCompiledQueryCode(@TempDir Path tempDir) throws Exception { + void transformsMinimalSourceWithCompiledQueryCode(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("MinimalQuerySource.java"); Path output = tempDir.resolve("TransformedMinimalQuerySource.java"); runTransform(Paths.get("MinimalQuerySource.java"), input, output); @@ -46,7 +47,7 @@ void transformsMinimalSourceWithCompiledQueryCode(@TempDir Path tempDir) throws } @Test - void transformsConcatenatedQueryString(@TempDir Path tempDir) throws Exception { + void transformsConcatenatedQueryString(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("ConcatQuerySource.java"); Path output = tempDir.resolve("TransformedConcatQuerySource.java"); runTransform(Paths.get("ConcatQuerySource.java"), input, output); @@ -57,7 +58,7 @@ void transformsConcatenatedQueryString(@TempDir Path tempDir) throws Exception { } @Test - void leavesUnsupportedQueryArgumentInPlace(@TempDir Path tempDir) throws Exception { + void leavesUnsupportedQueryArgumentInPlace(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("UnsupportedQuerySource.java"); Path output = tempDir.resolve("TransformedUnsupportedQuerySource.java"); runTransform(Paths.get("UnsupportedQuerySource.java"), input, output); @@ -68,7 +69,7 @@ void leavesUnsupportedQueryArgumentInPlace(@TempDir Path tempDir) throws Excepti } @Test - void leavesNonLiteralConcatenationInPlace(@TempDir Path tempDir) throws Exception { + void leavesNonLiteralConcatenationInPlace(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("MixedConcatQuerySource.java"); Path output = tempDir.resolve("TransformedMixedConcatQuerySource.java"); runTransform(Paths.get("MixedConcatQuerySource.java"), input, output); @@ -79,7 +80,7 @@ void leavesNonLiteralConcatenationInPlace(@TempDir Path tempDir) throws Exceptio } @Test - void transformsFileThatAlsoHasNonQueryMethodCalls(@TempDir Path tempDir) throws Exception { + void transformsFileThatAlsoHasNonQueryMethodCalls(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("WithNonQueryCallSource.java"); Path output = tempDir.resolve("TransformedWithNonQueryCallSource.java"); runTransform(Paths.get("WithNonQueryCallSource.java"), input, output); @@ -90,7 +91,7 @@ void transformsFileThatAlsoHasNonQueryMethodCalls(@TempDir Path tempDir) throws } @Test - void usesDefaultOutputPathWhenOnlyInputProvided(@TempDir Path tempDir) throws Exception { + void usesDefaultOutputPathWhenOnlyInputProvided(@TempDir Path tempDir) throws IOException { Path input = tempDir.resolve("MinimalQuerySource.java"); runTransform(Paths.get("MinimalQuerySource.java"), input, null); diff --git a/estore/src/test/java/org/estore/compiler/UtilTest.java b/estore/src/test/java/org/estore/compiler/UtilTest.java index 96fc11c..babfb6d 100644 --- a/estore/src/test/java/org/estore/compiler/UtilTest.java +++ b/estore/src/test/java/org/estore/compiler/UtilTest.java @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.example.A; import org.estore.example.B; import org.estore.planner.util.ClassInfo; @@ -23,8 +23,8 @@ public class UtilTest { private ClassInfo aInfo; @BeforeEach - void setUp() throws Exception { - estore = new Estore(UtilTest.class.getName(), new EstoreOptions().useUnsafe(false)); + void setUp() throws EstoreException { + estore = new Estore(UtilTest.class.getName()); a = estore.insert(A.class); aInfo = estore.getLabelClassInfoMap().get(A.class.getName()); } @@ -119,7 +119,7 @@ void getsStartingNodesByLabelAndProperties() { } @Test - void getsNeighborsFromAllOrNamedEdges() throws Exception { + void getsNeighborsFromAllOrNamedEdges() throws EstoreException { estore.insert(new NullReferenceNode()); List allNeighbors = Util.getNeighbors(a, null, estore); diff --git a/estore/src/test/java/org/estore/datastructuretests/apachecommons/DualHashBidiMapTest.java b/estore/src/test/java/org/estore/datastructuretests/apachecommons/DualHashBidiMapTest.java index b6ca61e..706a7c5 100644 --- a/estore/src/test/java/org/estore/datastructuretests/apachecommons/DualHashBidiMapTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/apachecommons/DualHashBidiMapTest.java @@ -5,7 +5,6 @@ import org.apache.commons.collections4.bidimap.DualHashBidiMap; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,10 +15,8 @@ public class DualHashBidiMapTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = - new Estore( - DualHashBidiMapTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(DualHashBidiMapTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/apachecommons/GrowthListTest.java b/estore/src/test/java/org/estore/datastructuretests/apachecommons/GrowthListTest.java index 4b75081..9f8cb88 100644 --- a/estore/src/test/java/org/estore/datastructuretests/apachecommons/GrowthListTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/apachecommons/GrowthListTest.java @@ -4,7 +4,7 @@ import org.apache.commons.collections4.list.GrowthList; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -15,13 +15,13 @@ public class GrowthListTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(GrowthListTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(GrowthListTest.class.getName()); size = 10; } @Test - void testGrowthListSize() throws Exception { + void testGrowthListSize() throws EstoreException { GrowthList list = new GrowthList(); for (int i = 0; i < size; i++) { diff --git a/estore/src/test/java/org/estore/datastructuretests/apachecommons/PatriciaTrieTest.java b/estore/src/test/java/org/estore/datastructuretests/apachecommons/PatriciaTrieTest.java index 211dadf..42896c6 100644 --- a/estore/src/test/java/org/estore/datastructuretests/apachecommons/PatriciaTrieTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/apachecommons/PatriciaTrieTest.java @@ -5,7 +5,6 @@ import org.apache.commons.collections4.trie.PatriciaTrie; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class PatriciaTrieTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(PatriciaTrieTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(PatriciaTrieTest.class.getName()); size = 5; } diff --git a/estore/src/test/java/org/estore/datastructuretests/eclipse/FastListTest.java b/estore/src/test/java/org/estore/datastructuretests/eclipse/FastListTest.java index eeccff4..2cfc40e 100644 --- a/estore/src/test/java/org/estore/datastructuretests/eclipse/FastListTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/eclipse/FastListTest.java @@ -5,7 +5,6 @@ import org.eclipse.collections.impl.list.mutable.FastList; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class FastListTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(FastListTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(FastListTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBagTest.java b/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBagTest.java index e11e38b..3844432 100644 --- a/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBagTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBagTest.java @@ -5,7 +5,6 @@ import org.eclipse.collections.impl.bag.mutable.HashBag; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class HashBagTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(HashBagTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(HashBagTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBiMapTest.java b/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBiMapTest.java index 5b84218..828b1a0 100644 --- a/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBiMapTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/eclipse/HashBiMapTest.java @@ -5,7 +5,6 @@ import org.eclipse.collections.impl.bimap.mutable.HashBiMap; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class HashBiMapTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(HashBiMapTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(HashBiMapTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/fastutil/FastutilTest.java b/estore/src/test/java/org/estore/datastructuretests/fastutil/FastutilTest.java index bea549f..aa6772d 100644 --- a/estore/src/test/java/org/estore/datastructuretests/fastutil/FastutilTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/fastutil/FastutilTest.java @@ -8,7 +8,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import java.util.concurrent.ThreadLocalRandom; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -20,12 +20,12 @@ public class FastutilTest { private Long2IntAVLTreeMap map; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(FastutilTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(FastutilTest.class.getName()); } @Test - public void testArrayListContains() throws Exception { + public void testArrayListContains() throws EstoreException { rand = ThreadLocalRandom.current(); list = new LongArrayList(); for (int j = 0; j < 100; j++) { @@ -40,7 +40,7 @@ public void testArrayListContains() throws Exception { } @Test - public void testHashSetContains() throws Exception { + public void testHashSetContains() throws EstoreException { set = new LongOpenHashSet(); for (int j = 0; j < 100; j++) { set.add(j); @@ -54,7 +54,7 @@ public void testHashSetContains() throws Exception { } @Test - public void testAVLTreeMapKeys() throws Exception { + public void testAVLTreeMapKeys() throws EstoreException { map = new Long2IntAVLTreeMap(); for (int j = 1; j <= 100; j++) { map.put(j, j); diff --git a/estore/src/test/java/org/estore/datastructuretests/guava/HashBiMapTest.java b/estore/src/test/java/org/estore/datastructuretests/guava/HashBiMapTest.java index 704f5e8..7a4d96a 100644 --- a/estore/src/test/java/org/estore/datastructuretests/guava/HashBiMapTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/guava/HashBiMapTest.java @@ -5,7 +5,6 @@ import com.google.common.collect.HashBiMap; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class HashBiMapTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(HashBiMapTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(HashBiMapTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/guava/LinkedListMultimapTest.java b/estore/src/test/java/org/estore/datastructuretests/guava/LinkedListMultimapTest.java index 25eed57..7ab3cae 100644 --- a/estore/src/test/java/org/estore/datastructuretests/guava/LinkedListMultimapTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/guava/LinkedListMultimapTest.java @@ -5,7 +5,6 @@ import com.google.common.collect.LinkedListMultimap; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,11 +15,8 @@ public class LinkedListMultimapTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = - new Estore( - LinkedListMultimapTest.class.getName(), - new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(LinkedListMultimapTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/guava/MinMaxPriorityQueueTest.java b/estore/src/test/java/org/estore/datastructuretests/guava/MinMaxPriorityQueueTest.java index 7650906..d2d304a 100644 --- a/estore/src/test/java/org/estore/datastructuretests/guava/MinMaxPriorityQueueTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/guava/MinMaxPriorityQueueTest.java @@ -5,7 +5,6 @@ import com.google.common.collect.MinMaxPriorityQueue; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -15,11 +14,8 @@ public class MinMaxPriorityQueueTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = - new Estore( - MinMaxPriorityQueueTest.class.getName(), - new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(MinMaxPriorityQueueTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/jcf/ArrayListTest.java b/estore/src/test/java/org/estore/datastructuretests/jcf/ArrayListTest.java index 906917c..ac96e08 100644 --- a/estore/src/test/java/org/estore/datastructuretests/jcf/ArrayListTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/jcf/ArrayListTest.java @@ -5,7 +5,6 @@ import java.util.ArrayList; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class ArrayListTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(ArrayListTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(ArrayListTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/datastructuretests/jcf/HashSetTest.java b/estore/src/test/java/org/estore/datastructuretests/jcf/HashSetTest.java index fbae069..5e8fa7c 100644 --- a/estore/src/test/java/org/estore/datastructuretests/jcf/HashSetTest.java +++ b/estore/src/test/java/org/estore/datastructuretests/jcf/HashSetTest.java @@ -5,7 +5,6 @@ import java.util.HashSet; import org.estore.Estore; import org.estore.EstoreException; -import org.estore.EstoreOptions; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,8 +15,8 @@ public class HashSetTest { private int size; @BeforeEach - public void initDatabase() throws Exception { - estore = new Estore(HashSetTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void initDatabase() { + estore = new Estore(HashSetTest.class.getName()); size = 10; } diff --git a/estore/src/test/java/org/estore/eval/datastructure/EclipseTest.java b/estore/src/test/java/org/estore/eval/datastructure/EclipseTest.java index 1346eda..1bb7dfe 100644 --- a/estore/src/test/java/org/estore/eval/datastructure/EclipseTest.java +++ b/estore/src/test/java/org/estore/eval/datastructure/EclipseTest.java @@ -11,7 +11,7 @@ import org.eclipse.collections.impl.set.mutable.UnifiedSet; import org.eclipse.collections.impl.stack.mutable.ArrayStack; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -21,13 +21,13 @@ public class EclipseTest { private static ThreadLocalRandom rand; @BeforeEach - public void setup() throws Exception { - estore = new Estore(EclipseTest.class.getName(), new EstoreOptions().useUnsafe(false)); + public void setup() { + estore = new Estore(EclipseTest.class.getName()); rand = ThreadLocalRandom.current(); } @Test - public void testUnifiedSet() throws Exception { + public void testUnifiedSet() throws EstoreException { ArrayList setData = new ArrayList(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -53,7 +53,7 @@ public void testUnifiedSet() throws Exception { } @Test - public void testUnifiedMap() throws Exception { + public void testUnifiedMap() throws EstoreException { ArrayList setData = new ArrayList(); UnifiedMap unifiedMap = new UnifiedMap(); int ind = rand.nextInt(0, 99); @@ -81,7 +81,7 @@ public void testUnifiedMap() throws Exception { } @Test - public void testFastList() throws Exception { + public void testFastList() throws EstoreException { FastList fastList = new FastList(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -106,7 +106,7 @@ public void testFastList() throws Exception { } @Test - public void testArrayStack() throws Exception { + public void testArrayStack() throws EstoreException { ArrayStack arrayStack = new ArrayStack(); ArrayList stackData = new ArrayList(); int ind = rand.nextInt(0, 99); @@ -131,7 +131,7 @@ public void testArrayStack() throws Exception { } @Test - public void testImmutableArrayList() throws Exception { + public void testImmutableArrayList() throws EstoreException { ArrayList listData = new ArrayList(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { diff --git a/estore/src/test/java/org/estore/eval/datastructure/GuavaTest.java b/estore/src/test/java/org/estore/eval/datastructure/GuavaTest.java index 50dae09..6e76ab2 100644 --- a/estore/src/test/java/org/estore/eval/datastructure/GuavaTest.java +++ b/estore/src/test/java/org/estore/eval/datastructure/GuavaTest.java @@ -6,7 +6,7 @@ import java.util.ArrayList; import java.util.concurrent.ThreadLocalRandom; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,13 +16,13 @@ public class GuavaTest { private static ThreadLocalRandom rand; @BeforeEach - public void setup() throws Exception { + public void setup() { rand = ThreadLocalRandom.current(); - estore = new Estore(GuavaTest.class.getName(), new EstoreOptions().useUnsafe(false)); + estore = new Estore(GuavaTest.class.getName()); } @Test - public void testArrayTable() throws Exception { + public void testArrayTable() throws EstoreException { ArrayList rows = new ArrayList(); ArrayList columns = new ArrayList(); for (long j = 0; j < 10; j++) { diff --git a/estore/src/test/java/org/estore/eval/datastructure/JCFTest.java b/estore/src/test/java/org/estore/eval/datastructure/JCFTest.java index 25356d6..80ba87b 100644 --- a/estore/src/test/java/org/estore/eval/datastructure/JCFTest.java +++ b/estore/src/test/java/org/estore/eval/datastructure/JCFTest.java @@ -10,7 +10,7 @@ import java.util.Vector; import java.util.concurrent.ThreadLocalRandom; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -20,13 +20,13 @@ public class JCFTest { private static ThreadLocalRandom rand; @BeforeEach - public void setup() throws Exception { + public void setup() { rand = ThreadLocalRandom.current(); - estore = new Estore(JCFTest.class.getName(), new EstoreOptions().useUnsafe(false)); + estore = new Estore(JCFTest.class.getName()); } @Test - public void testArrayList() throws Exception { + public void testArrayList() throws EstoreException { ArrayList list = new ArrayList(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -47,7 +47,7 @@ public void testArrayList() throws Exception { } @Test - public void testArrayDeque() throws Exception { + public void testArrayDeque() throws EstoreException { ArrayDeque list = new ArrayDeque(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -68,7 +68,7 @@ public void testArrayDeque() throws Exception { } @Test - public void testLinkedList() throws Exception { + public void testLinkedList() throws EstoreException { LinkedList list = new LinkedList(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -89,7 +89,7 @@ public void testLinkedList() throws Exception { } @Test - public void testVector() throws Exception { + public void testVector() throws EstoreException { Vector list = new Vector(); int ind = rand.nextInt(0, 99); for (int j = 0; j < 100; j++) { @@ -110,7 +110,7 @@ public void testVector() throws Exception { } @Test - public void testHashMap() throws Exception { + public void testHashMap() throws EstoreException { HashMap map = new HashMap(); while (map.size() != 99) { map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); diff --git a/estore/src/test/java/org/estore/eval/ldbc/finbench/Fin001Test.java b/estore/src/test/java/org/estore/eval/ldbc/finbench/Fin001Test.java index c87861d..e22126e 100644 --- a/estore/src/test/java/org/estore/eval/ldbc/finbench/Fin001Test.java +++ b/estore/src/test/java/org/estore/eval/ldbc/finbench/Fin001Test.java @@ -12,6 +12,7 @@ import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import org.estore.Estore; +import org.estore.EstoreException; import org.estore.EstoreOptions; import org.estore.compiler.CompileQuery; import org.estore.eval.ldbc.finbench.util.*; @@ -24,11 +25,8 @@ public class Fin001Test { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = - new Estore( - Fin001Test.class.getName(), - new EstoreOptions().useUnsafe(false).profile(false)); + public void setupData() throws EstoreException { + estore = new Estore(Fin001Test.class.getName(), new EstoreOptions().profile(false)); readDataSet(); } @@ -143,7 +141,7 @@ public void testTsr1() { assertEquals(result.get("account.accountType").get(0), "certificate of deposit"); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/estore/src/test/java/org/estore/eval/ldbc/snb/Snb01Test.java b/estore/src/test/java/org/estore/eval/ldbc/snb/Snb01Test.java index 5e57bfd..c7e9e58 100644 --- a/estore/src/test/java/org/estore/eval/ldbc/snb/Snb01Test.java +++ b/estore/src/test/java/org/estore/eval/ldbc/snb/Snb01Test.java @@ -12,6 +12,7 @@ import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import org.estore.Estore; +import org.estore.EstoreException; import org.estore.EstoreOptions; import org.estore.compiler.CompileQuery; import org.estore.eval.ldbc.snb.util.*; @@ -24,11 +25,8 @@ public class Snb01Test { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = - new Estore( - Snb01Test.class.getName(), - new EstoreOptions().useUnsafe(false).profile(false)); + public void setupData() throws EstoreException { + estore = new Estore(Snb01Test.class.getName(), new EstoreOptions().profile(false)); readDataSet(); } @@ -169,7 +167,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/estore/src/test/java/org/estore/planner/expressions/relational/EqualsRelationExprTest.java b/estore/src/test/java/org/estore/planner/expressions/relational/EqualsRelationExprTest.java index bf10ee8..f016539 100644 --- a/estore/src/test/java/org/estore/planner/expressions/relational/EqualsRelationExprTest.java +++ b/estore/src/test/java/org/estore/planner/expressions/relational/EqualsRelationExprTest.java @@ -7,7 +7,7 @@ import java.util.ArrayList; import java.util.function.Function; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.example.Person; import org.estore.planner.expressions.LogicalExpr; import org.estore.planner.expressions.function.FunctionInvocationExpr; @@ -23,15 +23,12 @@ class EqualsRelationExprTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = - new Estore( - EqualsRelationExprTest.class.getName() + "_" + System.nanoTime(), - new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(EqualsRelationExprTest.class.getName() + "_" + System.nanoTime()); } @Test - void queryWherePropertyEqualsLiteralKeepsMatchingRow() throws Exception { + void queryWherePropertyEqualsLiteralKeepsMatchingRow() throws EstoreException { db.captureAll(new Person("Alice", 17)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.name = 'Alice' RETURN p"); @@ -39,7 +36,7 @@ void queryWherePropertyEqualsLiteralKeepsMatchingRow() throws Exception { } @Test - void queryWherePropertyEqualsLiteralExcludesNonMatchingRow() throws Exception { + void queryWherePropertyEqualsLiteralExcludesNonMatchingRow() throws EstoreException { db.captureAll(new Person("Alice", 17)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.name = 'Bob' RETURN p"); @@ -47,7 +44,7 @@ void queryWherePropertyEqualsLiteralExcludesNonMatchingRow() throws Exception { } @Test - void queryWherePropertyNotEqualsLiteralFiltersExpectedRows() throws Exception { + void queryWherePropertyNotEqualsLiteralFiltersExpectedRows() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.name <> 'Alice' RETURN p"); @@ -55,34 +52,34 @@ void queryWherePropertyNotEqualsLiteralFiltersExpectedRows() throws Exception { } @Test - void queryWherePropertyLessThanLiteralFiltersExpectedRows() throws Exception { + void queryWherePropertyLessThanLiteralFiltersExpectedRows() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.age < 17 RETURN p"); assertEquals(1, result.getSize()); } @Test - void queryWherePropertyLessThanOrEqualsLiteralFiltersExpectedRows() throws Exception { + void queryWherePropertyLessThanOrEqualsLiteralFiltersExpectedRows() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.age <= 15 RETURN p"); assertEquals(1, result.getSize()); } @Test - void queryWherePropertyGreaterThanLiteralFiltersExpectedRows() throws Exception { + void queryWherePropertyGreaterThanLiteralFiltersExpectedRows() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.age > 15 RETURN p"); assertEquals(1, result.getSize()); } @Test - void queryWherePropertyGreaterThanOrEqualsLiteralFiltersExpectedRows() throws Exception { + void queryWherePropertyGreaterThanOrEqualsLiteralFiltersExpectedRows() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query("MATCH (p:`org.estore.example.Person`) WHERE p.age >= 17 RETURN p"); assertEquals(1, result.getSize()); } - private void capturePeople(Person... people) throws Exception { + private void capturePeople(Person... people) throws EstoreException { for (Person person : people) { db.captureAll(person); } diff --git a/estore/src/test/java/org/estore/planner/filter/WhereBooleanLogicTest.java b/estore/src/test/java/org/estore/planner/filter/WhereBooleanLogicTest.java index 264ab6c..4cd27c5 100644 --- a/estore/src/test/java/org/estore/planner/filter/WhereBooleanLogicTest.java +++ b/estore/src/test/java/org/estore/planner/filter/WhereBooleanLogicTest.java @@ -3,7 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.example.Person; import org.estore.planner.util.Table; import org.junit.jupiter.api.BeforeEach; @@ -13,15 +13,12 @@ class WhereBooleanLogicTest { private Estore db; @BeforeEach - void setUp() throws Exception { - db = - new Estore( - WhereBooleanLogicTest.class.getName() + "_" + System.nanoTime(), - new EstoreOptions().useUnsafe(true)); + void setUp() { + db = new Estore(WhereBooleanLogicTest.class.getName() + "_" + System.nanoTime()); } @Test - void queryWhereAnd_requiresBothPredicatesTrue() throws Exception { + void queryWhereAnd_requiresBothPredicatesTrue() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query( @@ -30,7 +27,7 @@ void queryWhereAnd_requiresBothPredicatesTrue() throws Exception { } @Test - void queryWhereOr_keepsRowsWhenEitherPredicateIsTrue() throws Exception { + void queryWhereOr_keepsRowsWhenEitherPredicateIsTrue() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15), new Person("Carl", 20)); Table result = db.query( @@ -39,7 +36,7 @@ void queryWhereOr_keepsRowsWhenEitherPredicateIsTrue() throws Exception { } @Test - void queryWhereXor_keepsRowsWhenExactlyOnePredicateIsTrue() throws Exception { + void queryWhereXor_keepsRowsWhenExactlyOnePredicateIsTrue() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 17), new Person("Alice", 15)); Table result = db.query( @@ -48,7 +45,7 @@ void queryWhereXor_keepsRowsWhenExactlyOnePredicateIsTrue() throws Exception { } @Test - void queryWhereNot_invertsPredicateTruthValue() throws Exception { + void queryWhereNot_invertsPredicateTruthValue() throws EstoreException { capturePeople(new Person("Alice", 17), new Person("Bob", 15)); Table result = db.query( @@ -56,7 +53,7 @@ void queryWhereNot_invertsPredicateTruthValue() throws Exception { assertEquals(1, result.getSize()); } - private void capturePeople(Person... people) throws Exception { + private void capturePeople(Person... people) throws EstoreException { for (Person person : people) { db.captureAll(person); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100.java index ff280ee..5533427 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.stack.mutable.ArrayStack; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayStack100 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestArrayStack100 { private ArrayList stackData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); arrayStack = new ArrayStack(); stackData = new ArrayList(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { stackData.add(randValue); arrayStack.push(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(arrayStack); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack1000.java index 9beaeeb..0830355 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack1000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack1000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.stack.mutable.ArrayStack; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayStack1000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestArrayStack1000 { private ArrayList stackData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); arrayStack = new ArrayStack(); stackData = new ArrayList(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { stackData.add(randValue); arrayStack.push(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(arrayStack); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack10000.java index 19bfd77..29eaa3f 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack10000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack10000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.stack.mutable.ArrayStack; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayStack10000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestArrayStack10000 { private ArrayList stackData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); arrayStack = new ArrayStack(); stackData = new ArrayList(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { stackData.add(randValue); arrayStack.push(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(arrayStack); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100000.java index 0e0b45d..1353c39 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestArrayStack100000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.stack.mutable.ArrayStack; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayStack100000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestArrayStack100000 { private ArrayList stackData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); arrayStack = new ArrayStack(); stackData = new ArrayList(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { stackData.add(randValue); arrayStack.push(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(arrayStack); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100.java index b7e033e..1383f91 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.mutable.FastList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestFastList100 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestFastList100 { private FastList fastList; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); fastList = new FastList(); for (int j = 0; j < 100; j++) { fastList.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(fastList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList1000.java index 9403a66..6966b3b 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList1000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.mutable.FastList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestFastList1000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestFastList1000 { private FastList fastList; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); fastList = new FastList(); for (int j = 0; j < 1000; j++) { fastList.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(fastList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList10000.java index d36c713..cdab3d5 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList10000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.mutable.FastList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestFastList10000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestFastList10000 { private FastList fastList; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); fastList = new FastList(); for (int j = 0; j < 10000; j++) { fastList.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(fastList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100000.java index 3f07ab2..43adee4 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestFastList100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.mutable.FastList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestFastList100000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestFastList100000 { private FastList fastList; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); fastList = new FastList(); for (int j = 0; j < 100000; j++) { fastList.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(fastList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100.java index be75756..72666ff 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.immutable.*; import org.junit.jupiter.api.BeforeEach; @@ -10,6 +9,7 @@ import java.util.ArrayList; import org.eclipse.collections.api.list.ImmutableList; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestImmutableArrayList100 { private Estore estore; @@ -18,14 +18,14 @@ public class InGraphReflectionTestImmutableArrayList100 { private ArrayList listData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); listData = new ArrayList(); for (int j = 0; j < 100; j++) { listData.add(rand.nextLong(0, Long.MAX_VALUE)); } immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(immutableArrayList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList1000.java index b5dc248..6d72235 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList1000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList1000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.immutable.*; import org.junit.jupiter.api.BeforeEach; @@ -10,6 +9,7 @@ import java.util.ArrayList; import org.eclipse.collections.api.list.ImmutableList; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestImmutableArrayList1000 { private Estore estore; @@ -18,14 +18,14 @@ public class InGraphReflectionTestImmutableArrayList1000 { private ArrayList listData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); listData = new ArrayList(); for (int j = 0; j < 1000; j++) { listData.add(rand.nextLong(0, Long.MAX_VALUE)); } immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(immutableArrayList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList10000.java index c7655c7..52276da 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList10000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList10000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.immutable.*; import org.junit.jupiter.api.BeforeEach; @@ -10,6 +9,7 @@ import java.util.ArrayList; import org.eclipse.collections.api.list.ImmutableList; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestImmutableArrayList10000 { private Estore estore; @@ -18,14 +18,14 @@ public class InGraphReflectionTestImmutableArrayList10000 { private ArrayList listData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); listData = new ArrayList(); for (int j = 0; j < 10000; j++) { listData.add(rand.nextLong(0, Long.MAX_VALUE)); } immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(immutableArrayList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100000.java index 76a011f..39efcac 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestImmutableArrayList100000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.list.immutable.*; import org.junit.jupiter.api.BeforeEach; @@ -10,6 +9,7 @@ import java.util.ArrayList; import org.eclipse.collections.api.list.ImmutableList; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestImmutableArrayList100000 { private Estore estore; @@ -18,14 +18,14 @@ public class InGraphReflectionTestImmutableArrayList100000 { private ArrayList listData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); listData = new ArrayList(); for (int j = 0; j < 100000; j++) { listData.add(rand.nextLong(0, Long.MAX_VALUE)); } immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(immutableArrayList); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100.java index b13ca62..2815dde 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.map.mutable.UnifiedMap; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedMap100 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestUnifiedMap100 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); unifiedMap = new UnifiedMap(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); setData.add(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedMap); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap1000.java index f569e8a..f197f37 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap1000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap1000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.map.mutable.UnifiedMap; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedMap1000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestUnifiedMap1000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); unifiedMap = new UnifiedMap(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); setData.add(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedMap); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap10000.java index ae23fda..21abaae 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap10000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap10000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.map.mutable.UnifiedMap; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedMap10000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestUnifiedMap10000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); unifiedMap = new UnifiedMap(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); setData.add(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedMap); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100000.java index 86fd603..e13f9cf 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedMap100000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.map.mutable.UnifiedMap; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedMap100000 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestUnifiedMap100000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); unifiedMap = new UnifiedMap(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); setData.add(randValue); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedMap); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100.java index d0663d7..1c39f21 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.set.mutable.UnifiedSet; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedSet100 { private Estore estore; @@ -17,14 +17,14 @@ public class InGraphReflectionTestUnifiedSet100 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); for (int j = 0; j < 100; j++) { setData.add(rand.nextLong(0, Long.MAX_VALUE)); } unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedSet); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet1000.java index ec5d757..a26e1dc 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet1000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet1000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.set.mutable.UnifiedSet; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedSet1000 { private Estore estore; @@ -17,14 +17,14 @@ public class InGraphReflectionTestUnifiedSet1000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); for (int j = 0; j < 1000; j++) { setData.add(rand.nextLong(0, Long.MAX_VALUE)); } unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedSet); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet10000.java index e77dbd2..2dda859 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet10000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet10000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.set.mutable.UnifiedSet; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedSet10000 { private Estore estore; @@ -17,14 +17,14 @@ public class InGraphReflectionTestUnifiedSet10000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); for (int j = 0; j < 10000; j++) { setData.add(rand.nextLong(0, Long.MAX_VALUE)); } unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedSet); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100000.java index 788c2f2..21184af 100644 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100000.java +++ b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphReflectionTestUnifiedSet100000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.eclipse; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.collections.impl.set.mutable.UnifiedSet; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestUnifiedSet100000 { private Estore estore; @@ -17,14 +17,14 @@ public class InGraphReflectionTestUnifiedSet100000 { private ArrayList setData; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); setData = new ArrayList(); for (int j = 0; j < 100000; j++) { setData.add(rand.nextLong(0, Long.MAX_VALUE)); } unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(unifiedSet); } diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100.java deleted file mode 100644 index 04c6d8d..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.stack.mutable.ArrayStack; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayStack100 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayStack arrayStack; - private ArrayList stackData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - arrayStack = new ArrayStack(); - stackData = new ArrayList(); - for (int j = 0; j < 100; j++) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - stackData.add(randValue); - arrayStack.push(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(arrayStack); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, stackData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.stack.mutable.ArrayStack`)-[:delegate]->()-[:items]->()-[]->(m" - + " {value:" - + (long) stackData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - stackData.get(ind), - "Mismatch in IngraphUnsafeTestArrayStack100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack1000.java deleted file mode 100644 index 243cff2..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack1000.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.stack.mutable.ArrayStack; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayStack1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayStack arrayStack; - private ArrayList stackData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - arrayStack = new ArrayStack(); - stackData = new ArrayList(); - for (int j = 0; j < 1000; j++) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - stackData.add(randValue); - arrayStack.push(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(arrayStack); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, stackData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.stack.mutable.ArrayStack`)-[:delegate]->()-[:items]->()-[]->(m" - + " {value:" - + (long) stackData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - stackData.get(ind), - "Mismatch in IngraphUnsafeTestArrayStack1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack10000.java deleted file mode 100644 index bb7b5cd..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack10000.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.stack.mutable.ArrayStack; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayStack10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayStack arrayStack; - private ArrayList stackData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - arrayStack = new ArrayStack(); - stackData = new ArrayList(); - for (int j = 0; j < 10000; j++) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - stackData.add(randValue); - arrayStack.push(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(arrayStack); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, stackData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.stack.mutable.ArrayStack`)-[:delegate]->()-[:items]->()-[]->(m" - + " {value:" - + (long) stackData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - stackData.get(ind), - "Mismatch in IngraphUnsafeTestArrayStack10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100000.java deleted file mode 100644 index 9383229..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestArrayStack100000.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.stack.mutable.ArrayStack; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayStack100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayStack arrayStack; - private ArrayList stackData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - arrayStack = new ArrayStack(); - stackData = new ArrayList(); - for (int j = 0; j < 100000; j++) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - stackData.add(randValue); - arrayStack.push(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(arrayStack); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, stackData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.stack.mutable.ArrayStack`)-[:delegate]->()-[:items]->()-[]->(m" - + " {value:" - + (long) stackData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - stackData.get(ind), - "Mismatch in IngraphUnsafeTestArrayStack100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100.java deleted file mode 100644 index 3042057..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.mutable.FastList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestFastList100 { - private Estore estore; - private static ThreadLocalRandom rand; - private FastList fastList; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - fastList = new FastList(); - for (int j = 0; j < 100; j++) { - fastList.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(fastList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, fastList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.list.mutable.FastList`)-[:items]->()-[]->(m" - + " {value:" - + (long) fastList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - fastList.get(ind), - "Mismatch in IngraphUnsafeTestFastList100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList1000.java deleted file mode 100644 index 98d5977..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList1000.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.mutable.FastList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestFastList1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private FastList fastList; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - fastList = new FastList(); - for (int j = 0; j < 1000; j++) { - fastList.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(fastList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, fastList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.list.mutable.FastList`)-[:items]->()-[]->(m" - + " {value:" - + (long) fastList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - fastList.get(ind), - "Mismatch in IngraphUnsafeTestFastList1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList10000.java deleted file mode 100644 index 8f463d2..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList10000.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.mutable.FastList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestFastList10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private FastList fastList; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - fastList = new FastList(); - for (int j = 0; j < 10000; j++) { - fastList.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(fastList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, fastList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.list.mutable.FastList`)-[:items]->()-[]->(m" - + " {value:" - + (long) fastList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - fastList.get(ind), - "Mismatch in IngraphUnsafeTestFastList10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100000.java deleted file mode 100644 index f77fca9..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestFastList100000.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.mutable.FastList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestFastList100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private FastList fastList; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - fastList = new FastList(); - for (int j = 0; j < 100000; j++) { - fastList.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(fastList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, fastList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.list.mutable.FastList`)-[:items]->()-[]->(m" - + " {value:" - + (long) fastList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - fastList.get(ind), - "Mismatch in IngraphUnsafeTestFastList100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100.java deleted file mode 100644 index d602fc5..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.immutable.*; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import java.util.ArrayList; -import org.eclipse.collections.api.list.ImmutableList; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestImmutableArrayList100 { - private Estore estore; - private static ThreadLocalRandom rand; - private ImmutableList immutableArrayList; - private ArrayList listData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - listData = new ArrayList(); - for (int j = 0; j < 100; j++) { - listData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb"); - estore.captureAll(immutableArrayList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, immutableArrayList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.list.immutable.ImmutableArrayList`)-[:items]->()-[]->(m" - + " {value:" - + (long) immutableArrayList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - immutableArrayList.get(ind), - "Mismatch in IngraphUnsafeTestImmutableArrayList100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList1000.java deleted file mode 100644 index 97e0691..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList1000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.immutable.*; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import java.util.ArrayList; -import org.eclipse.collections.api.list.ImmutableList; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestImmutableArrayList1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ImmutableList immutableArrayList; - private ArrayList listData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - listData = new ArrayList(); - for (int j = 0; j < 1000; j++) { - listData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb"); - estore.captureAll(immutableArrayList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, immutableArrayList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.list.immutable.ImmutableArrayList`)-[:items]->()-[]->(m" - + " {value:" - + (long) immutableArrayList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - immutableArrayList.get(ind), - "Mismatch in IngraphUnsafeTestImmutableArrayList1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList10000.java deleted file mode 100644 index 9fb7f28..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList10000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.immutable.*; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import java.util.ArrayList; -import org.eclipse.collections.api.list.ImmutableList; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestImmutableArrayList10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ImmutableList immutableArrayList; - private ArrayList listData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - listData = new ArrayList(); - for (int j = 0; j < 10000; j++) { - listData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb"); - estore.captureAll(immutableArrayList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, immutableArrayList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.list.immutable.ImmutableArrayList`)-[:items]->()-[]->(m" - + " {value:" - + (long) immutableArrayList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - immutableArrayList.get(ind), - "Mismatch in IngraphUnsafeTestImmutableArrayList10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100000.java deleted file mode 100644 index dd323cc..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestImmutableArrayList100000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.list.immutable.*; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import java.util.ArrayList; -import org.eclipse.collections.api.list.ImmutableList; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestImmutableArrayList100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ImmutableList immutableArrayList; - private ArrayList listData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - listData = new ArrayList(); - for (int j = 0; j < 100000; j++) { - listData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - immutableArrayList = new ImmutableListFactoryImpl().withAll(listData); - estore = new Estore("testDb"); - estore.captureAll(immutableArrayList); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, immutableArrayList.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH" - + " (n:`org.eclipse.collections.impl.list.immutable.ImmutableArrayList`)-[:items]->()-[]->(m" - + " {value:" - + (long) immutableArrayList.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - immutableArrayList.get(ind), - "Mismatch in IngraphUnsafeTestImmutableArrayList100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100.java deleted file mode 100644 index d4db756..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.map.mutable.UnifiedMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedMap100 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedMap unifiedMap; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - unifiedMap = new UnifiedMap(); - while (unifiedMap.size() != 100) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); - setData.add(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(unifiedMap); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.map.mutable.UnifiedMap`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedMap100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap1000.java deleted file mode 100644 index 9925e5b..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap1000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.map.mutable.UnifiedMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedMap1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedMap unifiedMap; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - unifiedMap = new UnifiedMap(); - while (unifiedMap.size() != 1000) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); - setData.add(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(unifiedMap); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.map.mutable.UnifiedMap`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedMap1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap10000.java deleted file mode 100644 index 6006b98..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap10000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.map.mutable.UnifiedMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedMap10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedMap unifiedMap; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - unifiedMap = new UnifiedMap(); - while (unifiedMap.size() != 10000) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); - setData.add(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(unifiedMap); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.map.mutable.UnifiedMap`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedMap10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100000.java deleted file mode 100644 index a4e6b51..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedMap100000.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.map.mutable.UnifiedMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedMap100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedMap unifiedMap; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - unifiedMap = new UnifiedMap(); - while (unifiedMap.size() != 100000) { - long randValue = rand.nextLong(0, Long.MAX_VALUE); - unifiedMap.put(rand.nextLong(0, Long.MAX_VALUE), randValue); - setData.add(randValue); - } - estore = new Estore("testDb"); - estore.captureAll(unifiedMap); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.map.mutable.UnifiedMap`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedMap100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100.java deleted file mode 100644 index 195cc41..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.set.mutable.UnifiedSet; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedSet100 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedSet unifiedSet; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - for (int j = 0; j < 100; j++) { - setData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb"); - estore.captureAll(unifiedSet); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.set.mutable.UnifiedSet`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedSet100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet1000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet1000.java deleted file mode 100644 index d5ea366..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet1000.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.set.mutable.UnifiedSet; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedSet1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedSet unifiedSet; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - for (int j = 0; j < 1000; j++) { - setData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb"); - estore.captureAll(unifiedSet); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.set.mutable.UnifiedSet`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedSet1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet10000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet10000.java deleted file mode 100644 index 46c3e1a..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet10000.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.set.mutable.UnifiedSet; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedSet10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedSet unifiedSet; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - for (int j = 0; j < 10000; j++) { - setData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb"); - estore.captureAll(unifiedSet); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.set.mutable.UnifiedSet`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedSet10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100000.java b/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100000.java deleted file mode 100644 index 5de0f1a..0000000 --- a/eval/estore/datastructure/eclipse/src/test/java/org/estore/eval/estore/datastructure/eclipse/InGraphUnsafeTestUnifiedSet100000.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.estore.eval.estore.datastructure.eclipse; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.collections.impl.set.mutable.UnifiedSet; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestUnifiedSet100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private UnifiedSet unifiedSet; - private ArrayList setData; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - setData = new ArrayList(); - for (int j = 0; j < 100000; j++) { - setData.add(rand.nextLong(0, Long.MAX_VALUE)); - } - unifiedSet = new UnifiedSet(setData); - estore = new Estore("testDb"); - estore.captureAll(unifiedSet); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(0, setData.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`org.eclipse.collections.impl.set.mutable.UnifiedSet`)-[:table]->()-[]->(m" - + " {value:" - + (long) setData.get(ind) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - setData.get(ind), - "Mismatch in IngraphUnsafeTestUnifiedSet100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100.java index e561bdb..6c1a7f2 100644 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100.java +++ b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.guava; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.ArrayTable; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayTable100 { private Estore estore; @@ -16,7 +16,7 @@ public class InGraphReflectionTestArrayTable100 { private ArrayTable table; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); ArrayList rows = new ArrayList(); ArrayList columns = new ArrayList(); @@ -30,7 +30,7 @@ public void setupData() throws Exception { table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); } } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(table); } diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable1000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable1000.java index 7c62b97..d39a53b 100644 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable1000.java +++ b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable1000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.guava; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.ArrayTable; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayTable1000 { private Estore estore; @@ -16,7 +16,7 @@ public class InGraphReflectionTestArrayTable1000 { private ArrayTable table; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); ArrayList rows = new ArrayList(); ArrayList columns = new ArrayList(); @@ -30,7 +30,7 @@ public void setupData() throws Exception { table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); } } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(table); } diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable10000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable10000.java index 308341e..71fc6e0 100644 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable10000.java +++ b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable10000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.guava; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.ArrayTable; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayTable10000 { private Estore estore; @@ -16,7 +16,7 @@ public class InGraphReflectionTestArrayTable10000 { private ArrayTable table; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); ArrayList rows = new ArrayList(); ArrayList columns = new ArrayList(); @@ -30,7 +30,7 @@ public void setupData() throws Exception { table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); } } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(table); } diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100000.java index 63078d5..9689b1c 100644 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100000.java +++ b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestArrayTable100000.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.guava; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.ArrayTable; import org.junit.jupiter.api.BeforeEach; @@ -9,6 +8,7 @@ import java.util.ArrayList; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestArrayTable100000 { private Estore estore; @@ -16,7 +16,7 @@ public class InGraphReflectionTestArrayTable100000 { private ArrayTable table; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); ArrayList rows = new ArrayList(); ArrayList columns = new ArrayList(); @@ -30,7 +30,7 @@ public void setupData() throws Exception { table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); } } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(table); } diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestHashMultiset100.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestHashMultiset100.java index 47e4aa8..c0c7dc1 100644 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestHashMultiset100.java +++ b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphReflectionTestHashMultiset100.java @@ -1,7 +1,6 @@ package org.estore.eval.estore.datastructure.guava; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.HashMultiset; import com.google.common.collect.HashMultimap; @@ -9,6 +8,7 @@ import org.junit.jupiter.api.Test; import java.util.ArrayList; import org.estore.planner.util.Table; +import org.estore.EstoreException; public class InGraphReflectionTestHashMultiset100 { private Estore estore; @@ -17,7 +17,7 @@ public class InGraphReflectionTestHashMultiset100 { private HashMultimap multiMap; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); ArrayList values = new ArrayList(); multiMap = HashMultimap.create(); @@ -26,7 +26,7 @@ public void setupData() throws Exception { multiMap.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); } multiSet = HashMultiset.create(values); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(multiMap); } diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100.java deleted file mode 100644 index 299adf1..0000000 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.estore.eval.estore.datastructure.guava; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import com.google.common.collect.ArrayTable; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayTable100 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayTable table; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - ArrayList rows = new ArrayList(); - ArrayList columns = new ArrayList(); - for (long j = 0; j < 10; j++) { - rows.add(j); - columns.add(j); - } - table = ArrayTable.create(rows, columns); - for (long j = 0; j < 10; j++) { - for (long k = 0; k < 10; k++) { - table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); - } - } - estore = new Estore("testDb"); - estore.captureAll(table); - } - - @Test - public void testFindElement() { - long ind = rand.nextLong(0, 10); - long ind2 = rand.nextLong(0, 10); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`com.google.common.collect.ArrayTable`)-[:array]->()-[]->()-[]->(m {value:" - + table.get(ind, ind2) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - table.get(ind, ind2), - "Mismatch in IngraphUnsafeTestArrayTable100 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable1000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable1000.java deleted file mode 100644 index 0295295..0000000 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable1000.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.estore.eval.estore.datastructure.guava; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import com.google.common.collect.ArrayTable; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayTable1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayTable table; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - ArrayList rows = new ArrayList(); - ArrayList columns = new ArrayList(); - for (long j = 0; j < 32; j++) { - rows.add(j); - columns.add(j); - } - table = ArrayTable.create(rows, columns); - for (long j = 0; j < 32; j++) { - for (long k = 0; k < 32; k++) { - table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); - } - } - estore = new Estore("testDb"); - estore.captureAll(table); - } - - @Test - public void testFindElement() { - long ind = rand.nextLong(0, 32); - long ind2 = rand.nextLong(0, 32); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`com.google.common.collect.ArrayTable`)-[:array]->()-[]->()-[]->(m {value:" - + table.get(ind, ind2) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - table.get(ind, ind2), - "Mismatch in IngraphUnsafeTestArrayTable1000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable10000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable10000.java deleted file mode 100644 index 415cd79..0000000 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable10000.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.estore.eval.estore.datastructure.guava; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import com.google.common.collect.ArrayTable; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayTable10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayTable table; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - ArrayList rows = new ArrayList(); - ArrayList columns = new ArrayList(); - for (long j = 0; j < 100; j++) { - rows.add(j); - columns.add(j); - } - table = ArrayTable.create(rows, columns); - for (long j = 0; j < 100; j++) { - for (long k = 0; k < 100; k++) { - table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); - } - } - estore = new Estore("testDb"); - estore.captureAll(table); - } - - @Test - public void testFindElement() { - long ind = rand.nextLong(0, 100); - long ind2 = rand.nextLong(0, 100); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`com.google.common.collect.ArrayTable`)-[:array]->()-[]->()-[]->(m {value:" - + table.get(ind, ind2) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - table.get(ind, ind2), - "Mismatch in IngraphUnsafeTestArrayTable10000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100000.java b/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100000.java deleted file mode 100644 index 026ca74..0000000 --- a/eval/estore/datastructure/guava/src/test/java/org/estore/eval/estore/datastructure/guava/InGraphUnsafeTestArrayTable100000.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.estore.eval.estore.datastructure.guava; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import com.google.common.collect.ArrayTable; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayTable100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayTable table; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - ArrayList rows = new ArrayList(); - ArrayList columns = new ArrayList(); - for (long j = 0; j < 320; j++) { - rows.add(j); - columns.add(j); - } - table = ArrayTable.create(rows, columns); - for (long j = 0; j < 320; j++) { - for (long k = 0; k < 320; k++) { - table.put(j, k, rand.nextLong(0, Long.MAX_VALUE)); - } - } - estore = new Estore("testDb"); - estore.captureAll(table); - } - - @Test - public void testFindElement() { - long ind = rand.nextLong(0, 320); - long ind2 = rand.nextLong(0, 320); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`com.google.common.collect.ArrayTable`)-[:array]->()-[]->()-[]->(m {value:" - + table.get(ind, ind2) - + "}) RETURN m"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("m").get(0)), - table.get(ind, ind2), - "Mismatch in IngraphUnsafeTestArrayTable100000 for testFindElement"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100.java index 237686f..722252a 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayDeque; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayDeque100 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayDeque100 { private ArrayDeque list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayDeque(); for (int j = 0; j < 100; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque1000.java index 6d46438..09f667c 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque1000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayDeque; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayDeque1000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayDeque1000 { private ArrayDeque list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayDeque(); for (int j = 0; j < 1000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque10000.java index 252add7..b744255 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque10000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayDeque; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayDeque10000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayDeque10000 { private ArrayDeque list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayDeque(); for (int j = 0; j < 10000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100000.java index ac7ce22..779d8e2 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayDeque100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayDeque; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayDeque100000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayDeque100000 { private ArrayDeque list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayDeque(); for (int j = 0; j < 100000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100.java index 1fdc528..2cb72ed 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayList100 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayList100 { private ArrayList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayList(); for (int j = 0; j < 100; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000.java index bd2aad6..2a7f3ba 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.Random; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayList1000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayList1000 { private ArrayList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = new Random(); list = new ArrayList(); for (int j = 0; j < 1000; j++) { list.add(rand.nextLong()); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList10000.java index f67a056..e45d3c2 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList10000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayList10000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayList10000 { private ArrayList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayList(); for (int j = 0; j < 10000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100000.java index b951440..83bfce5 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayList100000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayList100000 { private ArrayList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayList(); for (int j = 0; j < 100000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000000.java index 9ccbe0b..be719ad 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestArrayList1000000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestArrayList1000000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestArrayList1000000 { private ArrayList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new ArrayList(); for (int j = 0; j < 1000000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100.java index f51da08..f1684b2 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.HashMap; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestHashMap100 { private Estore estore; @@ -15,14 +15,14 @@ public class InGraphReflectionTestHashMap100 { private HashMap map; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); map = new HashMap(); while (map.size() != 99) { map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); } map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(map); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap1000.java index f352c5a..e93db3e 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap1000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.HashMap; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestHashMap1000 { private Estore estore; @@ -15,14 +15,14 @@ public class InGraphReflectionTestHashMap1000 { private HashMap map; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); map = new HashMap(); while (map.size() != 999) { map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); } map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(map); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap10000.java index 5ea1018..605667d 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap10000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.HashMap; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestHashMap10000 { private Estore estore; @@ -15,14 +15,14 @@ public class InGraphReflectionTestHashMap10000 { private HashMap map; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); map = new HashMap(); while (map.size() != 9999) { map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); } map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(map); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100000.java index 7d2d732..2133cf0 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestHashMap100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.HashMap; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTestHashMap100000 { private Estore estore; @@ -15,14 +15,14 @@ public class InGraphReflectionTestHashMap100000 { private HashMap map; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); map = new HashMap(); while (map.size() != 99999) { map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); } map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(map); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100.java index 79288a2..15ea868 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.LinkedList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestLinkedList100 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestLinkedList100 { private LinkedList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new LinkedList(); for (int j = 0; j < 100; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList1000.java index 4e6f591..48fe2c0 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList1000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.LinkedList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestLinkedList1000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestLinkedList1000 { private LinkedList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new LinkedList(); for (int j = 0; j < 1000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList10000.java index 9f7e66e..08232e0 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList10000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.LinkedList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestLinkedList10000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestLinkedList10000 { private LinkedList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new LinkedList(); for (int j = 0; j < 10000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100000.java index 2f0a995..165c3c8 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestLinkedList100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.LinkedList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestLinkedList100000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestLinkedList100000 { private LinkedList list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new LinkedList(); for (int j = 0; j < 100000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100.java index 6fe0f01..4673fee 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.Vector; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestVector100 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestVector100 { private Vector list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new Vector(); for (int j = 0; j < 100; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector1000.java index c74f304..6356234 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector1000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector1000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.Vector; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestVector1000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestVector1000 { private Vector list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new Vector(); for (int j = 0; j < 1000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector10000.java index 2d0a3d2..48e88f2 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector10000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector10000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.Vector; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestVector10000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestVector10000 { private Vector list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new Vector(); for (int j = 0; j < 10000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100000.java index 0c73043..c2e2d88 100644 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100000.java +++ b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphReflectionTestVector100000.java @@ -1,13 +1,13 @@ package org.estore.eval.estore.datastructure.jcf; import org.estore.Estore; -import org.estore.EstoreOptions; import java.util.concurrent.ThreadLocalRandom; import java.util.Vector; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.estore.EstoreException; public class InGraphReflectionTestVector100000 { private Estore estore; @@ -15,13 +15,13 @@ public class InGraphReflectionTestVector100000 { private Vector list; @BeforeEach - public void setupData() throws Exception { + public void setupData() throws EstoreException { rand = ThreadLocalRandom.current(); list = new Vector(); for (int j = 0; j < 100000; j++) { list.add(rand.nextLong(0, Long.MAX_VALUE)); } - estore = new Estore("testDb", new EstoreOptions().useUnsafe(false)); + estore = new Estore("testDb"); estore.captureAll(list); } diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100.java deleted file mode 100644 index 57305c8..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayDeque; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayDeque100 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayDeque list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayDeque(); - for (int j = 0; j < 100; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayDeque`)-[:elements]->(m)-[]->(p {value:" - + ((long) list.toArray()[ind]) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals(((Long) result.get("p").get(0)), list.toArray()[ind]); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque1000.java deleted file mode 100644 index 8d7af23..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque1000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayDeque; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestArrayDeque1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayDeque list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayDeque(); - for (int j = 0; j < 1000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayDeque`)-[:elements]->(m)-[]->(p {value:" - + ((long) list.toArray()[ind]) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.toArray()[ind]); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque10000.java deleted file mode 100644 index 4e22725..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque10000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayDeque; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestArrayDeque10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayDeque list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayDeque(); - for (int j = 0; j < 10000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayDeque`)-[:elements]->(m)-[]->(p {value:" - + ((long) list.toArray()[ind]) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.toArray()[ind]); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100000.java deleted file mode 100644 index c0fbcf1..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayDeque100000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayDeque; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestArrayDeque100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayDeque list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayDeque(); - for (int j = 0; j < 100000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayDeque`)-[:elements]->(m)-[]->(p {value:" - + ((long) list.toArray()[ind]) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.toArray()[ind]); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100.java deleted file mode 100644 index 6d1f400..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayList100 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayList(); - for (int j = 0; j < 100; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - - Table result = - estore.query( - "MATCH (n:`java.util.ArrayList`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - list.get(ind), - "Mismatch in expected value in InGraphUnsafeTestArrayList100"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList1000.java deleted file mode 100644 index e58de22..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList1000.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.Random; -import java.util.ArrayList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestArrayList1000 { - private Estore estore; - private Random rand; - private ArrayList list; - - @BeforeEach - public void setupData() throws Exception { - rand = new Random(); - list = new ArrayList(); - for (int j = 0; j < 1000; j++) { - list.add(rand.nextLong()); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayList`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - list.get(ind), - "Mismatch in expected value in InGraphUnsafeTestArrayList1000"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList10000.java deleted file mode 100644 index a9ce948..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList10000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestArrayList10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayList(); - for (int j = 0; j < 10000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayList`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100000.java deleted file mode 100644 index 21cd49a..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestArrayList100000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.ArrayList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestArrayList100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private ArrayList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new ArrayList(); - for (int j = 0; j < 100000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.ArrayList`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100.java deleted file mode 100644 index bbe3f6d..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.HashMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestHashMap100 { - private Estore estore; - private static ThreadLocalRandom rand; - private HashMap map; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - map = new HashMap(); - while (map.size() != 99) { - map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); - } - map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb"); - estore.captureAll(map); - } - - @Test - public void testFindElement() { - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.HashMap`)-[:table]->()-[]->()-[:value]->(p {value:90}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - 90L, - "Mismatch in InGraphUnsafeTestHashMap100 in testFindElement"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap1000.java deleted file mode 100644 index 6bee26a..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap1000.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.HashMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestHashMap1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private HashMap map; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - map = new HashMap(); - while (map.size() != 999) { - map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); - } - map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb"); - estore.captureAll(map); - } - - @Test - public void testFindElement() { - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.HashMap`)-[:table]->()-[]->()-[:value]->(p {value:90}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - 90L, - "Mismatch in InGraphUnsafeTestHashMap1000 in testFindElement"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap10000.java deleted file mode 100644 index 818c468..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap10000.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.HashMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestHashMap10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private HashMap map; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - map = new HashMap(); - while (map.size() != 9999) { - map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); - } - map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb"); - estore.captureAll(map); - } - - @Test - public void testFindElement() { - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.HashMap`)-[:table]->()-[]->()-[:value]->(p {value:90}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - 90L, - "Mismatch in InGraphUnsafeTestHashMap10000 in testFindElement"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100000.java deleted file mode 100644 index 51ac4e3..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestHashMap100000.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.HashMap; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestHashMap100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private HashMap map; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - map = new HashMap(); - while (map.size() != 99999) { - map.put(rand.nextLong(0, Long.MAX_VALUE), rand.nextLong(0, Long.MAX_VALUE)); - } - map.put(rand.nextLong(0, Long.MAX_VALUE), 90L); - estore = new Estore("testDb"); - estore.captureAll(map); - } - - @Test - public void testFindElement() { - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.HashMap`)-[:table]->()-[]->()-[:value]->(p {value:90}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals( - ((Long) result.get("p").get(0)), - 90L, - "Mismatch in InGraphUnsafeTestHashMap100000 in testFindElement"); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100.java deleted file mode 100644 index 33aafc8..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.LinkedList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestLinkedList100 { - private Estore estore; - private static ThreadLocalRandom rand; - private LinkedList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new LinkedList(); - for (int j = 0; j < 100; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.LinkedList`)-[*1..99]->(m)-[:item]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals(((Long) result.get("p").get(0)), list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList1000.java deleted file mode 100644 index b3dbada..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList1000.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.LinkedList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestLinkedList1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private LinkedList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new LinkedList(); - for (int j = 0; j < 1000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.LinkedList`)-[:*1.." - + list.size() - + "]->(m)-[:item]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList10000.java deleted file mode 100644 index 1c94c56..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList10000.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.LinkedList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestLinkedList10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private LinkedList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new LinkedList(); - for (int j = 0; j < 10000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.LinkedList`)-[:*1.." - + list.size() - + "]->(m)-[:item]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100000.java deleted file mode 100644 index d467666..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestLinkedList100000.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.LinkedList; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestLinkedList100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private LinkedList list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new LinkedList(); - for (int j = 0; j < 100000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.LinkedList`)-[:*1.." - + list.size() - + "]->(m)-[:item]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100.java deleted file mode 100644 index b4b9012..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.Vector; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTestVector100 { - private Estore estore; - private static ThreadLocalRandom rand; - private Vector list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new Vector(); - for (int j = 0; j < 100; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.Vector`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertEquals(((Long) result.get("p").get(0)), list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector1000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector1000.java deleted file mode 100644 index 96b45bb..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector1000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.Vector; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestVector1000 { - private Estore estore; - private static ThreadLocalRandom rand; - private Vector list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new Vector(); - for (int j = 0; j < 1000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.Vector`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector10000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector10000.java deleted file mode 100644 index bc517fd..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector10000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.Vector; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestVector10000 { - private Estore estore; - private static ThreadLocalRandom rand; - private Vector list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new Vector(); - for (int j = 0; j < 10000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.Vector`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100000.java b/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100000.java deleted file mode 100644 index 8c3e281..0000000 --- a/eval/estore/datastructure/jcf/src/test/java/org/estore/eval/estore/datastructure/jcf/InGraphUnsafeTestVector100000.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.estore.eval.estore.datastructure.jcf; - -import org.estore.Estore; -import java.util.concurrent.ThreadLocalRandom; -import java.util.Vector; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.planner.util.Table; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class InGraphUnsafeTestVector100000 { - private Estore estore; - private static ThreadLocalRandom rand; - private Vector list; - - @BeforeEach - public void setupData() throws Exception { - rand = ThreadLocalRandom.current(); - list = new Vector(); - for (int j = 0; j < 100000; j++) { - list.add(rand.nextLong(0, Long.MAX_VALUE)); - } - estore = new Estore("testDb"); - estore.captureAll(list); - } - - @Test - public void testFindElement() { - int ind = rand.nextInt(list.size()); - long t1 = System.nanoTime(); - Table result = - estore.query( - "MATCH (n:`java.util.Vector`)-[:elementData]->(m)-[]->(p {value:" - + ((long) list.get(ind)) - + "}) RETURN p"); - System.out.println("Execution Time : " + (System.nanoTime() - t1)); - assertTrue(((Long) result.get("p").get(0)) == list.get(ind)); - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest001.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest001.java index 412a968..be7351a 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest001.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest001.java @@ -205,7 +205,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { try { dbFactory = new DatabaseFactory("ArcadeDB/database"); db = dbFactory.create(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest01.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest01.java index 3980841..1366007 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest01.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest01.java @@ -206,7 +206,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { try { dbFactory = new DatabaseFactory("ArcadeDB/database"); db = dbFactory.create(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest03.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest03.java index 12651d9..4efba67 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest03.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest03.java @@ -206,7 +206,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { try { dbFactory = new DatabaseFactory("ArcadeDB/database"); db = dbFactory.create(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest10.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest10.java index 0599012..4f9cbbc 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest10.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest10.java @@ -206,7 +206,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { try { dbFactory = new DatabaseFactory("ArcadeDB/database"); db = dbFactory.create(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest3.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest3.java index 375897e..43e19ed 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest3.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/ArcadeDBEmbeddedTest3.java @@ -206,7 +206,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { try { dbFactory = new DatabaseFactory("ArcadeDB/database"); db = dbFactory.create(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest001.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest001.java index 35d908c..ba49c38 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest001.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest001.java @@ -15,14 +15,15 @@ import org.estore.Estore; import org.estore.EstoreOptions; import org.estore.planner.util.Table; +import org.estore.EstoreException; public class InGraphReflectionTest001 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -103,7 +104,7 @@ public void testTsr1() { result.print(); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest01.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest01.java index 366399e..63e323e 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest01.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest01.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest01 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -107,7 +108,7 @@ public void testTsr1() { assertEquals(result.get("account.accountType").get(0), "certificate of deposit"); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest03.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest03.java index 79cb96e..62b5948 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest03.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest03.java @@ -15,14 +15,15 @@ import org.estore.Estore; import org.estore.EstoreOptions; import org.estore.planner.util.Table; +import org.estore.EstoreException; public class InGraphReflectionTest03 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -102,7 +103,7 @@ public void testTsr1() { + " account.accountType"); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest10.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest10.java index 7a1c3fb..3c60562 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest10.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest10.java @@ -15,14 +15,15 @@ import org.estore.Estore; import org.estore.EstoreOptions; import org.estore.planner.util.Table; +import org.estore.EstoreException; public class InGraphReflectionTest10 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -102,7 +103,7 @@ public void testTsr1() { + " account.accountType"); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest3.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest3.java index 546b31a..3953cfd 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest3.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphReflectionTest3.java @@ -15,14 +15,15 @@ import org.estore.Estore; import org.estore.EstoreOptions; import org.estore.planner.util.Table; +import org.estore.EstoreException; public class InGraphReflectionTest3 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -102,7 +103,7 @@ public void testTsr1() { + " account.accountType"); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest001.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest001.java deleted file mode 100644 index 78b5409..0000000 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest001.java +++ /dev/null @@ -1,432 +0,0 @@ -package org.estore.eval.estore.ldbc.finbench; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.finbench.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -public class InGraphUnsafeTest001 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - - readDataSet(); - } - - @Test - public void testTw1() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 1, personName:" - + " 'George'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1020342322, createTime: '26th March', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw2() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Company` {companyId: 12345," - + " companyName: 'Rand'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1213243435, createTime: 'February 5th', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw3() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972}), (src:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 99079191802151398}) CREATE (dst)-[:Transfer]->(src)"); - } - - @Test - public void testTw4() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972, accountType:'card'})," - + " (src:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 99079191802151398}) CREATE (dst)-[:Withdraw]->(src)"); - } - - @Test - public void testTw8() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (loan)-[:Deposit]->(acc)"); - } - - @Test - public void testTw9() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (acc)-[:Repay]->(loan)"); - } - - @Test - public void testTw13() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 2199023255767})," - + " (p2:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 10995116278183})" - + " CREATE (p1)<-[:Guarantee]-(p2)"); - } - - @Test - public void testTsr1() { - Table result = - estore.query( - "MATCH (account:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}) RETURN account.createTime, account.isBlocked," - + " account.accountType"); - result.print(); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap accounts = new HashMap(); - HashMap companys = new HashMap(); - HashMap loans = new HashMap(); - HashMap mediums = new HashMap(); - - String datasetPath = "/sf0.01"; - - // Nodes - insertAccounts(datasetPath + "/" + "snapshot/Account.csv", accounts); - insertCompanys(datasetPath + "/" + "snapshot/Company.csv", companys); - insertLoans(datasetPath + "/" + "snapshot/Loan.csv", loans); - insertMediums(datasetPath + "/" + "snapshot/Medium.csv", mediums); - insertPersons(datasetPath + "/" + "snapshot/Person.csv", persons); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountRepayLoan.csv", - Account.class, - Loan.class, - accounts, - loans, - "setRepay"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountTransferAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setTransfer"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountWithdrawAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setWithdraw"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyApplyLoan.csv", - Company.class, - Loan.class, - companys, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyGuaranteeCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyInvestCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyOwnAccount.csv", - Company.class, - Account.class, - companys, - accounts, - "setOwn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/LoanDepositAccount.csv", - Loan.class, - Account.class, - loans, - accounts, - "setDeposit"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/MediumSignInAccount.csv", - Medium.class, - Account.class, - mediums, - accounts, - "setSignIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonApplyLoan.csv", - Person.class, - Loan.class, - persons, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonGuaranteePerson.csv", - Person.class, - Person.class, - persons, - persons, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonInvestCompany.csv", - Person.class, - Company.class, - persons, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonOwnAccount.csv", - Person.class, - Account.class, - persons, - accounts, - "setOwn"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Account account : accounts.values()) { - estore.insert(account); - } - for (Company company : companys.values()) { - estore.insert(company); - } - for (Loan loan : loans.values()) { - estore.insert(loan); - } - for (Medium medium : mediums.values()) { - estore.insert(medium); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long personId = Long.parseLong(csvRecord.get("personId")); - String personName = csvRecord.get("personName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String gender = csvRecord.get("gender"); - String birthday = csvRecord.get("birthday"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - - persons.put( - personId, - (new Person( - personId, personName, isBlocked, createTime, gender, birthday, country, city))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertAccounts(String filePath, HashMap accounts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long accountId = Long.parseLong(csvRecord.get("accountId")); - String createTime = csvRecord.get("createTime"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String accountType = csvRecord.get("accoutType"); - String nickname = csvRecord.get("nickname"); - String phonenum = csvRecord.get("phonenum"); - String email = csvRecord.get("email"); - String freqLoginType = csvRecord.get("freqLoginType"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String accountLevel = csvRecord.get("accountLevel"); - - accounts.put( - accountId, - new Account( - accountId, - createTime, - isBlocked, - accountType, - nickname, - phonenum, - email, - freqLoginType, - lastLoginTime, - accountLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertCompanys(String filePath, HashMap companys) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long companyId = Long.parseLong(csvRecord.get("companyId")); - String companyName = csvRecord.get("companyName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - String business = csvRecord.get("business"); - String description = csvRecord.get("description"); - String url = csvRecord.get("url"); - - companys.put( - companyId, - new Company( - companyId, - companyName, - isBlocked, - createTime, - country, - city, - business, - description, - url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertLoans(String filePath, HashMap loans) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long loanId = Long.parseLong(csvRecord.get("loanId")); - double loanAmount = Double.parseDouble(csvRecord.get("loanAmount")); - double balance = Double.parseDouble(csvRecord.get("balance")); - String createTime = csvRecord.get("createTime"); - String loanUsage = csvRecord.get("loanUsage"); - double interestRate = Double.parseDouble(csvRecord.get("interestRate")); - - loans.put( - loanId, new Loan(loanId, loanAmount, balance, createTime, loanUsage, interestRate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertMediums(String filePath, HashMap mediums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long mediumId = Long.parseLong(csvRecord.get("mediumId")); - String mediumType = csvRecord.get("mediumType"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String riskLevel = csvRecord.get("riskLevel"); - - mediums.put( - mediumId, - new Medium(mediumId, mediumType, isBlocked, createTime, lastLoginTime, riskLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest01.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest01.java deleted file mode 100644 index 8305901..0000000 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest01.java +++ /dev/null @@ -1,436 +0,0 @@ -package org.estore.eval.estore.ldbc.finbench; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.finbench.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest01 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - - readDataSet(); - } - - @Test - public void testTw1() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 1, personName:" - + " 'George'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1020342322, createTime: '26th March', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw2() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Company` {companyId: 12345," - + " companyName: 'Rand'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1213243435, createTime: 'February 5th', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw3() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972}), (src:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 99079191802151398}) CREATE (dst)-[:Transfer]->(src)"); - } - - @Test - public void testTw4() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972, accountType:'card'})," - + " (src:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 99079191802151398}) CREATE (dst)-[:Withdraw]->(src)"); - } - - @Test - public void testTw8() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (loan)-[:Deposit]->(acc)"); - } - - @Test - public void testTw9() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (acc)-[:Repay]->(loan)"); - } - - @Test - public void testTw13() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 2199023255767})," - + " (p2:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 10995116278183})" - + " CREATE (p1)<-[:Guarantee]-(p2)"); - } - - @Test - public void testTsr1() { - Table result = - estore.query( - "MATCH (account:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}) RETURN account.createTime, account.isBlocked," - + " account.accountType"); - assertEquals(result.get("account.createTime").get(0), "2020-11-11 18:44:24.021"); - assertEquals(result.get("account.isBlocked").get(0), false); - assertEquals(result.get("account.accountType").get(0), "certificate of deposit"); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap accounts = new HashMap(); - HashMap companys = new HashMap(); - HashMap loans = new HashMap(); - HashMap mediums = new HashMap(); - - String datasetPath = "/sf0.1"; - - // Nodes - insertAccounts(datasetPath + "/" + "snapshot/Account.csv", accounts); - insertCompanys(datasetPath + "/" + "snapshot/Company.csv", companys); - insertLoans(datasetPath + "/" + "snapshot/Loan.csv", loans); - insertMediums(datasetPath + "/" + "snapshot/Medium.csv", mediums); - insertPersons(datasetPath + "/" + "snapshot/Person.csv", persons); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountRepayLoan.csv", - Account.class, - Loan.class, - accounts, - loans, - "setRepay"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountTransferAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setTransfer"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountWithdrawAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setWithdraw"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyApplyLoan.csv", - Company.class, - Loan.class, - companys, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyGuaranteeCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyInvestCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyOwnAccount.csv", - Company.class, - Account.class, - companys, - accounts, - "setOwn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/LoanDepositAccount.csv", - Loan.class, - Account.class, - loans, - accounts, - "setDeposit"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/MediumSignInAccount.csv", - Medium.class, - Account.class, - mediums, - accounts, - "setSignIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonApplyLoan.csv", - Person.class, - Loan.class, - persons, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonGuaranteePerson.csv", - Person.class, - Person.class, - persons, - persons, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonInvestCompany.csv", - Person.class, - Company.class, - persons, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonOwnAccount.csv", - Person.class, - Account.class, - persons, - accounts, - "setOwn"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Account account : accounts.values()) { - estore.insert(account); - } - for (Company company : companys.values()) { - estore.insert(company); - } - for (Loan loan : loans.values()) { - estore.insert(loan); - } - for (Medium medium : mediums.values()) { - estore.insert(medium); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long personId = Long.parseLong(csvRecord.get("personId")); - String personName = csvRecord.get("personName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String gender = csvRecord.get("gender"); - String birthday = csvRecord.get("birthday"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - - persons.put( - personId, - (new Person( - personId, personName, isBlocked, createTime, gender, birthday, country, city))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertAccounts(String filePath, HashMap accounts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long accountId = Long.parseLong(csvRecord.get("accountId")); - String createTime = csvRecord.get("createTime"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String accountType = csvRecord.get("accoutType"); - String nickname = csvRecord.get("nickname"); - String phonenum = csvRecord.get("phonenum"); - String email = csvRecord.get("email"); - String freqLoginType = csvRecord.get("freqLoginType"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String accountLevel = csvRecord.get("accountLevel"); - - accounts.put( - accountId, - new Account( - accountId, - createTime, - isBlocked, - accountType, - nickname, - phonenum, - email, - freqLoginType, - lastLoginTime, - accountLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertCompanys(String filePath, HashMap companys) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long companyId = Long.parseLong(csvRecord.get("companyId")); - String companyName = csvRecord.get("companyName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - String business = csvRecord.get("business"); - String description = csvRecord.get("description"); - String url = csvRecord.get("url"); - - companys.put( - companyId, - new Company( - companyId, - companyName, - isBlocked, - createTime, - country, - city, - business, - description, - url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertLoans(String filePath, HashMap loans) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long loanId = Long.parseLong(csvRecord.get("loanId")); - double loanAmount = Double.parseDouble(csvRecord.get("loanAmount")); - double balance = Double.parseDouble(csvRecord.get("balance")); - String createTime = csvRecord.get("createTime"); - String loanUsage = csvRecord.get("loanUsage"); - double interestRate = Double.parseDouble(csvRecord.get("interestRate")); - - loans.put( - loanId, new Loan(loanId, loanAmount, balance, createTime, loanUsage, interestRate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertMediums(String filePath, HashMap mediums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long mediumId = Long.parseLong(csvRecord.get("mediumId")); - String mediumType = csvRecord.get("mediumType"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String riskLevel = csvRecord.get("riskLevel"); - - mediums.put( - mediumId, - new Medium(mediumId, mediumType, isBlocked, createTime, lastLoginTime, riskLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest03.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest03.java deleted file mode 100644 index 671adc7..0000000 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest03.java +++ /dev/null @@ -1,431 +0,0 @@ -package org.estore.eval.estore.ldbc.finbench; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.finbench.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -public class InGraphUnsafeTest03 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - - readDataSet(); - } - - @Test - public void testTw1() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 1, personName:" - + " 'George'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1020342322, createTime: '26th March', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw2() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Company` {companyId: 12345," - + " companyName: 'Rand'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1213243435, createTime: 'February 5th', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw3() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972}), (src:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 99079191802151398}) CREATE (dst)-[:Transfer]->(src)"); - } - - @Test - public void testTw4() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972, accountType:'card'})," - + " (src:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 99079191802151398}) CREATE (dst)-[:Withdraw]->(src)"); - } - - @Test - public void testTw8() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (loan)-[:Deposit]->(acc)"); - } - - @Test - public void testTw9() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (acc)-[:Repay]->(loan)"); - } - - @Test - public void testTw13() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 2199023255767})," - + " (p2:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 10995116278183})" - + " CREATE (p1)<-[:Guarantee]-(p2)"); - } - - @Test - public void testTsr1() { - Table result = - estore.query( - "MATCH (account:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}) RETURN account.createTime, account.isBlocked," - + " account.accountType"); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap accounts = new HashMap(); - HashMap companys = new HashMap(); - HashMap loans = new HashMap(); - HashMap mediums = new HashMap(); - - String datasetPath = "/sf0.3"; - - // Nodes - insertAccounts(datasetPath + "/" + "snapshot/Account.csv", accounts); - insertCompanys(datasetPath + "/" + "snapshot/Company.csv", companys); - insertLoans(datasetPath + "/" + "snapshot/Loan.csv", loans); - insertMediums(datasetPath + "/" + "snapshot/Medium.csv", mediums); - insertPersons(datasetPath + "/" + "snapshot/Person.csv", persons); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountRepayLoan.csv", - Account.class, - Loan.class, - accounts, - loans, - "setRepay"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountTransferAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setTransfer"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountWithdrawAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setWithdraw"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyApplyLoan.csv", - Company.class, - Loan.class, - companys, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyGuaranteeCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyInvestCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyOwnAccount.csv", - Company.class, - Account.class, - companys, - accounts, - "setOwn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/LoanDepositAccount.csv", - Loan.class, - Account.class, - loans, - accounts, - "setDeposit"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/MediumSignInAccount.csv", - Medium.class, - Account.class, - mediums, - accounts, - "setSignIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonApplyLoan.csv", - Person.class, - Loan.class, - persons, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonGuaranteePerson.csv", - Person.class, - Person.class, - persons, - persons, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonInvestCompany.csv", - Person.class, - Company.class, - persons, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonOwnAccount.csv", - Person.class, - Account.class, - persons, - accounts, - "setOwn"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Account account : accounts.values()) { - estore.insert(account); - } - for (Company company : companys.values()) { - estore.insert(company); - } - for (Loan loan : loans.values()) { - estore.insert(loan); - } - for (Medium medium : mediums.values()) { - estore.insert(medium); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long personId = Long.parseLong(csvRecord.get("personId")); - String personName = csvRecord.get("personName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String gender = csvRecord.get("gender"); - String birthday = csvRecord.get("birthday"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - - persons.put( - personId, - (new Person( - personId, personName, isBlocked, createTime, gender, birthday, country, city))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertAccounts(String filePath, HashMap accounts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long accountId = Long.parseLong(csvRecord.get("accountId")); - String createTime = csvRecord.get("createTime"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String accountType = csvRecord.get("accoutType"); - String nickname = csvRecord.get("nickname"); - String phonenum = csvRecord.get("phonenum"); - String email = csvRecord.get("email"); - String freqLoginType = csvRecord.get("freqLoginType"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String accountLevel = csvRecord.get("accountLevel"); - - accounts.put( - accountId, - new Account( - accountId, - createTime, - isBlocked, - accountType, - nickname, - phonenum, - email, - freqLoginType, - lastLoginTime, - accountLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertCompanys(String filePath, HashMap companys) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long companyId = Long.parseLong(csvRecord.get("companyId")); - String companyName = csvRecord.get("companyName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - String business = csvRecord.get("business"); - String description = csvRecord.get("description"); - String url = csvRecord.get("url"); - - companys.put( - companyId, - new Company( - companyId, - companyName, - isBlocked, - createTime, - country, - city, - business, - description, - url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertLoans(String filePath, HashMap loans) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long loanId = Long.parseLong(csvRecord.get("loanId")); - double loanAmount = Double.parseDouble(csvRecord.get("loanAmount")); - double balance = Double.parseDouble(csvRecord.get("balance")); - String createTime = csvRecord.get("createTime"); - String loanUsage = csvRecord.get("loanUsage"); - double interestRate = Double.parseDouble(csvRecord.get("interestRate")); - - loans.put( - loanId, new Loan(loanId, loanAmount, balance, createTime, loanUsage, interestRate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertMediums(String filePath, HashMap mediums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long mediumId = Long.parseLong(csvRecord.get("mediumId")); - String mediumType = csvRecord.get("mediumType"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String riskLevel = csvRecord.get("riskLevel"); - - mediums.put( - mediumId, - new Medium(mediumId, mediumType, isBlocked, createTime, lastLoginTime, riskLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest10.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest10.java deleted file mode 100644 index 302e121..0000000 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest10.java +++ /dev/null @@ -1,431 +0,0 @@ -package org.estore.eval.estore.ldbc.finbench; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.finbench.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -public class InGraphUnsafeTest10 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - - readDataSet(); - } - - @Test - public void testTw1() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 1, personName:" - + " 'George'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1020342322, createTime: '26th March', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw2() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Company` {companyId: 12345," - + " companyName: 'Rand'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1213243435, createTime: 'February 5th', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw3() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972}), (src:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 99079191802151398}) CREATE (dst)-[:Transfer]->(src)"); - } - - @Test - public void testTw4() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972, accountType:'card'})," - + " (src:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 99079191802151398}) CREATE (dst)-[:Withdraw]->(src)"); - } - - @Test - public void testTw8() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (loan)-[:Deposit]->(acc)"); - } - - @Test - public void testTw9() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (acc)-[:Repay]->(loan)"); - } - - @Test - public void testTw13() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 2199023255767})," - + " (p2:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 10995116278183})" - + " CREATE (p1)<-[:Guarantee]-(p2)"); - } - - @Test - public void testTsr1() { - Table result = - estore.query( - "MATCH (account:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}) RETURN account.createTime, account.isBlocked," - + " account.accountType"); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap accounts = new HashMap(); - HashMap companys = new HashMap(); - HashMap loans = new HashMap(); - HashMap mediums = new HashMap(); - - String datasetPath = "/sf10"; - - // Nodes - insertAccounts(datasetPath + "/" + "snapshot/Account.csv", accounts); - insertCompanys(datasetPath + "/" + "snapshot/Company.csv", companys); - insertLoans(datasetPath + "/" + "snapshot/Loan.csv", loans); - insertMediums(datasetPath + "/" + "snapshot/Medium.csv", mediums); - insertPersons(datasetPath + "/" + "snapshot/Person.csv", persons); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountRepayLoan.csv", - Account.class, - Loan.class, - accounts, - loans, - "setRepay"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountTransferAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setTransfer"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountWithdrawAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setWithdraw"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyApplyLoan.csv", - Company.class, - Loan.class, - companys, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyGuaranteeCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyInvestCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyOwnAccount.csv", - Company.class, - Account.class, - companys, - accounts, - "setOwn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/LoanDepositAccount.csv", - Loan.class, - Account.class, - loans, - accounts, - "setDeposit"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/MediumSignInAccount.csv", - Medium.class, - Account.class, - mediums, - accounts, - "setSignIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonApplyLoan.csv", - Person.class, - Loan.class, - persons, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonGuaranteePerson.csv", - Person.class, - Person.class, - persons, - persons, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonInvestCompany.csv", - Person.class, - Company.class, - persons, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonOwnAccount.csv", - Person.class, - Account.class, - persons, - accounts, - "setOwn"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Account account : accounts.values()) { - estore.insert(account); - } - for (Company company : companys.values()) { - estore.insert(company); - } - for (Loan loan : loans.values()) { - estore.insert(loan); - } - for (Medium medium : mediums.values()) { - estore.insert(medium); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long personId = Long.parseLong(csvRecord.get("personId")); - String personName = csvRecord.get("personName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String gender = csvRecord.get("gender"); - String birthday = csvRecord.get("birthday"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - - persons.put( - personId, - (new Person( - personId, personName, isBlocked, createTime, gender, birthday, country, city))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertAccounts(String filePath, HashMap accounts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long accountId = Long.parseLong(csvRecord.get("accountId")); - String createTime = csvRecord.get("createTime"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String accountType = csvRecord.get("accoutType"); - String nickname = csvRecord.get("nickname"); - String phonenum = csvRecord.get("phonenum"); - String email = csvRecord.get("email"); - String freqLoginType = csvRecord.get("freqLoginType"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String accountLevel = csvRecord.get("accountLevel"); - - accounts.put( - accountId, - new Account( - accountId, - createTime, - isBlocked, - accountType, - nickname, - phonenum, - email, - freqLoginType, - lastLoginTime, - accountLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertCompanys(String filePath, HashMap companys) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long companyId = Long.parseLong(csvRecord.get("companyId")); - String companyName = csvRecord.get("companyName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - String business = csvRecord.get("business"); - String description = csvRecord.get("description"); - String url = csvRecord.get("url"); - - companys.put( - companyId, - new Company( - companyId, - companyName, - isBlocked, - createTime, - country, - city, - business, - description, - url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertLoans(String filePath, HashMap loans) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long loanId = Long.parseLong(csvRecord.get("loanId")); - double loanAmount = Double.parseDouble(csvRecord.get("loanAmount")); - double balance = Double.parseDouble(csvRecord.get("balance")); - String createTime = csvRecord.get("createTime"); - String loanUsage = csvRecord.get("loanUsage"); - double interestRate = Double.parseDouble(csvRecord.get("interestRate")); - - loans.put( - loanId, new Loan(loanId, loanAmount, balance, createTime, loanUsage, interestRate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertMediums(String filePath, HashMap mediums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long mediumId = Long.parseLong(csvRecord.get("mediumId")); - String mediumType = csvRecord.get("mediumType"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String riskLevel = csvRecord.get("riskLevel"); - - mediums.put( - mediumId, - new Medium(mediumId, mediumType, isBlocked, createTime, lastLoginTime, riskLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest3.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest3.java deleted file mode 100644 index 0d37382..0000000 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/InGraphUnsafeTest3.java +++ /dev/null @@ -1,431 +0,0 @@ -package org.estore.eval.estore.ldbc.finbench; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.finbench.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -public class InGraphUnsafeTest3 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - - readDataSet(); - } - - @Test - public void testTw1() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 1, personName:" - + " 'George'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1020342322, createTime: '26th March', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw2() { - Table result = - estore.query( - "CREATE (:`org.estore.eval.estore.ldbc.finbench.util.Company` {companyId: 12345," - + " companyName: 'Rand'})-[:Own]->(:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 1213243435, createTime: 'February 5th', isBlocked: False," - + " accountType: 'brokerage account'})"); - } - - @Test - public void testTw3() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972}), (src:`org.estore.eval.estore.ldbc.finbench.util.Account`" - + " {accountId: 99079191802151398}) CREATE (dst)-[:Transfer]->(src)"); - } - - @Test - public void testTw4() { - Table result = - estore.query( - " MATCH (dst:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4619004367821865972, accountType:'card'})," - + " (src:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 99079191802151398}) CREATE (dst)-[:Withdraw]->(src)"); - } - - @Test - public void testTw8() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (loan)-[:Deposit]->(acc)"); - } - - @Test - public void testTw9() { - Table result = - estore.query( - "MATCH (acc:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}), (loan:`org.estore.eval.estore.ldbc.finbench.util.Loan`" - + " {loanId: 4684025087442027461}) CREATE (acc)-[:Repay]->(loan)"); - } - - @Test - public void testTw13() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 2199023255767})," - + " (p2:`org.estore.eval.estore.ldbc.finbench.util.Person` {personId: 10995116278183})" - + " CREATE (p1)<-[:Guarantee]-(p2)"); - } - - @Test - public void testTsr1() { - Table result = - estore.query( - "MATCH (account:`org.estore.eval.estore.ldbc.finbench.util.Account` {accountId:" - + " 4700350636091245930}) RETURN account.createTime, account.isBlocked," - + " account.accountType"); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap accounts = new HashMap(); - HashMap companys = new HashMap(); - HashMap loans = new HashMap(); - HashMap mediums = new HashMap(); - - String datasetPath = "/sf3"; - - // Nodes - insertAccounts(datasetPath + "/" + "snapshot/Account.csv", accounts); - insertCompanys(datasetPath + "/" + "snapshot/Company.csv", companys); - insertLoans(datasetPath + "/" + "snapshot/Loan.csv", loans); - insertMediums(datasetPath + "/" + "snapshot/Medium.csv", mediums); - insertPersons(datasetPath + "/" + "snapshot/Person.csv", persons); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountRepayLoan.csv", - Account.class, - Loan.class, - accounts, - loans, - "setRepay"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountTransferAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setTransfer"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/AccountWithdrawAccount.csv", - Account.class, - Account.class, - accounts, - accounts, - "setWithdraw"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyApplyLoan.csv", - Company.class, - Loan.class, - companys, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyGuaranteeCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyInvestCompany.csv", - Company.class, - Company.class, - companys, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/CompanyOwnAccount.csv", - Company.class, - Account.class, - companys, - accounts, - "setOwn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/LoanDepositAccount.csv", - Loan.class, - Account.class, - loans, - accounts, - "setDeposit"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/MediumSignInAccount.csv", - Medium.class, - Account.class, - mediums, - accounts, - "setSignIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonApplyLoan.csv", - Person.class, - Loan.class, - persons, - loans, - "setApply"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonGuaranteePerson.csv", - Person.class, - Person.class, - persons, - persons, - "setGuarantee"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonInvestCompany.csv", - Person.class, - Company.class, - persons, - companys, - "setInvest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "snapshot/PersonOwnAccount.csv", - Person.class, - Account.class, - persons, - accounts, - "setOwn"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Account account : accounts.values()) { - estore.insert(account); - } - for (Company company : companys.values()) { - estore.insert(company); - } - for (Loan loan : loans.values()) { - estore.insert(loan); - } - for (Medium medium : mediums.values()) { - estore.insert(medium); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long personId = Long.parseLong(csvRecord.get("personId")); - String personName = csvRecord.get("personName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String gender = csvRecord.get("gender"); - String birthday = csvRecord.get("birthday"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - - persons.put( - personId, - (new Person( - personId, personName, isBlocked, createTime, gender, birthday, country, city))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertAccounts(String filePath, HashMap accounts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long accountId = Long.parseLong(csvRecord.get("accountId")); - String createTime = csvRecord.get("createTime"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String accountType = csvRecord.get("accoutType"); - String nickname = csvRecord.get("nickname"); - String phonenum = csvRecord.get("phonenum"); - String email = csvRecord.get("email"); - String freqLoginType = csvRecord.get("freqLoginType"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String accountLevel = csvRecord.get("accountLevel"); - - accounts.put( - accountId, - new Account( - accountId, - createTime, - isBlocked, - accountType, - nickname, - phonenum, - email, - freqLoginType, - lastLoginTime, - accountLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertCompanys(String filePath, HashMap companys) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long companyId = Long.parseLong(csvRecord.get("companyId")); - String companyName = csvRecord.get("companyName"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - String country = csvRecord.get("country"); - String city = csvRecord.get("city"); - String business = csvRecord.get("business"); - String description = csvRecord.get("description"); - String url = csvRecord.get("url"); - - companys.put( - companyId, - new Company( - companyId, - companyName, - isBlocked, - createTime, - country, - city, - business, - description, - url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertLoans(String filePath, HashMap loans) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long loanId = Long.parseLong(csvRecord.get("loanId")); - double loanAmount = Double.parseDouble(csvRecord.get("loanAmount")); - double balance = Double.parseDouble(csvRecord.get("balance")); - String createTime = csvRecord.get("createTime"); - String loanUsage = csvRecord.get("loanUsage"); - double interestRate = Double.parseDouble(csvRecord.get("interestRate")); - - loans.put( - loanId, new Loan(loanId, loanAmount, balance, createTime, loanUsage, interestRate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertMediums(String filePath, HashMap mediums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long mediumId = Long.parseLong(csvRecord.get("mediumId")); - String mediumType = csvRecord.get("mediumType"); - boolean isBlocked = Boolean.parseBoolean(csvRecord.get("isBlocked")); - String createTime = csvRecord.get("createTime"); - long lastLoginTime = Long.parseLong(csvRecord.get("lastLoginTime")); - String riskLevel = csvRecord.get("riskLevel"); - - mediums.put( - mediumId, - new Medium(mediumId, mediumType, isBlocked, createTime, lastLoginTime, riskLevel)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest001.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest001.java index 7d9d89e..3caf3c7 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest001.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest001.java @@ -180,7 +180,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/sf0.01"; HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest01.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest01.java index 80473d2..714fff3 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest01.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest01.java @@ -163,7 +163,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/sf0.1"; HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest03.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest03.java index 2f51dfc..26cb86f 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest03.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest03.java @@ -163,7 +163,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/sf0.3"; HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest10.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest10.java index 351b634..3084434 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest10.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest10.java @@ -163,7 +163,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/sf10"; HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest3.java b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest3.java index 4bd6156..b47eb4c 100644 --- a/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest3.java +++ b/eval/estore/ldbc/finbench/src/test/java/org/estore/eval/estore/ldbc/finbench/Neo4jImpermanantTest3.java @@ -163,7 +163,7 @@ public void testTsr1() { } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/sf3"; HashMap accounts = new HashMap(); HashMap companys = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest01.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest01.java index 9f5ca42..3763916 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest01.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest01.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest01 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -129,7 +130,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest03.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest03.java index c6ea4c2..3956fde 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest03.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest03.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest03 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -139,7 +140,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest1.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest1.java index 5dbcd88..75cb4cd 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest1.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest1.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest1 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -139,7 +140,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest10.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest10.java index 5b0da17..dc1b550 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest10.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest10.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest10 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -138,7 +139,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest3.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest3.java index ac8ce28..3432dfe 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest3.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphReflectionTest3.java @@ -17,14 +17,15 @@ import org.estore.planner.util.Table; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.estore.EstoreException; public class InGraphReflectionTest3 { private Estore estore; @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(false).profile(true)); + public void setupData() throws EstoreException { + estore = new Estore("myDb", new EstoreOptions().profile(true)); readDataSet(); } @@ -138,7 +139,7 @@ public void testInteractiveUpdateQuery8() { assertEquals(result.get("COUNT(r)").get(0), 1); } - public void readDataSet() throws Exception { + public void readDataSet() throws EstoreException { HashMap persons = new HashMap(); HashMap places = new HashMap(); HashMap tags = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest01.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest01.java deleted file mode 100644 index cec2a09..0000000 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest01.java +++ /dev/null @@ -1,585 +0,0 @@ -package org.estore.eval.estore.ldbc.snb; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.snb.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest01 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - readDataSet(); - } - - @Test - public void testInteractiveDeleteQuery2() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:10995116278291})-[likes:LIKES2]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Post;`" - + " {id:343597383821}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - @Test - public void testInteractiveDeleteQuery3() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:19791209300608})-[likes:LIKES1]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Comment;`" - + " {id:549755814421}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - @Test - public void testInteractiveDeleteQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Forum`" - + " {id:481036337162})-[hasMember:HAS_MEMBER]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`" - + " {id:2199023256077}) DELETE hasMember RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - @Test - public void testInteractiveShortQuery1() { - Table result = - estore.query( - "MATCH (n:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833679})-[:IS_LOCATED_IN]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Place;`)" - + " RETURN n.firstName AS firstName, n.lastName AS lastName, n.birthday AS" - + " birthday, n.locationIP AS locationIP, n.browserUsed AS browserUsed, p.id AS" - + " cityId, n.gender AS gender, n.creationDate AS creationDate"); - assertEquals(result.get("birthday").get(0), 579484800000L); - assertEquals(result.get("firstName").get(0), "Min-Jung"); - assertEquals(result.get("lastName").get(0), "Park"); - assertEquals(result.get("gender").get(0), "female"); - assertEquals(result.get("browserUsed").get(0), "Internet Explorer"); - assertEquals(result.get("locationIP").get(0), "42.18.171.166"); - assertEquals(result.get("cityId").get(0), 1342L); - assertEquals(result.get("creationDate").get(0), 1345825908405L); - } - - @Test - public void testInteractiveShortQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Comment`" - + " {id:206158430603})-[:HAS_CREATOR]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`)" - + " RETURN p.id AS personId, p.firstName AS firstName, p.lastName AS lastName"); - assertEquals(result.get("firstName").get(0), "Rudolf"); - assertEquals(result.get("lastName").get(0), "Engel"); - assertEquals(result.get("personId").get(0), 2199023256437L); - } - - @Test - public void testInteractiveUpdateQuery2() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:10995116278291})," - + " (post:`org.estore.eval.estore.ldbc.snb.util.Post` {id:481036337280}) CREATE" - + " (person)-[r:LIKES2]->(post) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - @Test - public void testInteractiveUpdateQuery3() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:19791209301454})," - + " (comment:`org.estore.eval.estore.ldbc.snb.util.Comment` {id:481036337631}) CREATE" - + " (person)-[r:LIKES1]->(comment) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - @Test - public void testInteractiveUpdateQuery5() { - Table result = - estore.query( - "MATCH (f:`org.estore.eval.estore.ldbc.snb.util.Forum` {id:549755813984})," - + " (p:`org.estore.eval.estore.ldbc.snb.util.Person` {id:19791209300852}) CREATE" - + " (f)-[r:HAS_MEMBER]->(p) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - @Test - public void testInteractiveUpdateQuery8() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.snb.util.Person` {id:4398046512167})," - + " (p2:`org.estore.eval.estore.ldbc.snb.util.Person` {id:2199023256816}) CREATE" - + " (p1)-[r:KNOWS]->(p2) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap places = new HashMap(); - HashMap tags = new HashMap(); - HashMap tagclasses = new HashMap(); - HashMap comments = new HashMap(); - HashMap forums = new HashMap(); - HashMap posts = new HashMap(); - HashMap organisations = new HashMap(); - - String datasetPath = "/social_network-csv_composite-longdateformatter-sf0.1"; - - // Nodes - insertPlaces(datasetPath + "/" + "static/place_0_0.csv", places); - insertTagClasses(datasetPath + "/" + "static/tagclass_0_0.csv", tagclasses); - insertTags(datasetPath + "/" + "static/tag_0_0.csv", tags); - insertForums(datasetPath + "/" + "dynamic/forum_0_0.csv", forums); - insertPersons(datasetPath + "/" + "dynamic/person_0_0.csv", persons); - insertComments(datasetPath + "/" + "dynamic/comment_0_0.csv", comments); - insertPosts(datasetPath + "/" + "dynamic/post_0_0.csv", posts); - insertOrganisations(datasetPath + "/" + "static/organisation_0_0.csv", organisations); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/place_isPartOf_place_0_0.csv", - Place.class, - Place.class, - places, - places, - "setIsPartOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_isLocatedIn_place_0_0.csv", - Person.class, - Place.class, - persons, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tag_hasType_tagclass_0_0.csv", - Tag.class, - TagClass.class, - tags, - tagclasses, - "setHasType"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasCreator_person_0_0.csv", - Comment.class, - Person.class, - comments, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_isLocatedIn_place_0_0.csv", - Comment.class, - Place.class, - comments, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_comment_0_0.csv", - Comment.class, - Comment.class, - comments, - comments, - "setIsReplyOf1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_post_0_0.csv", - Comment.class, - Post.class, - comments, - posts, - "setIsReplyOf2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_containerOf_post_0_0.csv", - Forum.class, - Post.class, - forums, - posts, - "setContainerOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasMember_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasMember"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasModerator_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasModerator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasTag_tag_0_0.csv", - Forum.class, - Tag.class, - forums, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_hasInterest_tag_0_0.csv", - Person.class, - Tag.class, - persons, - tags, - "setHasInterest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_knows_person_0_0.csv", - Person.class, - Person.class, - persons, - persons, - "setKnows"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_comment_0_0.csv", - Person.class, - Comment.class, - persons, - comments, - "setLikes1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_post_0_0.csv", - Person.class, - Post.class, - persons, - posts, - "setLikes2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasCreator_person_0_0.csv", - Post.class, - Person.class, - posts, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasTag_tag_0_0.csv", - Comment.class, - Tag.class, - comments, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasTag_tag_0_0.csv", - Post.class, - Tag.class, - posts, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_isLocatedIn_place_0_0.csv", - Post.class, - Place.class, - posts, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_studyAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setStudyAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_workAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setWorkAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/organisation_isLocatedIn_place_0_0.csv", - Organisation.class, - Place.class, - organisations, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tagclass_isSubclassOf_tagclass_0_0.csv", - TagClass.class, - TagClass.class, - tagclasses, - tagclasses, - "setIsSubclassOf"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Place place : places.values()) { - estore.insert(place); - } - for (TagClass tagclass : tagclasses.values()) { - estore.insert(tagclass); - } - for (Tag tag : tags.values()) { - estore.insert(tag); - } - for (Post post : posts.values()) { - estore.insert(post); - } - for (Comment comment : comments.values()) { - estore.insert(comment); - } - for (Forum forum : forums.values()) { - estore.insert(forum); - } - for (Organisation organisation : organisations.values()) { - estore.insert(organisation); - } - } - - private void insertPlaces(String filePath, HashMap places) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - String type = csvRecord.get("type"); - places.put(id, (new Place(id, name, url, type))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTagClasses(String filePath, HashMap tagclasses) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tagclasses.put(id, new TagClass(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTags(String filePath, HashMap tags) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tags.put(id, new Tag(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertOrganisations(String filePath, HashMap organisations) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String type = csvRecord.get("type"); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - organisations.put(id, new Organisation(id, type, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertForums(String filePath, HashMap forums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String title = csvRecord.get("title"); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - - forums.put(id, new Forum(id, title, creationDate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String firstName = csvRecord.get("firstName"); - String lastName = csvRecord.get("lastName"); - String gender = csvRecord.get("gender"); - long birthday = Long.parseLong(csvRecord.get("birthday")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String email = csvRecord.get("email"); - - persons.put( - id, - new Person( - id, - firstName, - lastName, - gender, - birthday, - creationDate, - locationIP, - browserUsed, - language, - email)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertComments(String filePath, HashMap comments) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - comments.put(id, new Comment(id, creationDate, locationIP, browserUsed, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPosts(String filePath, HashMap posts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - posts.put( - id, new Post(id, creationDate, locationIP, browserUsed, language, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest03.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest03.java deleted file mode 100644 index 27f1533..0000000 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest03.java +++ /dev/null @@ -1,595 +0,0 @@ -package org.estore.eval.estore.ldbc.snb; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.snb.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest03 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - readDataSet(); - } - - // - @Test - public void testInteractiveDeleteQuery2() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:24189255814068})-[likes:LIKES2]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Post;`" - + " {id:481036337191}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery3() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:2199023256437})-[likes:LIKES1]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Comment;`" - + " {id:1030792151057}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Forum`" - + " {id:893353197569})-[hasMember:HAS_MEMBER]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`" - + " {id:24189255814068}) DELETE hasMember RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveShortQuery1() { - Table result = - estore.query( - "MATCH (n:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833679})-[:IS_LOCATED_IN]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Place;`)" - + " RETURN n.firstName AS firstName, n.lastName AS lastName, n.birthday AS" - + " birthday, n.locationIP AS locationIP, n.browserUsed AS browserUsed, p.id AS" - + " cityId, n.gender AS gender, n.creationDate AS creationDate"); - assertEquals(result.get("birthday").get(0), 579484800000L); - assertEquals(result.get("firstName").get(0), "Min-Jung"); - assertEquals(result.get("lastName").get(0), "Park"); - assertEquals(result.get("gender").get(0), "female"); - assertEquals(result.get("browserUsed").get(0), "Internet Explorer"); - assertEquals(result.get("locationIP").get(0), "42.18.171.166"); - assertEquals(result.get("cityId").get(0), 1342L); - assertEquals(result.get("creationDate").get(0), 1345825908405L); - } - - // - @Test - public void testInteractiveShortQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Comment`" - + " {id:1030792151047})-[:HAS_CREATOR]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`)" - + " RETURN p.id AS personId, p.firstName AS firstName, p.lastName AS lastName"); - assertEquals(result.get("firstName").get(0), "Rudolf"); - assertEquals(result.get("lastName").get(0), "Engel"); - assertEquals(result.get("personId").get(0), 2199023256437L); - } - - // - @Test - public void testInteractiveUpdateQuery2() { - - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:15393162790400})," - + " (post:`org.estore.eval.estore.ldbc.snb.util.Post` {id:206158430485}) CREATE" - + " (person)-[r:LIKES2]->(post) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery3() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069769310})," - + " (comment:`org.estore.eval.estore.ldbc.snb.util.Comment` {id:962072676825}) CREATE" - + " (person)-[r:LIKES1]->(comment) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery5() { - Table result = - estore.query( - "MATCH (f:`org.estore.eval.estore.ldbc.snb.util.Forum` {id:893353197569})," - + " (p:`org.estore.eval.estore.ldbc.snb.util.Person` {id:15393162790400}) CREATE" - + " (f)-[r:HAS_MEMBER]->(p) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery8() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.snb.util.Person` {id:2199023256684})," - + " (p2:`org.estore.eval.estore.ldbc.snb.util.Person` {id:4398046513209}) CREATE" - + " (p1)-[r:KNOWS]->(p2) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap places = new HashMap(); - HashMap tags = new HashMap(); - HashMap tagclasses = new HashMap(); - HashMap comments = new HashMap(); - HashMap forums = new HashMap(); - HashMap posts = new HashMap(); - HashMap organisations = new HashMap(); - - String datasetPath = "/social_network-csv_composite-longdateformatter-sf0.3"; - - // Nodes - insertPlaces(datasetPath + "/" + "static/place_0_0.csv", places); - insertTagClasses(datasetPath + "/" + "static/tagclass_0_0.csv", tagclasses); - insertTags(datasetPath + "/" + "static/tag_0_0.csv", tags); - insertForums(datasetPath + "/" + "dynamic/forum_0_0.csv", forums); - insertPersons(datasetPath + "/" + "dynamic/person_0_0.csv", persons); - insertComments(datasetPath + "/" + "dynamic/comment_0_0.csv", comments); - insertPosts(datasetPath + "/" + "dynamic/post_0_0.csv", posts); - insertOrganisations(datasetPath + "/" + "static/organisation_0_0.csv", organisations); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/place_isPartOf_place_0_0.csv", - Place.class, - Place.class, - places, - places, - "setIsPartOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_isLocatedIn_place_0_0.csv", - Person.class, - Place.class, - persons, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tag_hasType_tagclass_0_0.csv", - Tag.class, - TagClass.class, - tags, - tagclasses, - "setHasType"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasCreator_person_0_0.csv", - Comment.class, - Person.class, - comments, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_isLocatedIn_place_0_0.csv", - Comment.class, - Place.class, - comments, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_comment_0_0.csv", - Comment.class, - Comment.class, - comments, - comments, - "setIsReplyOf1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_post_0_0.csv", - Comment.class, - Post.class, - comments, - posts, - "setIsReplyOf2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_containerOf_post_0_0.csv", - Forum.class, - Post.class, - forums, - posts, - "setContainerOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasMember_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasMember"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasModerator_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasModerator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasTag_tag_0_0.csv", - Forum.class, - Tag.class, - forums, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_hasInterest_tag_0_0.csv", - Person.class, - Tag.class, - persons, - tags, - "setHasInterest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_knows_person_0_0.csv", - Person.class, - Person.class, - persons, - persons, - "setKnows"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_comment_0_0.csv", - Person.class, - Comment.class, - persons, - comments, - "setLikes1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_post_0_0.csv", - Person.class, - Post.class, - persons, - posts, - "setLikes2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasCreator_person_0_0.csv", - Post.class, - Person.class, - posts, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasTag_tag_0_0.csv", - Comment.class, - Tag.class, - comments, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasTag_tag_0_0.csv", - Post.class, - Tag.class, - posts, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_isLocatedIn_place_0_0.csv", - Post.class, - Place.class, - posts, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_studyAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setStudyAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_workAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setWorkAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/organisation_isLocatedIn_place_0_0.csv", - Organisation.class, - Place.class, - organisations, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tagclass_isSubclassOf_tagclass_0_0.csv", - TagClass.class, - TagClass.class, - tagclasses, - tagclasses, - "setIsSubclassOf"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Place place : places.values()) { - estore.insert(place); - } - for (TagClass tagclass : tagclasses.values()) { - estore.insert(tagclass); - } - for (Tag tag : tags.values()) { - estore.insert(tag); - } - for (Post post : posts.values()) { - estore.insert(post); - } - for (Comment comment : comments.values()) { - estore.insert(comment); - } - for (Forum forum : forums.values()) { - estore.insert(forum); - } - for (Organisation organisation : organisations.values()) { - estore.insert(organisation); - } - } - - private void insertPlaces(String filePath, HashMap places) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - String type = csvRecord.get("type"); - places.put(id, (new Place(id, name, url, type))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTagClasses(String filePath, HashMap tagclasses) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tagclasses.put(id, new TagClass(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTags(String filePath, HashMap tags) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tags.put(id, new Tag(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertOrganisations(String filePath, HashMap organisations) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String type = csvRecord.get("type"); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - organisations.put(id, new Organisation(id, type, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertForums(String filePath, HashMap forums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String title = csvRecord.get("title"); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - - forums.put(id, new Forum(id, title, creationDate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String firstName = csvRecord.get("firstName"); - String lastName = csvRecord.get("lastName"); - String gender = csvRecord.get("gender"); - long birthday = Long.parseLong(csvRecord.get("birthday")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String email = csvRecord.get("email"); - - persons.put( - id, - new Person( - id, - firstName, - lastName, - gender, - birthday, - creationDate, - locationIP, - browserUsed, - language, - email)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertComments(String filePath, HashMap comments) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - comments.put(id, new Comment(id, creationDate, locationIP, browserUsed, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPosts(String filePath, HashMap posts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - posts.put( - id, new Post(id, creationDate, locationIP, browserUsed, language, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest1.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest1.java deleted file mode 100644 index a45f37e..0000000 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest1.java +++ /dev/null @@ -1,595 +0,0 @@ -package org.estore.eval.estore.ldbc.snb; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.snb.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest1 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - readDataSet(); - } - - // - - @Test - public void testInteractiveDeleteQuery2() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:6597069777240})-[likes:LIKES2]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Post;`" - + " {id:1374389534822}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery3() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833579})-[likes:LIKES1]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Comment;`" - + " {id:2061584302097}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Forum`" - + " {id:1786706395137})-[hasMember:HAS_MEMBER]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`" - + " {id:6597069777240}) DELETE hasMember RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveShortQuery1() { - Table result = - estore.query( - "MATCH (n:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833679})-[:IS_LOCATED_IN]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Place;`)" - + " RETURN n.firstName AS firstName, n.lastName AS lastName, n.birthday AS" - + " birthday, n.locationIP AS locationIP, n.browserUsed AS browserUsed, p.id AS" - + " cityId, n.gender AS gender, n.creationDate AS creationDate"); - assertEquals(result.get("birthday").get(0), 579484800000L); - assertEquals(result.get("firstName").get(0), "Min-Jung"); - assertEquals(result.get("lastName").get(0), "Park"); - assertEquals(result.get("gender").get(0), "female"); - assertEquals(result.get("browserUsed").get(0), "Internet Explorer"); - assertEquals(result.get("locationIP").get(0), "42.18.171.166"); - assertEquals(result.get("cityId").get(0), 1342L); - assertEquals(result.get("creationDate").get(0), 1345825908405L); - } - - // - @Test - public void testInteractiveShortQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Comment`" - + " {id:1511828523046})-[:HAS_CREATOR]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`)" - + " RETURN p.id AS personId, p.firstName AS firstName, p.lastName AS lastName"); - assertEquals(result.get("firstName").get(0), "Rudolf"); - assertEquals(result.get("lastName").get(0), "Engel"); - assertEquals(result.get("personId").get(0), 2199023256437L); - } - - // - @Test - public void testInteractiveUpdateQuery2() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069777240})," - + " (post:`org.estore.eval.estore.ldbc.snb.util.Post` {id:549755815810}) CREATE" - + " (person)-[r:LIKES2]->(post) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery3() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:10995116284808})," - + " (comment:`org.estore.eval.estore.ldbc.snb.util.Comment` {id:824633722450}) CREATE" - + " (person)-[:LIKES1]->(comment) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery5() { - Table result = - estore.query( - "MATCH (f:`org.estore.eval.estore.ldbc.snb.util.Forum` {id:1374389534723})," - + " (p:`org.estore.eval.estore.ldbc.snb.util.Person` {id:32985348838375}) CREATE" - + " (f)-[:HAS_MEMBER]->(p) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery8() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.snb.util.Person` {id:2199023256684})," - + " (p2:`org.estore.eval.estore.ldbc.snb.util.Person` {id:21990232560132}) CREATE" - + " (p1)-[:KNOWS]->(p2) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap places = new HashMap(); - HashMap tags = new HashMap(); - HashMap tagclasses = new HashMap(); - HashMap comments = new HashMap(); - HashMap forums = new HashMap(); - HashMap posts = new HashMap(); - HashMap organisations = new HashMap(); - - String datasetPath = "/social_network-csv_composite-longdateformatter-sf1"; - - // Nodes - insertPlaces(datasetPath + "/" + "static/place_0_0.csv", places); - insertTagClasses(datasetPath + "/" + "static/tagclass_0_0.csv", tagclasses); - insertTags(datasetPath + "/" + "static/tag_0_0.csv", tags); - insertForums(datasetPath + "/" + "dynamic/forum_0_0.csv", forums); - insertPersons(datasetPath + "/" + "dynamic/person_0_0.csv", persons); - insertComments(datasetPath + "/" + "dynamic/comment_0_0.csv", comments); - insertPosts(datasetPath + "/" + "dynamic/post_0_0.csv", posts); - insertOrganisations(datasetPath + "/" + "static/organisation_0_0.csv", organisations); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/place_isPartOf_place_0_0.csv", - Place.class, - Place.class, - places, - places, - "setIsPartOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_isLocatedIn_place_0_0.csv", - Person.class, - Place.class, - persons, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tag_hasType_tagclass_0_0.csv", - Tag.class, - TagClass.class, - tags, - tagclasses, - "setHasType"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasCreator_person_0_0.csv", - Comment.class, - Person.class, - comments, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_isLocatedIn_place_0_0.csv", - Comment.class, - Place.class, - comments, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_comment_0_0.csv", - Comment.class, - Comment.class, - comments, - comments, - "setIsReplyOf1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_post_0_0.csv", - Comment.class, - Post.class, - comments, - posts, - "setIsReplyOf2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_containerOf_post_0_0.csv", - Forum.class, - Post.class, - forums, - posts, - "setContainerOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasMember_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasMember"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasModerator_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasModerator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasTag_tag_0_0.csv", - Forum.class, - Tag.class, - forums, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_hasInterest_tag_0_0.csv", - Person.class, - Tag.class, - persons, - tags, - "setHasInterest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_knows_person_0_0.csv", - Person.class, - Person.class, - persons, - persons, - "setKnows"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_comment_0_0.csv", - Person.class, - Comment.class, - persons, - comments, - "setLikes1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_post_0_0.csv", - Person.class, - Post.class, - persons, - posts, - "setLikes2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasCreator_person_0_0.csv", - Post.class, - Person.class, - posts, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasTag_tag_0_0.csv", - Comment.class, - Tag.class, - comments, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasTag_tag_0_0.csv", - Post.class, - Tag.class, - posts, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_isLocatedIn_place_0_0.csv", - Post.class, - Place.class, - posts, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_studyAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setStudyAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_workAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setWorkAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/organisation_isLocatedIn_place_0_0.csv", - Organisation.class, - Place.class, - organisations, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tagclass_isSubclassOf_tagclass_0_0.csv", - TagClass.class, - TagClass.class, - tagclasses, - tagclasses, - "setIsSubclassOf"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Place place : places.values()) { - estore.insert(place); - } - for (TagClass tagclass : tagclasses.values()) { - estore.insert(tagclass); - } - for (Tag tag : tags.values()) { - estore.insert(tag); - } - for (Post post : posts.values()) { - estore.insert(post); - } - for (Comment comment : comments.values()) { - estore.insert(comment); - } - for (Forum forum : forums.values()) { - estore.insert(forum); - } - for (Organisation organisation : organisations.values()) { - estore.insert(organisation); - } - } - - private void insertPlaces(String filePath, HashMap places) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - String type = csvRecord.get("type"); - places.put(id, (new Place(id, name, url, type))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTagClasses(String filePath, HashMap tagclasses) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tagclasses.put(id, new TagClass(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTags(String filePath, HashMap tags) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tags.put(id, new Tag(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertOrganisations(String filePath, HashMap organisations) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String type = csvRecord.get("type"); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - organisations.put(id, new Organisation(id, type, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertForums(String filePath, HashMap forums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String title = csvRecord.get("title"); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - - forums.put(id, new Forum(id, title, creationDate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String firstName = csvRecord.get("firstName"); - String lastName = csvRecord.get("lastName"); - String gender = csvRecord.get("gender"); - long birthday = Long.parseLong(csvRecord.get("birthday")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String email = csvRecord.get("email"); - - persons.put( - id, - new Person( - id, - firstName, - lastName, - gender, - birthday, - creationDate, - locationIP, - browserUsed, - language, - email)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertComments(String filePath, HashMap comments) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - comments.put(id, new Comment(id, creationDate, locationIP, browserUsed, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPosts(String filePath, HashMap posts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - posts.put( - id, new Post(id, creationDate, locationIP, browserUsed, language, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest10.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest10.java deleted file mode 100644 index 9e92297..0000000 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest10.java +++ /dev/null @@ -1,594 +0,0 @@ -package org.estore.eval.estore.ldbc.snb; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.snb.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest10 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - readDataSet(); - } - - // - @Test - public void testInteractiveDeleteQuery2() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:6597069780295})-[likes:LIKES2]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Post;`" - + " {id:7146825580576}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery3() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:6597069815834})-[likes:LIKES1]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Comment;`" - + " {id:8246337208337}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Forum`" - + " {id:1099511627777})-[hasMember:HAS_MEMBER]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`" - + " {id:6597069780295}) DELETE hasMember RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveShortQuery1() { - Table result = - estore.query( - "MATCH (n:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833679})-[:IS_LOCATED_IN]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Place;`)" - + " RETURN n.firstName AS firstName, n.lastName AS lastName, n.birthday AS" - + " birthday, n.locationIP AS locationIP, n.browserUsed AS browserUsed, p.id AS" - + " cityId, n.gender AS gender, n.creationDate AS creationDate"); - assertEquals(result.get("birthday").get(0), 579484800000L); - assertEquals(result.get("firstName").get(0), "Min-Jung"); - assertEquals(result.get("lastName").get(0), "Park"); - assertEquals(result.get("gender").get(0), "female"); - assertEquals(result.get("browserUsed").get(0), "Internet Explorer"); - assertEquals(result.get("locationIP").get(0), "42.18.171.166"); - assertEquals(result.get("cityId").get(0), 1342L); - assertEquals(result.get("creationDate").get(0), 1345825908405L); - } - - // - @Test - public void testInteractiveShortQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Comment`" - + " {id:7146825883053})-[:HAS_CREATOR]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`)" - + " RETURN p.id AS personId, p.firstName AS firstName, p.lastName AS lastName"); - assertEquals(result.get("firstName").get(0), "Rudolf"); - assertEquals(result.get("lastName").get(0), "Engel"); - assertEquals(result.get("personId").get(0), 2199023256437L); - } - - // - @Test - public void testInteractiveUpdateQuery2() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069815834})," - + " (post:`org.estore.eval.estore.ldbc.snb.util.Post` {id:6047313953017}) CREATE" - + " (person)-[r:LIKES2]->(post) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery3() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069780295})," - + " (comment:`org.estore.eval.estore.ldbc.snb.util.Comment` {id:3848290697802}) CREATE" - + " (person)-[r:LIKES1]->(comment) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery5() { - Table result = - estore.query( - "MATCH (f:`org.estore.eval.estore.ldbc.snb.util.Forum` {id:1099511627777})," - + " (p:`org.estore.eval.estore.ldbc.snb.util.Person` {id:8796093058058}) CREATE" - + " (f)-[r:HAS_MEMBER]->(p) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery8() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.snb.util.Person` {id:2199023256684})," - + " (p2:`org.estore.eval.estore.ldbc.snb.util.Person` {id:17592186114273}) CREATE" - + " (p1)-[r:KNOWS]->(p2) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap places = new HashMap(); - HashMap tags = new HashMap(); - HashMap tagclasses = new HashMap(); - HashMap comments = new HashMap(); - HashMap forums = new HashMap(); - HashMap posts = new HashMap(); - HashMap organisations = new HashMap(); - - String datasetPath = "/social_network-csv_composite-longdateformatter-sf10"; - - // Nodes - insertPlaces(datasetPath + "/" + "static/place_0_0.csv", places); - insertTagClasses(datasetPath + "/" + "static/tagclass_0_0.csv", tagclasses); - insertTags(datasetPath + "/" + "static/tag_0_0.csv", tags); - insertForums(datasetPath + "/" + "dynamic/forum_0_0.csv", forums); - insertPersons(datasetPath + "/" + "dynamic/person_0_0.csv", persons); - insertComments(datasetPath + "/" + "dynamic/comment_0_0.csv", comments); - insertPosts(datasetPath + "/" + "dynamic/post_0_0.csv", posts); - insertOrganisations(datasetPath + "/" + "static/organisation_0_0.csv", organisations); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/place_isPartOf_place_0_0.csv", - Place.class, - Place.class, - places, - places, - "setIsPartOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_isLocatedIn_place_0_0.csv", - Person.class, - Place.class, - persons, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tag_hasType_tagclass_0_0.csv", - Tag.class, - TagClass.class, - tags, - tagclasses, - "setHasType"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasCreator_person_0_0.csv", - Comment.class, - Person.class, - comments, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_isLocatedIn_place_0_0.csv", - Comment.class, - Place.class, - comments, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_comment_0_0.csv", - Comment.class, - Comment.class, - comments, - comments, - "setIsReplyOf1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_post_0_0.csv", - Comment.class, - Post.class, - comments, - posts, - "setIsReplyOf2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_containerOf_post_0_0.csv", - Forum.class, - Post.class, - forums, - posts, - "setContainerOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasMember_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasMember"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasModerator_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasModerator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasTag_tag_0_0.csv", - Forum.class, - Tag.class, - forums, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_hasInterest_tag_0_0.csv", - Person.class, - Tag.class, - persons, - tags, - "setHasInterest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_knows_person_0_0.csv", - Person.class, - Person.class, - persons, - persons, - "setKnows"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_comment_0_0.csv", - Person.class, - Comment.class, - persons, - comments, - "setLikes1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_post_0_0.csv", - Person.class, - Post.class, - persons, - posts, - "setLikes2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasCreator_person_0_0.csv", - Post.class, - Person.class, - posts, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasTag_tag_0_0.csv", - Comment.class, - Tag.class, - comments, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasTag_tag_0_0.csv", - Post.class, - Tag.class, - posts, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_isLocatedIn_place_0_0.csv", - Post.class, - Place.class, - posts, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_studyAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setStudyAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_workAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setWorkAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/organisation_isLocatedIn_place_0_0.csv", - Organisation.class, - Place.class, - organisations, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tagclass_isSubclassOf_tagclass_0_0.csv", - TagClass.class, - TagClass.class, - tagclasses, - tagclasses, - "setIsSubclassOf"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Place place : places.values()) { - estore.insert(place); - } - for (TagClass tagclass : tagclasses.values()) { - estore.insert(tagclass); - } - for (Tag tag : tags.values()) { - estore.insert(tag); - } - for (Post post : posts.values()) { - estore.insert(post); - } - for (Comment comment : comments.values()) { - estore.insert(comment); - } - for (Forum forum : forums.values()) { - estore.insert(forum); - } - for (Organisation organisation : organisations.values()) { - estore.insert(organisation); - } - } - - private void insertPlaces(String filePath, HashMap places) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - String type = csvRecord.get("type"); - places.put(id, (new Place(id, name, url, type))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTagClasses(String filePath, HashMap tagclasses) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tagclasses.put(id, new TagClass(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTags(String filePath, HashMap tags) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tags.put(id, new Tag(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertOrganisations(String filePath, HashMap organisations) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String type = csvRecord.get("type"); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - organisations.put(id, new Organisation(id, type, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertForums(String filePath, HashMap forums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String title = csvRecord.get("title"); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - - forums.put(id, new Forum(id, title, creationDate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String firstName = csvRecord.get("firstName"); - String lastName = csvRecord.get("lastName"); - String gender = csvRecord.get("gender"); - long birthday = Long.parseLong(csvRecord.get("birthday")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String email = csvRecord.get("email"); - - persons.put( - id, - new Person( - id, - firstName, - lastName, - gender, - birthday, - creationDate, - locationIP, - browserUsed, - language, - email)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertComments(String filePath, HashMap comments) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - comments.put(id, new Comment(id, creationDate, locationIP, browserUsed, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPosts(String filePath, HashMap posts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - posts.put( - id, new Post(id, creationDate, locationIP, browserUsed, language, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest3.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest3.java deleted file mode 100644 index ef9eb20..0000000 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/InGraphUnsafeTest3.java +++ /dev/null @@ -1,594 +0,0 @@ -package org.estore.eval.estore.ldbc.snb; - -import java.io.FileReader; -import java.io.Reader; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.eval.estore.ldbc.snb.util.*; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class InGraphUnsafeTest3 { - - private Estore estore; - - @BeforeEach - public void setupData() throws Exception { - estore = new Estore("myDb", new EstoreOptions().useUnsafe(true).profile(true)); - readDataSet(); - } - - // - @Test - public void testInteractiveDeleteQuery2() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:6597069786683})-[likes:LIKES2]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Post;`" - + " {id:1649267441739}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery3() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:6597069780295})-[likes:LIKES1]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Comment;`" - + " {id:4123168604177}) DELETE likes RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveDeleteQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Forum`" - + " {id:2748779069441})-[hasMember:HAS_MEMBER]->(:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`" - + " {id:6597069776731}) DELETE hasMember RETURN COUNT(m)"); - assertEquals(result.get("COUNT(m)").get(0), 1); - } - - // - @Test - public void testInteractiveShortQuery1() { - Table result = - estore.query( - "MATCH (n:`org.estore.eval.estore.ldbc.snb.util.Person`" - + " {id:32985348833679})-[:IS_LOCATED_IN]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Place;`)" - + " RETURN n.firstName AS firstName, n.lastName AS lastName, n.birthday AS" - + " birthday, n.locationIP AS locationIP, n.browserUsed AS browserUsed, p.id AS" - + " cityId, n.gender AS gender, n.creationDate AS creationDate"); - assertEquals(result.get("birthday").get(0), 579484800000L); - assertEquals(result.get("firstName").get(0), "Min-Jung"); - assertEquals(result.get("lastName").get(0), "Park"); - assertEquals(result.get("gender").get(0), "female"); - assertEquals(result.get("browserUsed").get(0), "Internet Explorer"); - assertEquals(result.get("locationIP").get(0), "42.18.171.166"); - assertEquals(result.get("cityId").get(0), 1342L); - assertEquals(result.get("creationDate").get(0), 1345825908405L); - } - - // - @Test - public void testInteractiveShortQuery5() { - Table result = - estore.query( - "MATCH (m:`org.estore.eval.estore.ldbc.snb.util.Comment`" - + " {id:2199023299651})-[:HAS_CREATOR]->(p:`[Lorg.estore.eval.estore.ldbc.snb.util.Person;`)" - + " RETURN p.id AS personId, p.firstName AS firstName, p.lastName AS lastName"); - assertEquals(result.get("firstName").get(0), "Rudolf"); - assertEquals(result.get("lastName").get(0), "Engel"); - assertEquals(result.get("personId").get(0), 2199023256437L); - } - - // - @Test - public void testInteractiveUpdateQuery2() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069786683})," - + " (post:`org.estore.eval.estore.ldbc.snb.util.Post` {id:1924145349113}) CREATE" - + " (person)-[r:LIKES2]->(post) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery3() { - Table result = - estore.query( - "MATCH (person:`org.estore.eval.estore.ldbc.snb.util.Person` {id:6597069780295})," - + " (comment:`org.estore.eval.estore.ldbc.snb.util.Comment` {id:2199023256180}) CREATE" - + " (person)-[r:LIKES1]->(comment) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery5() { - Table result = - estore.query( - "MATCH (f:`org.estore.eval.estore.ldbc.snb.util.Forum` {id:2748779069441})," - + " (p:`org.estore.eval.estore.ldbc.snb.util.Person` {id:19791209317730}) CREATE" - + " (f)-[r:HAS_MEMBER]->(p) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - // - @Test - public void testInteractiveUpdateQuery8() { - Table result = - estore.query( - "MATCH (p1:`org.estore.eval.estore.ldbc.snb.util.Person` {id:2199023256684})," - + " (p2:`org.estore.eval.estore.ldbc.snb.util.Person` {id:30786325587981}) CREATE" - + " (p1)-[r:KNOWS]->(p2) RETURN COUNT(r)"); - assertEquals(result.get("COUNT(r)").get(0), 1); - } - - public void readDataSet() throws Exception { - HashMap persons = new HashMap(); - HashMap places = new HashMap(); - HashMap tags = new HashMap(); - HashMap tagclasses = new HashMap(); - HashMap comments = new HashMap(); - HashMap forums = new HashMap(); - HashMap posts = new HashMap(); - HashMap organisations = new HashMap(); - - String datasetPath = "/social_network-csv_composite-longdateformatter-sf3"; - - // Nodes - insertPlaces(datasetPath + "/" + "static/place_0_0.csv", places); - insertTagClasses(datasetPath + "/" + "static/tagclass_0_0.csv", tagclasses); - insertTags(datasetPath + "/" + "static/tag_0_0.csv", tags); - insertForums(datasetPath + "/" + "dynamic/forum_0_0.csv", forums); - insertPersons(datasetPath + "/" + "dynamic/person_0_0.csv", persons); - insertComments(datasetPath + "/" + "dynamic/comment_0_0.csv", comments); - insertPosts(datasetPath + "/" + "dynamic/post_0_0.csv", posts); - insertOrganisations(datasetPath + "/" + "static/organisation_0_0.csv", organisations); - - // Relations - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/place_isPartOf_place_0_0.csv", - Place.class, - Place.class, - places, - places, - "setIsPartOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_isLocatedIn_place_0_0.csv", - Person.class, - Place.class, - persons, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tag_hasType_tagclass_0_0.csv", - Tag.class, - TagClass.class, - tags, - tagclasses, - "setHasType"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasCreator_person_0_0.csv", - Comment.class, - Person.class, - comments, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_isLocatedIn_place_0_0.csv", - Comment.class, - Place.class, - comments, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_comment_0_0.csv", - Comment.class, - Comment.class, - comments, - comments, - "setIsReplyOf1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_replyOf_post_0_0.csv", - Comment.class, - Post.class, - comments, - posts, - "setIsReplyOf2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_containerOf_post_0_0.csv", - Forum.class, - Post.class, - forums, - posts, - "setContainerOf"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasMember_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasMember"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasModerator_person_0_0.csv", - Forum.class, - Person.class, - forums, - persons, - "setHasModerator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/forum_hasTag_tag_0_0.csv", - Forum.class, - Tag.class, - forums, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_hasInterest_tag_0_0.csv", - Person.class, - Tag.class, - persons, - tags, - "setHasInterest"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_knows_person_0_0.csv", - Person.class, - Person.class, - persons, - persons, - "setKnows"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_comment_0_0.csv", - Person.class, - Comment.class, - persons, - comments, - "setLikes1"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_likes_post_0_0.csv", - Person.class, - Post.class, - persons, - posts, - "setLikes2"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasCreator_person_0_0.csv", - Post.class, - Person.class, - posts, - persons, - "setHasCreator"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/comment_hasTag_tag_0_0.csv", - Comment.class, - Tag.class, - comments, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_hasTag_tag_0_0.csv", - Post.class, - Tag.class, - posts, - tags, - "setHasTag"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/post_isLocatedIn_place_0_0.csv", - Post.class, - Place.class, - posts, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_studyAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setStudyAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "dynamic/person_workAt_organisation_0_0.csv", - Person.class, - Organisation.class, - persons, - organisations, - "setWorkAt"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/organisation_isLocatedIn_place_0_0.csv", - Organisation.class, - Place.class, - organisations, - places, - "setIsLocatedIn"); - new CreateRelation() - .insertRelations( - datasetPath + "/" + "static/tagclass_isSubclassOf_tagclass_0_0.csv", - TagClass.class, - TagClass.class, - tagclasses, - tagclasses, - "setIsSubclassOf"); - - for (Person person : persons.values()) { - estore.insert(person); - } - for (Place place : places.values()) { - estore.insert(place); - } - for (TagClass tagclass : tagclasses.values()) { - estore.insert(tagclass); - } - for (Tag tag : tags.values()) { - estore.insert(tag); - } - for (Post post : posts.values()) { - estore.insert(post); - } - for (Comment comment : comments.values()) { - estore.insert(comment); - } - for (Forum forum : forums.values()) { - estore.insert(forum); - } - for (Organisation organisation : organisations.values()) { - estore.insert(organisation); - } - } - - private void insertPlaces(String filePath, HashMap places) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - String type = csvRecord.get("type"); - places.put(id, (new Place(id, name, url, type))); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTagClasses(String filePath, HashMap tagclasses) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tagclasses.put(id, new TagClass(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertTags(String filePath, HashMap tags) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - tags.put(id, new Tag(id, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertOrganisations(String filePath, HashMap organisations) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String type = csvRecord.get("type"); - String name = csvRecord.get("name"); - String url = csvRecord.get("url"); - - organisations.put(id, new Organisation(id, type, name, url)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertForums(String filePath, HashMap forums) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String title = csvRecord.get("title"); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - - forums.put(id, new Forum(id, title, creationDate)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPersons(String filePath, HashMap persons) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - String firstName = csvRecord.get("firstName"); - String lastName = csvRecord.get("lastName"); - String gender = csvRecord.get("gender"); - long birthday = Long.parseLong(csvRecord.get("birthday")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String email = csvRecord.get("email"); - - persons.put( - id, - new Person( - id, - firstName, - lastName, - gender, - birthday, - creationDate, - locationIP, - browserUsed, - language, - email)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertComments(String filePath, HashMap comments) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - comments.put(id, new Comment(id, creationDate, locationIP, browserUsed, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void insertPosts(String filePath, HashMap posts) { - try { - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = CSVFormat.newFormat('|').withFirstRecordAsHeader(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - - for (CSVRecord csvRecord : csvParser) { - long id = Long.parseLong(csvRecord.get("id")); - long creationDate = Long.parseLong(csvRecord.get("creationDate")); - String locationIP = csvRecord.get("locationIP"); - String browserUsed = csvRecord.get("browserUsed"); - String language = csvRecord.get("language"); - String content = csvRecord.get("content"); - int length = Integer.parseInt(csvRecord.get("length")); - - posts.put( - id, new Post(id, creationDate, locationIP, browserUsed, language, content, length)); - } - csvParser.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static class CreateRelation { - public void insertRelations( - String filePath, - Class referrerClass, - Class refereeClass, - HashMap referrerMap, - HashMap refereeMap, - String setRelationMethodName) { - try { - HashMap> relationMap = new HashMap>(); - Reader reader = new FileReader(filePath); - CSVFormat csvFormat = - CSVFormat.Builder.create() - .setDelimiter('|') - .setSkipHeaderRecord(true) - .setHeader("Referrer", "Referee") - .build(); - CSVParser csvParser = new CSVParser(reader, csvFormat); - Method setRelationMethod = referrerClass.getMethod(setRelationMethodName, Object[].class); - - for (CSVRecord csvRecord : csvParser) { - long referrerId = Long.parseLong(csvRecord.get("Referrer")); - long refereeId = Long.parseLong(csvRecord.get("Referee")); - if (relationMap.get(referrerId) == null) { - relationMap.put(referrerId, new HashSet()); - } - relationMap.get(referrerId).add(refereeMap.get(refereeId)); - } - csvParser.close(); - for (Map.Entry> item : relationMap.entrySet()) { - setRelationMethod.invoke( - referrerMap.get(item.getKey()), - new Object[] {item.getValue().toArray(Object[]::new)}); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest01.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest01.java index 5f7ecd5..1067089 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest01.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest01.java @@ -188,7 +188,7 @@ public void testInteractiveUpdateQuery8() { } } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/social_network-csv_composite-longdateformatter-sf0.1"; HashMap places = new HashMap(); HashMap tagclasses = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest03.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest03.java index 2542127..ded21f8 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest03.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest03.java @@ -189,7 +189,7 @@ public void testInteractiveUpdateQuery8() { } } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/social_network-csv_composite-longdateformatter-sf0.3"; HashMap places = new HashMap(); HashMap tagclasses = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest1.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest1.java index 642f4f8..6655467 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest1.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest1.java @@ -189,7 +189,7 @@ public void testInteractiveUpdateQuery8() { } } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/social_network-csv_composite-longdateformatter-sf1"; HashMap places = new HashMap(); HashMap tagclasses = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest10.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest10.java index f1dc67a..e7a0f33 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest10.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest10.java @@ -190,7 +190,7 @@ public void testInteractiveUpdateQuery8() { } } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/social_network-csv_composite-longdateformatter-sf10"; HashMap places = new HashMap(); HashMap tagclasses = new HashMap(); diff --git a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest3.java b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest3.java index b2e81eb..1e29d17 100644 --- a/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest3.java +++ b/eval/estore/ldbc/snb/src/test/java/org/estore/eval/estore/ldbc/snb/Neo4jImpermanantTest3.java @@ -189,7 +189,7 @@ public void testInteractiveUpdateQuery8() { } } @BeforeEach - public void setupData() throws Exception { + public void setupData() { String datasetPath = "/social_network-csv_composite-longdateformatter-sf3"; HashMap places = new HashMap(); HashMap tagclasses = new HashMap(); diff --git a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphReflectionMetaDataTest.java b/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphReflectionMetaDataTest.java index 2014d5a..eacfab4 100644 --- a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphReflectionMetaDataTest.java +++ b/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphReflectionMetaDataTest.java @@ -4,7 +4,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.estore.Estore; -import org.estore.EstoreOptions; +import org.estore.EstoreException; import org.estore.planner.util.Table; import java.sql.Connection; @@ -14,6 +14,7 @@ import java.util.Set; import static org.junit.jupiter.api.Assertions.*; +import java.sql.SQLException; public class InGraphReflectionMetaDataTest { @@ -21,13 +22,13 @@ public class InGraphReflectionMetaDataTest { private Estore estore1; @BeforeEach - public void setup() throws Exception { - estore1 = new Estore("estoreTestDb1", new EstoreOptions().useUnsafe(false)); + public void setup() throws SQLException { + estore1 = new Estore("estoreTestDb1"); conn1 = DriverManager.getConnection("jdbc:h2:mem:h2TestDb1", "sa", ""); } @Test - public void testH2DbNameQuery() throws Exception { + public void testH2DbNameQuery() throws ClassNotFoundException, EstoreException { // insert H2 Engine into estore Class t = Class.forName("org.h2.engine.Engine"); estore1.captureAll(t); @@ -47,7 +48,7 @@ public void testH2DbNameQuery() throws Exception { } @Test - public void testH2TablesQuery() throws Exception { + public void testH2TablesQuery() throws ClassNotFoundException, SQLException, EstoreException { // Create new tables Statement stmt = conn1.createStatement(); stmt.execute("CREATE TABLE IF NOT EXISTS TEST_TABLE1 (ID INT PRIMARY KEY, NAME VARCHAR(255))"); @@ -75,7 +76,7 @@ public void testH2TablesQuery() throws Exception { } @Test - public void testH2UsersQuery() throws Exception { + public void testH2UsersQuery() throws ClassNotFoundException, SQLException { // create new user Statement stmt = conn1.createStatement(); stmt.execute("CREATE USER IF NOT EXISTS USER1 PASSWORD 'password1'"); @@ -104,7 +105,7 @@ public void testH2UsersQuery() throws Exception { } @AfterEach - public void drop() throws Exception { + public void drop() throws SQLException { if (conn1 != null) { conn1.close(); } diff --git a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphUnsafeMetaDataTest.java b/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphUnsafeMetaDataTest.java deleted file mode 100644 index 4699ce1..0000000 --- a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/InGraphUnsafeMetaDataTest.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.estore.eval.estore.metadata.h2; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.estore.Estore; -import org.estore.EstoreOptions; -import org.estore.planner.util.Table; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.Statement; -import java.util.HashSet; -import java.util.Set; - -import static org.junit.jupiter.api.Assertions.*; - -public class InGraphUnsafeMetaDataTest { - - private Connection conn1; - private Estore estore1; - - @BeforeEach - public void setup() throws Exception { - estore1 = new Estore("estoreTestDb1", new EstoreOptions().useUnsafe(true)); - conn1 = DriverManager.getConnection("jdbc:h2:mem:h2TestDb1", "sa", ""); - } - - @Test - public void testH2DbNameQuery() throws Exception { - // insert H2 Engine into estore - Class t = Class.forName("org.h2.engine.Engine"); - estore1.captureAll(t); - - long time1 = System.nanoTime(); - Table res = estore1.query("MATCH (n: `org.h2.engine.Database`) RETURN n.databaseName"); - System.out.println("Execution Time : " + (System.nanoTime() - time1)); - - Set names = new HashSet<>(); - for (Object name : res.get("n.databaseName")) { - names.add((String) name); - } - assertEquals(2, res.getSize()); - assertTrue(names.contains("mem:h2TestDb1")); - assertTrue(names.contains("mem:h2TestDb2")); - assertTrue(true); - } - - @Test - public void testH2TablesQuery() throws Exception { - // Create new tables - Statement stmt = conn1.createStatement(); - stmt.execute("CREATE TABLE IF NOT EXISTS TEST_TABLE1 (ID INT PRIMARY KEY, NAME VARCHAR(255))"); - stmt.execute("CREATE TABLE IF NOT EXISTS TEST_TABLE2 (ID INT PRIMARY KEY, NAME VARCHAR(255))"); - - // insert H2 Engine into estore - Class t = Class.forName("org.h2.engine.Engine"); - estore1.captureAll(t); - - long time1 = System.nanoTime(); - Table res1 = - estore1.query( - "MATCH (n:" - + " `org.h2.engine.Database`)-[:mainSchema]->()-[:tablesAndViews]->()-[:table]->()-[]->()-[:key]->(k)" - + " RETURN k"); - System.out.println("Execution Time : " + (System.nanoTime() - time1)); - - Set names = new HashSet<>(); - for (Object name : res1.get("k")) { - names.add((String) name); - } - estore1.captureAll(names); - assertTrue(names.contains("TEST_TABLE1")); - assertTrue(names.contains("TEST_TABLE2")); - } - - @Test - public void testH2UsersQuery() throws Exception { - // create new user - Statement stmt = conn1.createStatement(); - stmt.execute("CREATE USER IF NOT EXISTS USER1 PASSWORD 'password1'"); - - // insert H2 Engine into estore - Class t = Class.forName("org.h2.engine.Engine"); - estore1.captureAll(t); - - long time1 = System.nanoTime(); - Table res = - estore1.query( - "MATCH (n:" - + " `org.h2.engine.Database`)-[:usersAndRoles]->()-[:table]->()-[]->()-[:key]->(k)" - + " RETURN k"); - System.out.println("Execution Time : " + (System.nanoTime() - time1)); - - Set users = new HashSet<>(); - for (Object name : res.get("k")) { - users.add((String) name); - } - - assertTrue(users.contains("USER1")); - // built-in users - assertTrue(users.contains("PUBLIC")); - assertTrue(users.contains("SA")); - } - - @AfterEach - public void drop() throws Exception { - if (conn1 != null) { - conn1.close(); - } - } -} diff --git a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/JDBCMetaDataTest.java b/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/JDBCMetaDataTest.java index f021ca1..7fb9e1e 100644 --- a/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/JDBCMetaDataTest.java +++ b/eval/estore/metadata/h2/src/test/java/org/estore/eval/estore/metadata/h2/JDBCMetaDataTest.java @@ -13,24 +13,25 @@ import java.util.Set; import static org.junit.jupiter.api.Assertions.*; +import java.sql.SQLException; public class JDBCMetaDataTest { private Connection conn1; @BeforeEach - public void setup() throws Exception { + public void setup() throws SQLException { conn1 = DriverManager.getConnection("jdbc:h2:mem:h2TestDb1", "sa", ""); } @Test - public void testH2DbNameQuery() throws Exception { + public void testH2DbNameQuery() { // placeholder; no api for this query System.out.println("Execution Time : 0"); } @Test - public void testH2TablesQuery() throws Exception { + public void testH2TablesQuery() throws SQLException { Set tablesSet = new HashSet<>(); // Create a new table and check that it exists @@ -52,7 +53,7 @@ public void testH2TablesQuery() throws Exception { } @Test - public void testH2UsersQuery() throws Exception { + public void testH2UsersQuery() throws SQLException { long t1 = System.nanoTime(); DatabaseMetaData meta = conn1.getMetaData(); String userName = meta.getUserName(); @@ -62,7 +63,7 @@ public void testH2UsersQuery() throws Exception { } @AfterEach - public void drop() throws Exception { + public void drop() throws SQLException { if (conn1 != null) { conn1.close(); } diff --git a/eval/images/eclipse-arraystack-100-ingraph-unsafe.dockerfile b/eval/images/eclipse-arraystack-100-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-arraystack-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-arraystack-1000-ingraph-unsafe.dockerfile b/eval/images/eclipse-arraystack-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-arraystack-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-arraystack-10000-ingraph-unsafe.dockerfile b/eval/images/eclipse-arraystack-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-arraystack-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-arraystack-100000-ingraph-unsafe.dockerfile b/eval/images/eclipse-arraystack-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-arraystack-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-fastlist-100-ingraph-unsafe.dockerfile b/eval/images/eclipse-fastlist-100-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-fastlist-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-fastlist-1000-ingraph-unsafe.dockerfile b/eval/images/eclipse-fastlist-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-fastlist-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-fastlist-10000-ingraph-unsafe.dockerfile b/eval/images/eclipse-fastlist-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-fastlist-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-fastlist-100000-ingraph-unsafe.dockerfile b/eval/images/eclipse-fastlist-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-fastlist-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-immutablearraylist-100-ingraph-unsafe.dockerfile b/eval/images/eclipse-immutablearraylist-100-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-immutablearraylist-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-immutablearraylist-1000-ingraph-unsafe.dockerfile b/eval/images/eclipse-immutablearraylist-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-immutablearraylist-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-immutablearraylist-10000-ingraph-unsafe.dockerfile b/eval/images/eclipse-immutablearraylist-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-immutablearraylist-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-immutablearraylist-100000-ingraph-unsafe.dockerfile b/eval/images/eclipse-immutablearraylist-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-immutablearraylist-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedmap-100-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedmap-100-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedmap-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedmap-1000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedmap-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedmap-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedmap-10000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedmap-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedmap-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedmap-100000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedmap-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedmap-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedset-100-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedset-100-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedset-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedset-1000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedset-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedset-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedset-10000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedset-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedset-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/eclipse-unifiedset-100000-ingraph-unsafe.dockerfile b/eval/images/eclipse-unifiedset-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index de51776..0000000 --- a/eval/images/eclipse-unifiedset-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/eclipse/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/eclipse - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/guava-arraytable-100-ingraph-unsafe.dockerfile b/eval/images/guava-arraytable-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 3c9729c..0000000 --- a/eval/images/guava-arraytable-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/guava/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/guava - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/guava-arraytable-1000-ingraph-unsafe.dockerfile b/eval/images/guava-arraytable-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 3c9729c..0000000 --- a/eval/images/guava-arraytable-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/guava/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/guava - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/guava-arraytable-10000-ingraph-unsafe.dockerfile b/eval/images/guava-arraytable-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 3c9729c..0000000 --- a/eval/images/guava-arraytable-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/guava/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/guava - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/guava-arraytable-100000-ingraph-unsafe.dockerfile b/eval/images/guava-arraytable-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 3c9729c..0000000 --- a/eval/images/guava-arraytable-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/guava/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/guava - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/h2metadata-ingraph-unsafe.dockerfile b/eval/images/h2metadata-ingraph-unsafe.dockerfile deleted file mode 100644 index 7b77870..0000000 --- a/eval/images/h2metadata-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/metadata/h2/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/metadata/h2 - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraydeque-100-ingraph-unsafe.dockerfile b/eval/images/jcf-arraydeque-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraydeque-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraydeque-1000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraydeque-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraydeque-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraydeque-10000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraydeque-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraydeque-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraydeque-100000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraydeque-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraydeque-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraylist-100-ingraph-unsafe.dockerfile b/eval/images/jcf-arraylist-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraylist-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraylist-1000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraylist-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraylist-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraylist-10000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraylist-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraylist-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-arraylist-100000-ingraph-unsafe.dockerfile b/eval/images/jcf-arraylist-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-arraylist-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-hashmap-100-ingraph-unsafe.dockerfile b/eval/images/jcf-hashmap-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-hashmap-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-hashmap-1000-ingraph-unsafe.dockerfile b/eval/images/jcf-hashmap-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-hashmap-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-hashmap-10000-ingraph-unsafe.dockerfile b/eval/images/jcf-hashmap-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-hashmap-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-hashmap-100000-ingraph-unsafe.dockerfile b/eval/images/jcf-hashmap-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-hashmap-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-linkedlist-100-ingraph-unsafe.dockerfile b/eval/images/jcf-linkedlist-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-linkedlist-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-linkedlist-1000-ingraph-unsafe.dockerfile b/eval/images/jcf-linkedlist-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-linkedlist-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-linkedlist-10000-ingraph-unsafe.dockerfile b/eval/images/jcf-linkedlist-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-linkedlist-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-linkedlist-100000-ingraph-unsafe.dockerfile b/eval/images/jcf-linkedlist-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-linkedlist-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-vector-100-ingraph-unsafe.dockerfile b/eval/images/jcf-vector-100-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-vector-100-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-vector-1000-ingraph-unsafe.dockerfile b/eval/images/jcf-vector-1000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-vector-1000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-vector-10000-ingraph-unsafe.dockerfile b/eval/images/jcf-vector-10000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-vector-10000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/jcf-vector-100000-ingraph-unsafe.dockerfile b/eval/images/jcf-vector-100000-ingraph-unsafe.dockerfile deleted file mode 100644 index 877465b..0000000 --- a/eval/images/jcf-vector-100000-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM eclipse-temurin:11-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/datastructure/jcf/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/datastructure/jcf - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/ldbc-finbench-0.01-ingraph-unsafe.dockerfile b/eval/images/ldbc-finbench-0.01-ingraph-unsafe.dockerfile deleted file mode 100644 index 3d8f5b8..0000000 --- a/eval/images/ldbc-finbench-0.01-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC FinBench SF 0.01 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget -O test.tar.gz -L "https://drive.usercontent.google.com/download?id=1kBouy5zrUE4h9QmklaIiWNPDfC9-XgD-&export=download&authuser=0&confirm=t&uuid=971b21ed-db6a-4c84-b4d1-db510b9ea4f8&at=APZUnTWZ702p54DH7frTbxTgQijv:1701486595409" &&\ - gzip -d test.tar.gz &&\ - tar -xvf test.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/finbench/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/finbench - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/images/ldbc-finbench-0.1-ingraph-unsafe.dockerfile b/eval/images/ldbc-finbench-0.1-ingraph-unsafe.dockerfile deleted file mode 100644 index 0918fe5..0000000 --- a/eval/images/ldbc-finbench-0.1-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC FinBench SF 0.01 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget -O test.tar.gz -L "https://drive.usercontent.google.com/download?id=1G7wgGInuNO22ecvOGsNGn3I_ZiyX4wvF&export=download&authuser=0&confirm=t&uuid=971b21ed-db6a-4c84-b4d1-db510b9ea4f8&at=APZUnTWZ702p54DH7frTbxTgQijv:1701486595409" &&\ - gzip -d test.tar.gz &&\ - tar -xvf test.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/finbench/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/finbench - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/ldbc-finbench-0.3-ingraph-unsafe.dockerfile b/eval/images/ldbc-finbench-0.3-ingraph-unsafe.dockerfile deleted file mode 100644 index d8ae719..0000000 --- a/eval/images/ldbc-finbench-0.3-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC FinBench SF 0.3 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget -O test.tar.gz -L "https://drive.usercontent.google.com/download?id=1zY7OkXPMSMs35JC4kLbm2GyDPD9SyswB&export=download&authuser=0&confirm=t&uuid=971b21ed-db6a-4c84-b4d1-db510b9ea4f8&at=APZUnTWZ702p54DH7frTbxTgQijv:1701486595409" &&\ - gzip -d test.tar.gz &&\ - tar -xvf test.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/finbench/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/finbench - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/ldbc-finbench-10-ingraph-unsafe.dockerfile b/eval/images/ldbc-finbench-10-ingraph-unsafe.dockerfile deleted file mode 100644 index e47a5c8..0000000 --- a/eval/images/ldbc-finbench-10-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC FinBench SF 3 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget -O test.tar.gz -L "https://drive.usercontent.google.com/download?id=18oe1LEZvi5EusseswQE6ftiUxCsx4A92&export=download&authuser=0&confirm=t&uuid=971b21ed-db6a-4c84-b4d1-db510b9ea4f8&at=APZUnTWZ702p54DH7frTbxTgQijv:1701486595409" &&\ - gzip -d test.tar.gz &&\ - tar -xvf test.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/finbench/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/finbench - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/ldbc-finbench-3-ingraph-unsafe.dockerfile b/eval/images/ldbc-finbench-3-ingraph-unsafe.dockerfile deleted file mode 100644 index 7cebe84..0000000 --- a/eval/images/ldbc-finbench-3-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC FinBench SF 3 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget -O test.tar.gz -L "https://drive.usercontent.google.com/download?id=1hsXVlC-KGEnSW94DfKpj_n622r5GKVX6&export=download&authuser=0&confirm=t&uuid=971b21ed-db6a-4c84-b4d1-db510b9ea4f8&at=APZUnTWZ702p54DH7frTbxTgQijv:1701486595409" &&\ - gzip -d test.tar.gz &&\ - tar -xvf test.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/finbench/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/finbench - -# Run the test -CMD ["bash","execute.sh"] diff --git a/eval/images/ldbc-snb-0.1-ingraph-unsafe.dockerfile b/eval/images/ldbc-snb-0.1-ingraph-unsafe.dockerfile deleted file mode 100644 index fc2de09..0000000 --- a/eval/images/ldbc-snb-0.1-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget --no-check-certificate https://repository.surfsara.nl/datasets/cwi/snb/files/social_network-csv_composite-longdateformatter/social_network-csv_composite-longdateformatter-sf0.1.tar.zst &&\ - zstd -d social_network-csv_composite-longdateformatter-sf0.1.tar.zst &&\ - tar -xvf social_network-csv_composite-longdateformatter-sf0.1.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/snb/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/snb - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/images/ldbc-snb-0.3-ingraph-unsafe.dockerfile b/eval/images/ldbc-snb-0.3-ingraph-unsafe.dockerfile deleted file mode 100644 index fbff6c6..0000000 --- a/eval/images/ldbc-snb-0.3-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget --no-check-certificate https://repository.surfsara.nl/datasets/cwi/snb/files/social_network-csv_composite-longdateformatter/social_network-csv_composite-longdateformatter-sf0.3.tar.zst &&\ - zstd -d social_network-csv_composite-longdateformatter-sf0.3.tar.zst &&\ - tar -xvf social_network-csv_composite-longdateformatter-sf0.3.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/snb/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/snb - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/images/ldbc-snb-1-ingraph-unsafe.dockerfile b/eval/images/ldbc-snb-1-ingraph-unsafe.dockerfile deleted file mode 100644 index 3744130..0000000 --- a/eval/images/ldbc-snb-1-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget --no-check-certificate https://repository.surfsara.nl/datasets/cwi/snb/files/social_network-csv_composite-longdateformatter/social_network-csv_composite-longdateformatter-sf1.tar.zst &&\ - zstd -d social_network-csv_composite-longdateformatter-sf1.tar.zst &&\ - tar -xvf social_network-csv_composite-longdateformatter-sf1.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/snb/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/snb - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/images/ldbc-snb-10-ingraph-unsafe.dockerfile b/eval/images/ldbc-snb-10-ingraph-unsafe.dockerfile deleted file mode 100644 index 8941eef..0000000 --- a/eval/images/ldbc-snb-10-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget --no-check-certificate https://repository.surfsara.nl/datasets/cwi/snb/files/social_network-csv_composite-longdateformatter/social_network-csv_composite-longdateformatter-sf10.tar.zst &&\ - zstd -d social_network-csv_composite-longdateformatter-sf10.tar.zst &&\ - tar -xvf social_network-csv_composite-longdateformatter-sf10.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/snb/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/snb - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/images/ldbc-snb-3-ingraph-unsafe.dockerfile b/eval/images/ldbc-snb-3-ingraph-unsafe.dockerfile deleted file mode 100644 index 0c4abb2..0000000 --- a/eval/images/ldbc-snb-3-ingraph-unsafe.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM eclipse-temurin:17.0.9_9-jdk - -WORKDIR / - -# Install MAVEN and download the dataset for LDBC SNB SF 0.1 -RUN apt-get update -y &&\ - apt-get install -y zstd &&\ - wget -O maven.tar.gz -L https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz &&\ - gzip -d maven.tar.gz && tar -xvf maven.tar && rm *.tar &&\ - wget --no-check-certificate https://repository.surfsara.nl/datasets/cwi/snb/files/social_network-csv_composite-longdateformatter/social_network-csv_composite-longdateformatter-sf3.tar.zst &&\ - zstd -d social_network-csv_composite-longdateformatter-sf3.tar.zst &&\ - tar -xvf social_network-csv_composite-longdateformatter-sf3.tar && rm *.tar - -ENV PATH="${PATH}:/apache-maven-3.9.5/bin" - -ARG username -ARG uid -ARG groupname -ARG gid -RUN groupadd -g $gid $groupname -RUN \ - useradd -m -s /bin/bash -c "$username's clone" -u $uid -g $gid $username && \ - adduser $username sudo && \ - usermod -aG sudo $username && \ - echo "$username:docker" | chpasswd - -USER $username - -COPY --chown=$username ./pom.xml /home/$username/pom.xml -COPY --chown=$username ./estore /home/$username/estore -COPY --chown=$username ./images/execute.sh /home/$username/estore/ldbc/snb/execute.sh -COPY --chown=$username ./libs /home/libs - -WORKDIR /home/$username/estore/ldbc/snb - -# Run the test -CMD ["bash","execute.sh"] - - diff --git a/eval/test.py b/eval/test.py index b3e8f64..554d4f4 100644 --- a/eval/test.py +++ b/eval/test.py @@ -77,7 +77,6 @@ def __init__(self, SYSTEMS : Dict[str, str] = {"neo4j-server" : "Neo4jServerTest", "neo4j-impermanant" : "Neo4jImpermanantTest", "ingraph-reflection" : "InGraphReflectionTest", - "ingraph-unsafe" : "InGraphUnsafeTest", "estore-neo" : "EstoreNeoTest", "estore-mem" : "EstoreMemTest", "memgraph-server" : "MemgraphServerTest", @@ -99,7 +98,7 @@ def exec_datastructure(project : str, queries = PROJECT.queries #fi if systems is None: - systems = ["ingraph-reflection", "ingraph-unsafe"] + systems = ["ingraph-reflection"] #fi if datastructures is None: datastructures = project2.data_structures @@ -260,14 +259,13 @@ def exec_usecase(usecase : str, return #fi if impls is None: - impls = ["ingraph-reflection", "ingraph-unsafe", "jdbc"] + impls = ["ingraph-reflection", "jdbc"] #fi if queries is None: queries = ["dbname", "tables", "users"] #fi impl_test_map : Dict[str, str] = {"ingraph-reflection" : "InGraphReflectionMetaDataTest", - "ingraph-unsafe" : "InGraphUnsafeMetaDataTest", "jdbc" : "JDBCMetaDataTest"} query_method_map : Dict[str, str] = {"dbname" : "testH2DbNameQuery", @@ -363,7 +361,7 @@ def exec_usecase(usecase : str, parser.add_argument("--h2impls", help="H2 query implementation to use", required = False, - choices=["ingraph-reflection", "ingraph-unsafe", "jdbc"], + choices=["ingraph-reflection", "jdbc"], nargs=1,) parser.add_argument("--usecase", help="Use case to evaluate", diff --git a/s b/s index 375ad8e..7a6b6a7 100755 --- a/s +++ b/s @@ -119,14 +119,13 @@ function install_estore() { function exec_estore() { check_deps || \ { echo "Dependencies not satisfied. Please install with: ./s install_deps"; return 1; } - echo "Usage: $0 [port] [useUnsafe]" + echo "Usage: $0 [port]" local port=${1:-1234} - local useUnsafe=${2:-false} echo "Example: echo 'MATCH (n) return n' | nc -q 0 localhost $port" echo "send 'q' to exit" compile_estore ( cd estore - mvn exec:java@main -Dexec.args="$port $useUnsafe" & + mvn exec:java@main -Dexec.args="$port" & echo "Running db as $!" ) } From 5dc437949aaba7a28019ed3ddde336b9ccd35b71 Mon Sep 17 00:00:00 2001 From: Yan Levin Date: Sat, 22 Aug 2026 18:55:20 -0500 Subject: [PATCH 4/5] remove underscores from method names --- .../org/estore/MultiDimensionalArrayTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java index 26a3bf8..ab78398 100644 --- a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java +++ b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java @@ -36,7 +36,7 @@ public void testSimple3DMatrix() throws EstoreException { } @Test - public void testLongMatrix2D_varLength() throws EstoreException { + public void testLongMatrix2DVarLength() throws EstoreException { Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 3; @@ -59,7 +59,7 @@ public void testLongMatrix2D_varLength() throws EstoreException { } @Test - public void testLongMatrix2D_indexed() throws EstoreException { + public void testLongMatrix2DIndexed() throws EstoreException { Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 2; @@ -84,7 +84,7 @@ public void testLongMatrix2D_indexed() throws EstoreException { } @Test - public void testIntMatrix2D_varLength() throws EstoreException { + public void testIntMatrix2DVarLength() throws EstoreException { int[][] grid = new int[8][8]; int target = 4242; int ti = 1; @@ -107,7 +107,7 @@ public void testIntMatrix2D_varLength() throws EstoreException { } @Test - public void testIntMatrix2D_indexed() throws EstoreException { + public void testIntMatrix2DIndexed() throws EstoreException { int[][] grid = new int[8][8]; int target = 7777; int ti = 0; @@ -132,7 +132,7 @@ public void testIntMatrix2D_indexed() throws EstoreException { } @Test - public void testObjectMatrix3D_varLength() throws EstoreException { + public void testObjectMatrix3DVarLength() throws EstoreException { Object[][][] cube = new Object[4][4][4]; long target = rand.nextLong(0, Long.MAX_VALUE); int a = 1; @@ -161,7 +161,7 @@ public void testObjectMatrix3D_varLength() throws EstoreException { } @Test - public void testObjectMatrix3D_indexed() throws EstoreException { + public void testObjectMatrix3DIndexed() throws EstoreException { Object[][][] cube = new Object[3][3][3]; long target = rand.nextLong(0, Long.MAX_VALUE); int a = 0; @@ -245,7 +245,7 @@ public void testArrayTable() throws EstoreException { } @Test - public void testArrayTable_dfs() throws EstoreException { + public void testArrayTableDfs() throws EstoreException { Estore dfsStore = new Estore( MultiDimensionalArrayTest.class.getName() + "Dfs", @@ -272,7 +272,7 @@ public void testArrayTable_dfs() throws EstoreException { } @Test - public void testIntMatrix2D_dfs() throws EstoreException { + public void testIntMatrix2DDfs() throws EstoreException { Estore dfsStore = new Estore( MultiDimensionalArrayTest.class.getName() + "IntDfs", From ac830a643f9f95e2823a25ab0c47610e5bcf2f5c Mon Sep 17 00:00:00 2001 From: Yan Levin Date: Sat, 22 Aug 2026 18:56:35 -0500 Subject: [PATCH 5/5] remove references to unsafe in MultiDimensionalArrayTest --- .../src/test/java/org/estore/MultiDimensionalArrayTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java index ab78398..48a9234 100644 --- a/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java +++ b/estore/src/test/java/org/estore/MultiDimensionalArrayTest.java @@ -222,7 +222,6 @@ public void testDeleteArrayIndex() throws EstoreException { @Test public void testArrayTable() throws EstoreException { - Estore gridStore = new Estore(MultiDimensionalArrayTest.class.getName() + "Unsafe"); Long[][] grid = new Long[10][10]; long target = rand.nextLong(0, Long.MAX_VALUE); int ti = 4; @@ -232,10 +231,10 @@ public void testArrayTable() throws EstoreException { grid[i][j] = (i == ti && j == tj) ? target : rand.nextLong(0, Long.MAX_VALUE); } } - gridStore.captureAll(grid); + db.captureAll(grid); Table result = - gridStore.query( + db.query( "MATCH (n:`" + grid.getClass().getName() + "`)-[]->()-[]->(m {value:"