From bfdcd5e69a25d81e16841e1fed1446cc34a0ae3e Mon Sep 17 00:00:00 2001 From: Marco Vogt Date: Sat, 2 Dec 2023 17:05:25 +0100 Subject: [PATCH] Minor adjustments while reviewing --- .gitignore | 3 --- CHANGELOG.md | 4 ++-- core/src/main/java/org/polypheny/db/PolyImplementation.java | 4 ++-- core/src/main/java/org/polypheny/db/ResultIterator.java | 5 +---- core/src/main/java/org/polypheny/db/StatisticsManager.java | 4 ++-- .../org/polypheny/db/adapter/AbstractAdapterSetting.java | 1 - .../org/polypheny/db/adapter/AbstractAdapterSettingList.java | 1 + core/src/main/java/org/polypheny/db/adapter/Adapter.java | 5 ++--- .../main/java/org/polypheny/db/adapter/AdapterManager.java | 1 + .../org/polypheny/db/adapter/AdapterSettingDeserializer.java | 3 ++- .../polypheny/db/adapter/annotations/AdapterProperties.java | 2 +- 11 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 078109383e..f364b38607 100644 --- a/.gitignore +++ b/.gitignore @@ -220,9 +220,6 @@ nbdist/ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !/gradle/wrapper/gradle-wrapper.jar -/geode-adapter/vf.gf.server.status.cmd -/core/custom-namespace-model.json -/testTestCsv/** !/libs/avatica-1.16.0-POLYPHENYDB-shaded.jar !/libs/avatica-server-1.16.0-POLYPHENYDB.jar /dbms/target/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 2689d28822..57d95ec3e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,13 +24,13 @@ * Add support for the labeled property graph data model * Add support for the cypher query language -* Add a neo4j data store adapterTemplate +* Add a neo4j data store adapter * Improve cross-model query support * Improve the document data model * Improve handling of DML queries containing operations not supported on the underlying data store * Improve constraint enforcement * Refactor transaction locking -* Add a remote deployment support for the MongoDB adapterTemplate +* Add a remote deployment support for the MongoDB adapter * Allow specifying colors for information graphs * Add a logging for the number of monitoring threads * Option to select a time interval for the graph in the UI dashboard diff --git a/core/src/main/java/org/polypheny/db/PolyImplementation.java b/core/src/main/java/org/polypheny/db/PolyImplementation.java index eff55e46fd..a0b020d02e 100644 --- a/core/src/main/java/org/polypheny/db/PolyImplementation.java +++ b/core/src/main/java/org/polypheny/db/PolyImplementation.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 The Polypheny Project + * Copyright 2019-2023 The Polypheny Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ public static Meta.StatementType toStatementType( Kind kind ) { return Meta.StatementType.IS_DML; } - throw new GenericRuntimeException( "Statement type does not exist." ); + throw new GenericRuntimeException( "Illegal statement type: " + kind.name() ); } diff --git a/core/src/main/java/org/polypheny/db/ResultIterator.java b/core/src/main/java/org/polypheny/db/ResultIterator.java index 61b2c2d19f..3244221f34 100644 --- a/core/src/main/java/org/polypheny/db/ResultIterator.java +++ b/core/src/main/java/org/polypheny/db/ResultIterator.java @@ -36,6 +36,7 @@ import org.polypheny.db.transaction.Statement; import org.polypheny.db.type.entity.PolyValue; + @Value public class ResultIterator implements AutoCloseable { @@ -62,7 +63,6 @@ public ResultIterator( Iterator iterator, Statement statement, int public List> getNextBatch() { - StopWatch stopWatch = null; try { if ( isTimed ) { @@ -93,7 +93,6 @@ public List> getNextBatch() { } catch ( Exception e ) { throw new GenericRuntimeException( t ); } - } } @@ -131,9 +130,7 @@ private List getNextBatch( @Nullable Function transformer public List getArrayRows() { - return getNextBatch( rowType.getFieldCount() == 1 ? e -> (PolyValue[]) e : null ); - } diff --git a/core/src/main/java/org/polypheny/db/StatisticsManager.java b/core/src/main/java/org/polypheny/db/StatisticsManager.java index daf3d82977..073740d836 100644 --- a/core/src/main/java/org/polypheny/db/StatisticsManager.java +++ b/core/src/main/java/org/polypheny/db/StatisticsManager.java @@ -30,7 +30,7 @@ public abstract class StatisticsManager implements PropertyChangeListener { public static StatisticsManager setAndGetInstance( StatisticsManager transaction ) { if ( INSTANCE != null ) { - throw new GenericRuntimeException( "Overwriting the MaterializedViewManager is not permitted." ); + throw new GenericRuntimeException( "Overwriting the StatisticsManager is not permitted." ); } INSTANCE = transaction; return INSTANCE; @@ -45,7 +45,7 @@ public static StatisticsManager getInstance() { } - // Use relNode to update + // Use algNode to update public abstract void tablesToUpdate( long tableId ); // Use cache if possible diff --git a/core/src/main/java/org/polypheny/db/adapter/AbstractAdapterSetting.java b/core/src/main/java/org/polypheny/db/adapter/AbstractAdapterSetting.java index a74d490e51..7e237541ee 100644 --- a/core/src/main/java/org/polypheny/db/adapter/AbstractAdapterSetting.java +++ b/core/src/main/java/org/polypheny/db/adapter/AbstractAdapterSetting.java @@ -144,7 +144,6 @@ public static List serializeSettings( List options; public boolean dynamic = false; diff --git a/core/src/main/java/org/polypheny/db/adapter/Adapter.java b/core/src/main/java/org/polypheny/db/adapter/Adapter.java index 31eaff2201..c102c003a3 100644 --- a/core/src/main/java/org/polypheny/db/adapter/Adapter.java +++ b/core/src/main/java/org/polypheny/db/adapter/Adapter.java @@ -16,7 +16,6 @@ package org.polypheny.db.adapter; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -53,6 +52,7 @@ import org.polypheny.db.schema.types.Expressible; import org.polypheny.db.transaction.PolyXid; + @Getter @Slf4j public abstract class Adapter implements Scannable, Expressible { @@ -103,7 +103,7 @@ public Adapter( long adapterId, String uniqueName, Map settings, informationGroups = new ArrayList<>(); informationElements = new ArrayList<>(); - // this is need for docker deployable stores and should not interfere too much with other adapters + // This is need for docker deployable stores and should not interfere too much with other adapters if ( deployMode == DeployMode.DOCKER ) { this.listener = attachListener( Integer.parseInt( settings.get( "instanceId" ) ) ); } @@ -183,7 +183,6 @@ protected List applySettings( Map newSettings ) { updatedSettings.add( newSetting.getKey() ); } } - return updatedSettings; } diff --git a/core/src/main/java/org/polypheny/db/adapter/AdapterManager.java b/core/src/main/java/org/polypheny/db/adapter/AdapterManager.java index 26129a15b2..8083dbd99c 100644 --- a/core/src/main/java/org/polypheny/db/adapter/AdapterManager.java +++ b/core/src/main/java/org/polypheny/db/adapter/AdapterManager.java @@ -39,6 +39,7 @@ import org.polypheny.db.catalog.entity.allocation.AllocationEntity; import org.polypheny.db.catalog.exceptions.GenericRuntimeException; + public class AdapterManager { public static Expression ADAPTER_MANAGER_EXPRESSION = Expressions.call( AdapterManager.class, "getInstance" ); diff --git a/core/src/main/java/org/polypheny/db/adapter/AdapterSettingDeserializer.java b/core/src/main/java/org/polypheny/db/adapter/AdapterSettingDeserializer.java index 38451e0e34..6c90cac5d7 100644 --- a/core/src/main/java/org/polypheny/db/adapter/AdapterSettingDeserializer.java +++ b/core/src/main/java/org/polypheny/db/adapter/AdapterSettingDeserializer.java @@ -25,7 +25,8 @@ import java.util.ArrayList; import java.util.List; -//see https://stackoverflow.com/questions/19588020/gson-serialize-a-list-of-polymorphic-objects/22081826#22081826 + +// See https://stackoverflow.com/questions/19588020/gson-serialize-a-list-of-polymorphic-objects/22081826#22081826 public class AdapterSettingDeserializer implements JsonDeserializer { @Override diff --git a/core/src/main/java/org/polypheny/db/adapter/annotations/AdapterProperties.java b/core/src/main/java/org/polypheny/db/adapter/annotations/AdapterProperties.java index 7fe46a1def..4a3c33a8b0 100644 --- a/core/src/main/java/org/polypheny/db/adapter/annotations/AdapterProperties.java +++ b/core/src/main/java/org/polypheny/db/adapter/annotations/AdapterProperties.java @@ -22,6 +22,7 @@ import java.lang.annotation.Target; import org.polypheny.db.adapter.DeployMode; + @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface AdapterProperties { @@ -34,5 +35,4 @@ DeployMode defaultMode(); - }