From e6339b701f9949deaaa91dcbeb0d6fc0bb8bd796 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 6 Jul 2023 12:58:54 +0200 Subject: [PATCH] Removed adapter properties BINARY_COLUMN_HANDLING and IS_LOCAL (#273) --- .github/workflows/broken_links_checker.yml | 7 +- .github/workflows/ci-build-next-java.yml | 2 +- README.md | 2 +- dependencies.md | 75 ++++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_17.0.0.md | 73 ++++++++++++++++++ pk_generated_parent.pom | 50 ++++++++++--- pom.xml | 18 ++--- .../com/exasol/adapter/AdapterProperties.java | 52 +------------ .../exasol/adapter/BinaryColumnHandling.java | 25 ------- .../exasol/adapter/AdapterPropertiesTest.java | 36 +-------- 11 files changed, 172 insertions(+), 169 deletions(-) create mode 100644 doc/changes/changes_17.0.0.md delete mode 100644 src/main/java/com/exasol/adapter/BinaryColumnHandling.java diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 29071df..c4ff3be 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -19,9 +19,12 @@ jobs: - name: Configure broken links checker run: | mkdir -p ./target - echo '{ "aliveStatusCodes": [429, 200], "ignorePatterns": [{"pattern": "^https?://(www.)?opensource.org"}] }' > ./target/broken_links_checker.json + echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ + '{"pattern": "^https?://(www|dev).mysql.com/"},' \ + '{"pattern": "^https?://(www.)?opensource.org"}' \ + ']}' > ./target/broken_links_checker.json - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' use-verbose-mode: 'yes' - config-file: ./target/broken_links_checker.json \ No newline at end of file + config-file: ./target/broken_links_checker.json diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index 6a1006c..e0c15cf 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -25,7 +25,7 @@ jobs: cache: 'maven' - name: Run tests and build with Maven run: | - mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ + mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - name: Publish Test Report uses: scacap/action-surefire-report@v1 diff --git a/README.md b/README.md index 189f3d3..fe21557 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Common module of Exasol Virtual Schemas Adapters [![Build Status](https://github.com/exasol/virtual-schema-common-java/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/virtual-schema-common-java/actions/workflows/ci-build.yml) -[![Maven Central – Common module of Exasol Virtual Schemas Adapters](https://img.shields.io/maven-central/v/com.exasol/virtual-schema-common-java)](https://search.maven.org/artifact/com.exasol/virtual-schema-common-java) +[![Maven Central – Common module of Exasol Virtual Schemas Adapters](https://img.shields.io/maven-central/v/com.exasol/virtual-schema-common-java)](https://search.maven.org/artifact/com.exasol/virtual-schema-common-java) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Avirtual-schema-common-java&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Avirtual-schema-common-java) diff --git a/dependencies.md b/dependencies.md index a2733e2..b1aa1f7 100644 --- a/dependencies.md +++ b/dependencies.md @@ -31,26 +31,27 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | | [SonarQube Scanner for Maven][19] | [GNU LGPL 3][20] | -| [Apache Maven Compiler Plugin][21] | [Apache License, Version 2.0][18] | -| [Apache Maven Enforcer Plugin][22] | [Apache License, Version 2.0][18] | +| [Apache Maven Compiler Plugin][21] | [Apache-2.0][18] | +| [Apache Maven Enforcer Plugin][22] | [Apache-2.0][18] | | [Maven Flatten Plugin][23] | [Apache Software Licenese][18] | | [org.sonatype.ossindex.maven:ossindex-maven-plugin][24] | [ASL2][10] | -| [Maven Surefire Plugin][25] | [Apache License, Version 2.0][18] | +| [Maven Surefire Plugin][25] | [Apache-2.0][18] | | [Versions Maven Plugin][26] | [Apache License, Version 2.0][18] | -| [Apache Maven Deploy Plugin][27] | [Apache License, Version 2.0][18] | -| [Apache Maven GPG Plugin][28] | [Apache License, Version 2.0][18] | -| [Apache Maven Source Plugin][29] | [Apache License, Version 2.0][18] | -| [Apache Maven Javadoc Plugin][30] | [Apache License, Version 2.0][18] | -| [Nexus Staging Maven Plugin][31] | [Eclipse Public License][32] | -| [JaCoCo :: Maven Plugin][33] | [Eclipse Public License 2.0][34] | -| [error-code-crawler-maven-plugin][35] | [MIT License][36] | -| [Reproducible Build Maven Plugin][37] | [Apache 2.0][10] | -| [Project keeper maven plugin][38] | [The MIT License][39] | -| [Maven Clean Plugin][40] | [The Apache Software License, Version 2.0][10] | -| [Maven Resources Plugin][41] | [The Apache Software License, Version 2.0][10] | -| [Maven JAR Plugin][42] | [The Apache Software License, Version 2.0][10] | -| [Maven Install Plugin][43] | [The Apache Software License, Version 2.0][10] | -| [Maven Site Plugin 3][44] | [The Apache Software License, Version 2.0][10] | +| [duplicate-finder-maven-plugin Maven Mojo][27] | [Apache License 2.0][28] | +| [Apache Maven Deploy Plugin][29] | [Apache-2.0][18] | +| [Apache Maven GPG Plugin][30] | [Apache License, Version 2.0][18] | +| [Apache Maven Source Plugin][31] | [Apache License, Version 2.0][18] | +| [Apache Maven Javadoc Plugin][32] | [Apache-2.0][18] | +| [Nexus Staging Maven Plugin][33] | [Eclipse Public License][34] | +| [JaCoCo :: Maven Plugin][35] | [Eclipse Public License 2.0][36] | +| [error-code-crawler-maven-plugin][37] | [MIT License][38] | +| [Reproducible Build Maven Plugin][39] | [Apache 2.0][10] | +| [Project keeper maven plugin][40] | [The MIT License][41] | +| [Maven Clean Plugin][42] | [The Apache Software License, Version 2.0][10] | +| [Maven Resources Plugin][43] | [The Apache Software License, Version 2.0][10] | +| [Maven JAR Plugin][44] | [The Apache Software License, Version 2.0][10] | +| [Maven Install Plugin][45] | [The Apache Software License, Version 2.0][10] | +| [Maven Site Plugin 3][46] | [The Apache Software License, Version 2.0][10] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -78,22 +79,24 @@ [23]: https://www.mojohaus.org/flatten-maven-plugin/ [24]: https://sonatype.github.io/ossindex-maven/maven-plugin/ [25]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[26]: https://www.mojohaus.org/versions-maven-plugin/ -[27]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[28]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[29]: https://maven.apache.org/plugins/maven-source-plugin/ -[30]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[31]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[32]: http://www.eclipse.org/legal/epl-v10.html -[33]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[34]: https://www.eclipse.org/legal/epl-2.0/ -[35]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[36]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[37]: http://zlika.github.io/reproducible-build-maven-plugin -[38]: https://github.com/exasol/project-keeper/ -[39]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[40]: http://maven.apache.org/plugins/maven-clean-plugin/ -[41]: http://maven.apache.org/plugins/maven-resources-plugin/ -[42]: http://maven.apache.org/plugins/maven-jar-plugin/ -[43]: http://maven.apache.org/plugins/maven-install-plugin/ -[44]: http://maven.apache.org/plugins/maven-site-plugin/ +[26]: https://www.mojohaus.org/versions/versions-maven-plugin/ +[27]: https://github.com/basepom/duplicate-finder-maven-plugin +[28]: http://www.apache.org/licenses/LICENSE-2.0.html +[29]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[30]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[31]: https://maven.apache.org/plugins/maven-source-plugin/ +[32]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[33]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[34]: http://www.eclipse.org/legal/epl-v10.html +[35]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[36]: https://www.eclipse.org/legal/epl-2.0/ +[37]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[38]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[39]: http://zlika.github.io/reproducible-build-maven-plugin +[40]: https://github.com/exasol/project-keeper/ +[41]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[42]: http://maven.apache.org/plugins/maven-clean-plugin/ +[43]: http://maven.apache.org/plugins/maven-resources-plugin/ +[44]: http://maven.apache.org/plugins/maven-jar-plugin/ +[45]: http://maven.apache.org/plugins/maven-install-plugin/ +[46]: http://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 7fed55f..4f78c4a 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [17.0.0](changes_17.0.0.md) * [16.2.0](changes_16.2.0.md) * [16.1.5](changes_16.1.5.md) * [16.1.4](changes_16.1.4.md) diff --git a/doc/changes/changes_17.0.0.md b/doc/changes/changes_17.0.0.md new file mode 100644 index 0000000..af14445 --- /dev/null +++ b/doc/changes/changes_17.0.0.md @@ -0,0 +1,73 @@ +# Common Module of Exasol Virtual Schemas Adapters 17.0.0, released 2023-07-06 + +Code name: Removed Adapter Properties + +## Summary + +This release updates dependencies and removes some adapter properties for different reasons. + +As removing the adapter properties is considered a breaking change in the public API of VSCOMJAVA this release comes with an updated major version. + +### Removed adapter properties + +* `BINARY_COLUMN_HANDLING` +* `IS_LOCAL` + +#### `BINARY_COLUMN_HANDLING` + +Removed constants and access methods in class `AdapterProperties`: +* `String BINARY_COLUMN_HANDLING` +* `BinaryColumnHandling hasBinaryColumnHandling()` +* `BinaryColumnHandling getBinaryColumnHandling()` +* `class com.exasol.adapter.BinaryColumnHandling` + +Rationale: +* This property was never implemented by any virtual schema up to now. +* As the property also was never used by any virtual schema in GitHub org `exasol` the removal is expected to go without any consequences. + +#### `IS_LOCAL` + +Removed constants and access methods in class `AdapterProperties`: +* `String IS_LOCAL_PROPERTY` +* `boolean hasIsLocal()` +* `boolean isLocalSource()` + +Rationale: +* This property is specific only for Exasol virtual schema. +* Hence its implementation has been moved with ticket [VSEXA #85](https://github.com/exasol/exasol-virtual-schema/issues/85). + +Rationale: +* Potentially remove +* See also ticket #269. + +## Features + +* #268: Removed adapter properties `BINARY_COLUMN_HANDLING` and `IS_LOCAL` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:error-reporting-java:1.0.0` to `1.0.1` +* Updated `com.exasol:udf-api-java:1.0.1` to `1.0.2` +* Updated `jakarta.json:jakarta.json-api:2.1.1` to `2.1.2` + +### Test Dependency Updates + +* Updated `nl.jqno.equalsverifier:equalsverifier:3.12` to `3.14.3` +* Updated `org.junit.jupiter:junit-jupiter:5.9.1` to `5.9.3` +* Updated `org.mockito:mockito-junit-jupiter:4.9.0` to `5.4.0` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.1` to `1.2.3` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.1` to `2.9.7` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.10.1` to `3.11.0` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.0.0` to `3.1.1` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.1.0` to `3.3.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7` to `3.0.0` +* Added `org.basepom.maven:duplicate-finder-maven-plugin:1.5.1` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.3.0` to `1.4.1` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.13.0` to `2.15.0` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.8` to `0.8.9` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index bf9c7f3..acaa381 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol virtual-schema-common-java-generated-parent - 16.2.0 + 17.0.0 pom UTF-8 @@ -53,7 +53,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 ${java.version} ${java.version} @@ -62,7 +62,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.3.0 enforce-maven @@ -72,7 +72,7 @@ - 3.6.3 + [3.8.7,3.9.0) @@ -82,7 +82,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.3.0 + 1.4.1 true oss @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.0.0 @@ -132,7 +132,7 @@ org.codehaus.mojo versions-maven-plugin - 2.13.0 + 2.15.0 display-updates @@ -147,10 +147,36 @@ file:///${project.basedir}/versionsMavenPluginRules.xml + + org.basepom.maven + duplicate-finder-maven-plugin + 1.5.1 + + + default + verify + + check + + + + + true + true + true + true + true + true + false + true + true + false + + org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.1 true @@ -191,7 +217,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 attach-javadocs @@ -216,6 +242,8 @@ true ossrh https://oss.sonatype.org/ + 15 + 30 @@ -230,7 +258,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.9 prepare-agent @@ -271,7 +299,7 @@ com.exasol error-code-crawler-maven-plugin - 1.2.1 + 1.2.3 verify diff --git a/pom.xml b/pom.xml index 7bed386..cc9d4bd 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 virtual-schema-common-java - 16.2.0 + 17.0.0 Common module of Exasol Virtual Schemas Adapters This is one of the modules of Virtual Schemas Adapters. The libraries provided by this project are the foundation of the adapter development, i.e. adapters must be implemented on top of them. @@ -11,7 +11,7 @@ jakarta.json jakarta.json-api - 2.1.1 + 2.1.2 org.glassfish @@ -23,7 +23,7 @@ com.exasol udf-api-java - 1.0.1 + 1.0.2 org.hamcrest @@ -40,13 +40,13 @@ org.junit.jupiter junit-jupiter - 5.9.1 + 5.9.3 test org.mockito mockito-junit-jupiter - 4.9.0 + 5.4.0 test @@ -58,13 +58,13 @@ nl.jqno.equalsverifier equalsverifier - 3.12 + 3.14.3 test com.exasol error-reporting-java - 1.0.0 + 1.0.1 @@ -72,7 +72,7 @@ com.exasol project-keeper-maven-plugin - 2.9.1 + 2.9.7 @@ -86,7 +86,7 @@ virtual-schema-common-java-generated-parent com.exasol - 16.2.0 + 17.0.0 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/adapter/AdapterProperties.java b/src/main/java/com/exasol/adapter/AdapterProperties.java index da15905..945a9b6 100644 --- a/src/main/java/com/exasol/adapter/AdapterProperties.java +++ b/src/main/java/com/exasol/adapter/AdapterProperties.java @@ -47,14 +47,6 @@ public class AdapterProperties extends AbstractAdapterProperties { * The constant IGNORE_ERRORS_PROPERTY. */ public static final String IGNORE_ERRORS_PROPERTY = "IGNORE_ERRORS"; - /** - * The constant IS_LOCAL_PROPERTY. - */ - public static final String IS_LOCAL_PROPERTY = "IS_LOCAL"; - /** - * The constant BINARY_COLUMN_HANDLING_PROPERTY. - */ - public static final String BINARY_COLUMN_HANDLING_PROPERTY = "BINARY_COLUMN_HANDLING"; /** * Create a new instance of {@link AdapterProperties} @@ -166,31 +158,7 @@ public static boolean isRefreshingVirtualSchemaRequired(final Maptrue if the data source and the database containing the Virtual Schema are hosted on the - * same Exasol cluster - */ - public boolean isLocalSource() { - return isEnabled(IS_LOCAL_PROPERTY); - } - - /** - * Get binary column handling - * - * @return binary column handling - */ - public BinaryColumnHandling getBinaryColumnHandling() { - if (hasBinaryColumnHandling()) { - return BinaryColumnHandling.valueOf(get(BINARY_COLUMN_HANDLING_PROPERTY)); - } else { - return BinaryColumnHandling.IGNORE; - } + || changedProperties.containsKey(TABLE_FILTER_PROPERTY); } /** @@ -274,24 +242,6 @@ public boolean hasIgnoreErrors() { return containsKey(IGNORE_ERRORS_PROPERTY); } - /** - * Check if the "is local" property is set - * - * @return true if "is local" property is set - */ - public boolean hasIsLocal() { - return containsKey(IS_LOCAL_PROPERTY); - } - - /** - * Check if the binary column handling property is set - * - * @return true if binary column handling property is set - */ - public boolean hasBinaryColumnHandling() { - return containsKey(BINARY_COLUMN_HANDLING_PROPERTY); - } - /** * Get empty property list * diff --git a/src/main/java/com/exasol/adapter/BinaryColumnHandling.java b/src/main/java/com/exasol/adapter/BinaryColumnHandling.java deleted file mode 100644 index a28f65b..0000000 --- a/src/main/java/com/exasol/adapter/BinaryColumnHandling.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.exasol.adapter; - -/** - * This enumeration represents the different strategies that the Virtual Schema adapter offers for handling binary - * column types in the source database. - *

- * Choices are: - *

- *
- *
IGNORE
- *
Binary column is not mapped
- *
ENCODE_BASE64
- *
Content of the binary column is encoded with Base64 and put into a VARCHAR
- *
- */ -public enum BinaryColumnHandling { - /** - * Ignore binary column handling. - */ - IGNORE, - /** - * Encode base 64 binary column handling. - */ - ENCODE_BASE64 -} \ No newline at end of file diff --git a/src/test/java/com/exasol/adapter/AdapterPropertiesTest.java b/src/test/java/com/exasol/adapter/AdapterPropertiesTest.java index dc56371..d1b28f3 100644 --- a/src/test/java/com/exasol/adapter/AdapterPropertiesTest.java +++ b/src/test/java/com/exasol/adapter/AdapterPropertiesTest.java @@ -3,7 +3,6 @@ import static com.exasol.adapter.AdapterProperties.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.assertThrows; import java.lang.reflect.*; import java.util.*; @@ -12,7 +11,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.*; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; import com.exasol.utils.StringUtils; @@ -55,7 +55,7 @@ void testGetFilteredTables() { } @ValueSource(strings = { CONNECTION_NAME_PROPERTY, SCHEMA_NAME_PROPERTY, CATALOG_NAME_PROPERTY, - TABLE_FILTER_PROPERTY, BINARY_COLUMN_HANDLING_PROPERTY }) + TABLE_FILTER_PROPERTY }) @ParameterizedTest void testIsRefreshingVirtualSchemaRequiredTrue(final String propertyName) { this.rawProperties.put(propertyName, ""); @@ -79,36 +79,6 @@ void testGetIgnoredErrorsReturnsEmptyListByDefault() { assertThat(AdapterProperties.emptyProperties().getIgnoredErrors(), emptyIterableOf(String.class)); } - @Test - void testIsLocalSourceFalse() { - assertThat(AdapterProperties.emptyProperties().isLocalSource(), equalTo(false)); - } - - @Test - void testIsLocalSourceTrue() { - this.rawProperties.put(IS_LOCAL_PROPERTY, "true"); - assertThat(new AdapterProperties(this.rawProperties).isLocalSource(), equalTo(true)); - } - - @CsvSource({ "IGNORE, IGNORE", "ENCODE_BASE64, ENCODE_BASE64" }) - @ParameterizedTest - void testGetBinaryColumnHandling(final String value, final BinaryColumnHandling binaryColumnHandling) { - this.rawProperties.put(BINARY_COLUMN_HANDLING_PROPERTY, value); - assertThat(new AdapterProperties(this.rawProperties).getBinaryColumnHandling(), equalTo(binaryColumnHandling)); - } - - @Test - void testGetBinaryColumnHandlingIsIgnoreByDefault() { - assertThat(AdapterProperties.emptyProperties().getBinaryColumnHandling(), equalTo(BinaryColumnHandling.IGNORE)); - } - - @Test - void testGetUnknownBinaryColumnHandlingThrowsException() { - this.rawProperties.put(BINARY_COLUMN_HANDLING_PROPERTY, "THIS_VALUE_DOES_NOT_EXIST"); - assertThrows(IllegalArgumentException.class, - () -> new AdapterProperties(this.rawProperties).getBinaryColumnHandling()); - } - @MethodSource("getAdapterPropertyNames") @ParameterizedTest void testHasNamedPropertyFalseByDefault(final String propertyName) throws NoSuchMethodException, SecurityException,