Skip to content

Commit 330a467

Browse files
authored
Revert "use maven wrapper instead" (#1797)
1 parent 3ec6c23 commit 330a467

File tree

14 files changed

+353
-380
lines changed

14 files changed

+353
-380
lines changed

.github/workflows/mvn-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ jobs:
3434
cache: "maven"
3535

3636
- name: Install jars
37-
run: ./mvnw --show-version clean install -DskipTests
37+
run: mvn --show-version clean install -DskipTests
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040

4141
- name: Test
42-
run: ./mvnw verify -Pintegration -Pcoverage -Pdocker --batch-mode --errors --fail-never --show-version -pl !e2e
42+
run: mvn verify -Pintegration -Pcoverage -Pdocker --batch-mode --errors --fail-never --show-version -pl !e2e
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545

4646
- name: E2E Test
4747
if: success()
48-
run: ./mvnw verify -pl e2e
48+
run: mvn verify -pl e2e
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151

engine/src/main/java/com/arcadedb/database/BaseRecord.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public void reload() {
5656
try {
5757
buffer = database.getSchema().getBucketById(rid.getBucketId()).getRecord(rid);
5858

59-
// System.out.println("reload -- > invokeAfterReadEvents ");
6059
final Record loaded = database.invokeAfterReadEvents(this);
6160
if (loaded == null) {
6261
buffer = null;

engine/src/main/java/com/arcadedb/database/LocalDatabase.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ public Record lookupByRID(final RID rid, final boolean loadContent) {
686686
if (loadRecordContent || type == null) {
687687
final Binary buffer = schema.getBucketById(rid.getBucketId()).getRecord(rid);
688688
record = recordFactory.newImmutableRecord(wrappedDatabaseInstance, type, rid, buffer.copyOfContent(), null);
689-
// System.out.println("call invokeAfterReadEvents for record");
690689
return invokeAfterReadEvents(record);
691690
}
692691

@@ -1609,14 +1608,8 @@ record = events.onAfterRead(record);
16091608
return null;
16101609
if (record instanceof Document) {
16111610
final DocumentType type = ((Document) record).getType();
1612-
if (type != null) {
1613-
// System.out.println("invokeAfterReadEvents for type = pre");
1614-
1615-
Record record1 = ((RecordEventsRegistry) type.getEvents()).onAfterRead(record);
1616-
// System.out.println("invokeAfterReadEvents for type = after");
1617-
1618-
return record1;
1619-
}
1611+
if (type != null)
1612+
return ((RecordEventsRegistry) type.getEvents()).onAfterRead(record);
16201613
}
16211614
return record;
16221615
}

engine/src/main/java/com/arcadedb/database/RecordEventsRegistry.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,11 @@ public void onAfterCreate(final Record record) {
232232
public Record onAfterRead(Record record) {
233233
if (afterReadListeners.isEmpty())
234234
return record;
235-
// System.out.println(Thread.currentThread().getName() + " :: onAfterread");
236235

237236
for (AfterRecordReadListener listener : afterReadListeners) {
238-
// System.out.println("call listener");
239237
record = listener.onAfterRead(record);
240-
if (record == null) return null;
238+
if (record == null)
239+
return null;
241240
}
242241
return record;
243242
}

engine/src/main/java/com/arcadedb/database/RecordFactory.java

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,44 @@
3535

3636
public class RecordFactory {
3737
public Record newImmutableRecord(final Database database, final DocumentType type, final RID rid, final byte recordType) {
38-
return switch (recordType) {
39-
case Document.RECORD_TYPE -> new ImmutableDocument(database, type, rid, null);
40-
case Vertex.RECORD_TYPE -> new ImmutableVertex(database, type, rid, null);
41-
case Edge.RECORD_TYPE -> new ImmutableEdge(database, type, rid, null);
42-
case EdgeSegment.RECORD_TYPE -> new MutableEdgeSegment(database, rid, null);
43-
case EmbeddedDocument.RECORD_TYPE -> new ImmutableEmbeddedDocument(database, type, null, null);
44-
default -> throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
45-
};
38+
switch (recordType) {
39+
case Document.RECORD_TYPE:
40+
return new ImmutableDocument(database, type, rid, null);
41+
case Vertex.RECORD_TYPE:
42+
return new ImmutableVertex(database, type, rid, null);
43+
case Edge.RECORD_TYPE:
44+
return new ImmutableEdge(database, type, rid, null);
45+
case EdgeSegment.RECORD_TYPE:
46+
return new MutableEdgeSegment(database, rid, null);
47+
case EmbeddedDocument.RECORD_TYPE:
48+
return new ImmutableEmbeddedDocument(database, type, null, null);
49+
}
50+
throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
4651
}
4752

4853
public Record newImmutableRecord(final Database database, final DocumentType type, final RID rid, final Binary content, final EmbeddedModifier modifier) {
4954
final byte recordType = content.getByte();
5055

51-
return switch (recordType) {
52-
case Document.RECORD_TYPE -> new ImmutableDocument(database, type, rid, content);
53-
case Vertex.RECORD_TYPE -> new ImmutableVertex(database, type, rid, content);
54-
case Edge.RECORD_TYPE -> new ImmutableEdge(database, type, rid, content);
55-
case EdgeSegment.RECORD_TYPE -> new MutableEdgeSegment(database, rid, content);
56-
case EmbeddedDocument.RECORD_TYPE -> new ImmutableEmbeddedDocument(database, type, content, modifier);
57-
default -> throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
58-
};
56+
switch (recordType) {
57+
case Document.RECORD_TYPE:
58+
return new ImmutableDocument(database, type, rid, content);
59+
case Vertex.RECORD_TYPE:
60+
return new ImmutableVertex(database, type, rid, content);
61+
case Edge.RECORD_TYPE:
62+
return new ImmutableEdge(database, type, rid, content);
63+
case EdgeSegment.RECORD_TYPE:
64+
return new MutableEdgeSegment(database, rid, content);
65+
case EmbeddedDocument.RECORD_TYPE:
66+
return new ImmutableEmbeddedDocument(database, type, content, modifier);
67+
}
68+
throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
5969
}
6070

6171
public Record newMutableRecord(final Database database, final DocumentType type) {
62-
if (type instanceof LocalVertexType vertexType) return new MutableVertex(database, vertexType, null);
63-
if (type instanceof LocalEdgeType edgeType) return new MutableEdge(database, edgeType, null);
72+
if (type instanceof LocalVertexType)
73+
return new MutableVertex(database, (VertexType) type, null);
74+
if (type instanceof LocalEdgeType)
75+
return new MutableEdge(database, (EdgeType) type, null);
6476
return new MutableDocument(database, type, null);
6577
}
6678

@@ -69,13 +81,18 @@ public Record newMutableRecord(final Database database, final DocumentType type,
6981
final byte recordType = content.getByte();
7082
content.position(pos);
7183

72-
return switch (recordType) {
73-
case Document.RECORD_TYPE -> new MutableDocument(database, type, rid, content);
74-
case Vertex.RECORD_TYPE -> new MutableVertex(database, (VertexType) type, rid);
75-
case Edge.RECORD_TYPE -> new MutableEdge(database, (EdgeType) type, rid);
76-
case EdgeSegment.RECORD_TYPE -> new MutableEdgeSegment(database, rid);
77-
case EmbeddedDocument.RECORD_TYPE -> new MutableEmbeddedDocument(database, type, content, modifier);
78-
default -> throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
79-
};
84+
switch (recordType) {
85+
case Document.RECORD_TYPE:
86+
return new MutableDocument(database, type, rid, content);
87+
case Vertex.RECORD_TYPE:
88+
return new MutableVertex(database, (VertexType) type, rid);
89+
case Edge.RECORD_TYPE:
90+
return new MutableEdge(database, (EdgeType) type, rid);
91+
case EdgeSegment.RECORD_TYPE:
92+
return new MutableEdgeSegment(database, rid);
93+
case EmbeddedDocument.RECORD_TYPE:
94+
return new MutableEmbeddedDocument(database, type, content, modifier);
95+
}
96+
throw new DatabaseMetadataException("Cannot find record type '" + recordType + "'");
8097
}
8198
}

engine/src/main/java/com/arcadedb/database/TransactionContext.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ public void rollback() {
229229
if (database.isOpen())
230230
for (final Record r : modifiedRecordsCache.values())
231231
try {
232-
// System.out.println("transaction context--->reload");
233232
r.reload();
234233
} catch (final Exception e) {
235234
// IGNORE EXCEPTION (RECORD DELETED OR TYPE REMOVED)

engine/src/main/java/com/arcadedb/graph/ImmutableVertex.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ public byte getRecordType() {
6666

6767
public MutableVertex modify() {
6868
final Record recordInCache = database.getTransaction().getRecordFromCache(rid);
69-
// System.out.println("ImmutableVertex-->modify-->recordinCache:: " + recordInCache);
7069
if (recordInCache != null) {
71-
if (recordInCache instanceof MutableVertex fromCache)
72-
return fromCache;
70+
if (recordInCache instanceof MutableVertex)
71+
return (MutableVertex) recordInCache;
7372
} else if (!database.getTransaction().hasPageForRecord(rid.getPageId())) {
7473
// THE RECORD IS NOT IN TX, SO IT MUST HAVE BEEN LOADED WITHOUT A TX OR PASSED FROM ANOTHER TX
7574
// IT MUST BE RELOADED TO GET THE LATEST CHANGES. FORCE RELOAD
@@ -78,7 +77,6 @@ public MutableVertex modify() {
7877
database.getTransaction()
7978
.getPageToModify(rid.getPageId(), ((LocalBucket) database.getSchema().getBucketById(rid.getBucketId())).getPageSize(),
8079
false);
81-
// System.out.println("ImmutableVertex-->modify--->reload");
8280
reload();
8381
} catch (final IOException e) {
8482
throw new DatabaseOperationException("Error on reloading vertex " + rid, e);

0 commit comments

Comments
 (0)