openhab-addons/bundles/org.openhab.persistence.dynamodb/pom.xml
Sami Salonen b675160486
[dynamodb] Dynamodb refactor (#9937)
* [dynamodb] Update to SDKv2 Enhanced Client

In addition, introduce new more simple table layout, having only one
table for all items and with more efficient data encoding (saves some read capacity).

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Time To Live (TTL) support with new table schema

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Support QuantityType

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] suppress null warnings in tests

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Optimized query performance

Similar to https://github.com/openhab/openhab-addons/pull/8938,
avoid calling Item.getUnit() repeatedly when querying data.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Support for Group items

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Update copyright to 2021

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Removing TODO comments and add javadoc

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] javadoc

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Readability improved in TableCreatingPutItem

Also documenting the full retry logic.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] verify fixes

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Remove slf4j from explicit dependencies

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Remove jackson from pom.xml, add as feature dep

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] bnd.importpackage tuned

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] abort query() immediately if not configured to avoid NPE

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] less chatty diagnostics

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] xml formatting

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] corrected logger class

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] netty client configured

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] bnd not to filter out importpackage org.slf4j.impl

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] cfg bundle group id

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Remove usage of org.apache.commons

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Remove extra prints from test

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Reducing @SupressWarnings with generics

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] README extra space removed

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] spotless

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Removed unnecessary logging

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] encapsulation

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] removed unnecessary NonNullByDefault({}) ctr-injected field

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] null annotations

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] less verbose logging in tests

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Prefer Collections.emptyList over List.of()

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] less verbose call

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Visitor to return values (simplifies the code)

Less warnings suppressed

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] comments for remaining warning supressions

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] README tuning, typo fixing

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Using less verbose syntax

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] simplified logging on errors

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Code review comments

Avoiding null checker while having more compact code

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] Null safety

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] configuration label and description formatting

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] xml indentation with tabs

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] @Nullable 1-line annotation with class fields

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] No need to override credentials per request

Client has the credentials set on build time

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] set API timeouts no matter what

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] adding exception message

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] static logger

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] dependency

- comments clarifying the logic of properties
- adding netty to dep.noembedding to ensure it is not compiled in

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] ensure correct jackson and netty versions using dependencyMgt

Specifically for development and testing

See 051c764789
for further discussion why this is needed.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] avoid google collections

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] jackson-dataformat-cbor not jackson-cbor

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] also restrict netty-transport-native-epoll linux-x86_64 version

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] refering dynamodb.cfg similar to other bundles

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] bnd.importpackage to excl. reactivestreams and typesafe.netty

These are compiled-in dependencies, and thus we do not want to have them in
OSGi Import-Package.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Update bundles/org.openhab.persistence.dynamodb/src/main/resources/OH-INF/config/config.xml

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* Update bundles/org.openhab.persistence.dynamodb/src/main/resources/OH-INF/config/config.xml

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>

* [dynamodb] remove netty-codec-http2 as it is included in tp-netty

See https://github.com/openhab/openhab-core/pull/2257/

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] removed duplicate in bnd.importpackage

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

* [dynamodb] slf4j-api marked as provided to remove dep errors in runtime

Signed-off-by: Sami Salonen <ssalonen@gmail.com>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
2021-04-10 22:13:38 +02:00

318 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.persistence.dynamodb</artifactId>
<name>openHAB Add-ons :: Bundles :: Persistence Service :: DynamoDB</name>
<properties>
<!-- Avoid declaring OSGI-imports for packages that are part of embedded/compiled dependencies, declared below under
<dependencies> -->
<bnd.importpackage>!com.amazonaws.*,!com.sun.org.apache.xpath.*,!kotlin,!org.apache.log.*,!org.bouncycastle.*,!org.joda.convert.*,!scala.util.*,!software.amazon.*,!org.reactivestreams,!com.typesafe.netty</bnd.importpackage>
<!-- We do not want to embed/compile in dependencies that are declared as OSGi imports (feature.xml). This includes e.g.
netty & jackson. Let's ensure by listing relevant packages with dep.noembedding -->
<dep.noembedding>netty-common,netty-transport,netty-transport-native-epoll,netty-transport-native-unix-common,netty-buffer,netty-resolver,netty-codec,netty-codec-http,netty-codec-http2,netty-handler,jackson-core,jackson-annotations,jackson-dataformat-cbor,jackson-databind</dep.noembedding>
<!-- netty version matching the openhab.tp-netty feature version -->
<netty.version>4.1.42.Final</netty.version>
<slf4j.version>1.7.21</slf4j.version>
</properties>
<!--Custom repository for DynamoDBLocal -->
<repositories>
<repository>
<id>dynamodb-local-repo</id>
<name>DynamoDB Local Release Repository</name>
<url>https://s3-us-west-2.amazonaws.com/dynamodb-local/release</url>
</repository>
</repositories>
<build>
<plugins>
<!-- Copy sqlite native libraries for tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy</id>
<phase>test-compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>test</includeScope>
<includeTypes>so,dll,dylib</includeTypes>
<outputDirectory>${project.basedir}/src/test/resources/native-libs</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- Let's ensure the correct versions with dependencyManagement.
We want to run our tests and compilations using netty and jackson version used in the runtime (provided as OSGi features).
slf4j-api version is locked to core-version. Also: slf4j comes via openHAB logging, so setting it here as provided to
have the right OSGi imports.
-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>${netty.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Test dependencies -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>DynamoDBLocal</artifactId>
<version>1.13.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>8.1.12.v20130726</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.12.v20130726</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>sqlite4java</artifactId>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>sqlite4java-win32-x86</artifactId>
<type>dll</type>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>sqlite4java-win32-x64</artifactId>
<type>dll</type>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>libsqlite4java-osx</artifactId>
<type>dylib</type>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>libsqlite4java-linux-i386</artifactId>
<type>so</type>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.almworks.sqlite4java</groupId>
<artifactId>libsqlite4java-linux-amd64</artifactId>
<type>so</type>
<version>[1.0, 2.0)</version>
<scope>test</scope>
</dependency>
<!-- -->
<!-- -->
<!-- SDK (runtime) dependencies -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- NOTE: this list is generated automatically using scripts/fetch_sdk.sh to
facilitate easier SDK updates. Do not edit the below manually -->
<!-- NOTE 2: all transitive dependencies of AWS SDK are included as direct dependencies of this bundle,
since we want to embed them to the bundle. The ones specified in dep.noembedded are not embedded though and not even
listed here.
-->
<dependency>
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams-http</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>com.typesafe.netty</groupId>
<artifactId>netty-reactive-streams</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>annotations</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-core</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-json-protocol</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb-enhanced</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>http-client-spi</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>metrics-spi</artifactId>
<version>2.15.77</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
<version>2.15.77</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>profiles</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>protocol-core</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>regions</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sdk-core</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>utils</artifactId>
<version>2.15.56</version>
</dependency>
<dependency>
<groupId>software.amazon.eventstream</groupId>
<artifactId>eventstream</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</project>