Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[dynamodb] Update SDK to 1.11.509 #5827

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions bundles/persistence/org.openhab.persistence.dynamodb/.classpath
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-core-1.11.213.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-dynamodb-1.11.213.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-kms-1.11.213.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-s3-1.11.213.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-core-1.11.509.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-dynamodb-1.11.509.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-kms-1.11.509.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aws-java-sdk-s3-1.11.509.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient-4.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient-4.5.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.4.9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ion-java-1.0.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-annotations-2.6.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-core-2.6.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.6.7.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.6.7.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jackson-dataformat-cbor-2.6.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jmespath-java-1.11.213.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jmespath-java-1.11.509.jar"/>
<classpathentry exported="true" kind="lib" path="lib/joda-time-2.8.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ Import-Package: com.google.common.collect;version="10.0.1",
org.osgi.service.event,
org.slf4j
Bundle-ClassPath: .,
lib/aws-java-sdk-core-1.11.213.jar,
lib/aws-java-sdk-dynamodb-1.11.213.jar,
lib/aws-java-sdk-kms-1.11.213.jar,
lib/aws-java-sdk-s3-1.11.213.jar,
lib/commons-codec-1.9.jar,
lib/aws-java-sdk-core-1.11.509.jar,
lib/aws-java-sdk-dynamodb-1.11.509.jar,
lib/aws-java-sdk-kms-1.11.509.jar,
lib/aws-java-sdk-s3-1.11.509.jar,
lib/commons-codec-1.10.jar,
lib/commons-logging-1.1.3.jar,
lib/httpclient-4.5.2.jar,
lib/httpcore-4.4.4.jar,
lib/httpclient-4.5.5.jar,
lib/httpcore-4.4.9.jar,
lib/ion-java-1.0.2.jar,
lib/jackson-annotations-2.6.0.jar,
lib/jackson-core-2.6.7.jar,
lib/jackson-databind-2.6.7.1.jar,
lib/jackson-databind-2.6.7.2.jar,
lib/jackson-dataformat-cbor-2.6.7.jar,
lib/jmespath-java-1.11.213.jar,
lib/jmespath-java-1.11.509.jar,
lib/joda-time-2.8.1.jar
Service-Component: OSGI-INF/dynamodb.xml
Bundle-Activator: org.openhab.persistence.dynamodb.internal.DynamoDBPersistenceServiceActivator
Expand Down
60 changes: 42 additions & 18 deletions bundles/persistence/org.openhab.persistence.dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ This service is provided "AS IS", and the user takes full responsibility of any

## Table of Contents

<!-- Using MarkdownTOC plugin for Sublime Text to update the table of contents (TOC) -->
<!-- MarkdownTOC depth=3 autolink=true bracket=round -->
<!-- Using MarkdownTOC plugin for Sublime Text to update the table of contents (TOC)

Package settings:
{
"defaults": {
"autolink": true,
"bracket": "round",
"levels": [1,2,3],
}
}

-->

<!-- MarkdownTOC -->

- [Prerequisites](#prerequisites)
- [Setting Up an Amazon Account](#setting-up-an-amazon-account)
Expand All @@ -31,6 +43,8 @@ This service is provided "AS IS", and the user takes full responsibility of any

<!-- /MarkdownTOC -->



## Prerequisites

You must first set up an Amazon account as described below.
Expand All @@ -55,21 +69,21 @@ This service can be configured in the file `services/dynamodb.cfg`.

### Basic configuration

| Property | Default | Required | Description |
|----------|---------|:--------:|-------------|
| accessKey | | Yes | access key as shown in [Setting up Amazon account](#setting-up-amazon-account). |
| secretKey | | Yes | secret key as shown in [Setting up Amazon account](#setting-up-amazon-account). |
| region | | Yes | AWS region ID as described in [Setting up Amazon account](#setting-up-amazon-account). The region needs to match the region that was used to create the user. |
| Property | Default | Required | Description |
| --------- | ------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| accessKey | | Yes | access key as shown in [Setting up Amazon account](#setting-up-amazon-account). |
| secretKey | | Yes | secret key as shown in [Setting up Amazon account](#setting-up-amazon-account). |
| region | | Yes | AWS region ID as described in [Setting up Amazon account](#setting-up-amazon-account). The region needs to match the region that was used to create the user. |

### Configuration Using Credentials File

Alternatively, instead of specifying `accessKey` and `secretKey`, one can configure a configuration profile file.

| Property | Default | Required | Description |
|----------|---------|:--------:|-------------|
| profilesConfigFile | | Yes | path to the credentials file. For example, `/etc/openhab2/aws_creds`. Please note that the user that runs openHAB must have approriate read rights to the credential file. For more details on the Amazon credential file format, see [Amazon documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html). |
| profile | | Yes | name of the profile to use |
| region | | Yes | AWS region ID as described in Step 2 in [Setting up Amazon account](#setting-up-amazon-account). The region needs to match the region that was used to create the user. |
| Property | Default | Required | Description |
| ------------------ | ------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| profilesConfigFile | | Yes | path to the credentials file. For example, `/etc/openhab2/aws_creds`. Please note that the user that runs openHAB must have approriate read rights to the credential file. For more details on the Amazon credential file format, see [Amazon documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html). |
| profile | | Yes | name of the profile to use |
| region | | Yes | AWS region ID as described in Step 2 in [Setting up Amazon account](#setting-up-amazon-account). The region needs to match the region that was used to create the user. |

Example of service configuration file (`services/dynamodb.cfg`):

Expand All @@ -91,11 +105,11 @@ aws_secret_access_key=testSecretKey

In addition to the configuration properties above, the following are also available:

| Property | Default | Required | Description |
|----------|---------|:--------:|-------------|
| readCapacityUnits | 1 | No | read capacity for the created tables |
| writeCapacityUnits | 1 | No | write capacity for the created tables |
| tablePrefix | `openhab-` | No | table prefix used in the name of created tables |
| Property | Default | Required | Description |
| ------------------ | ---------- | :------: | ----------------------------------------------- |
| readCapacityUnits | 1 | No | read capacity for the created tables |
| writeCapacityUnits | 1 | No | write capacity for the created tables |
| tablePrefix | `openhab-` | No | table prefix used in the name of created tables |

Refer to Amazon documentation on [provisioned throughput](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html) for details on read/write capacity.

Expand All @@ -117,6 +131,16 @@ When the tables are created, the read/write capacity is configured according to

### Updating Amazon SDK

There are two ways to update Amazon SDK used by this service: scripted and manual.

#### Using update_sdk.sh script

1. Make sure you have clean git repo state
2. Use helper script `scripts/update_sdk.sh` to automatically update library references in `build.properties`, `MANIFEST.MF` and `.classpath`. For example, to update SDK to 1.11.509: `scripts/update_sdk.sh 1.11.509`. You can use the [maven online repository browser](https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-dynamodb) to find the latest version available online.
3. Verify changes and commit changes to git.

#### Update manually

1. Clean `lib/*`
2. Update SDK version in `scripts/fetch_sdk_pom.xml`. You can use the [maven online repository browser](https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-dynamodb) to find the latest version available online.
3. `scripts/fetch_sdk.sh`
Expand All @@ -128,4 +152,4 @@ When the tables are created, the read/write capacity is configured according to
7. Generate `.classpath` entries
`ls lib/*.jar | python -c "import sys;pre='<classpathentry exported=\"true\" kind=\"lib\" path=\"';post='\"/>'; print('\\t' + pre + (post + '\\n\\t' + pre).join(map(str.strip, sys.stdin.readlines())) + post)"`

After these changes, it's good practice to run integration tests (against live AWS DynamoDB) in `org.openhab.persistence.dynamodb.test` bundle. See README.md in the test bundle for more information how to execute the tests.
**Always after updating the SDK, please remember to run integration tests** (against live AWS DynamoDB) in `org.openhab.persistence.dynamodb.test` bundle. See README.md in the test bundle for more information how to execute the tests.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ bin.includes = META-INF/,\
OSGI-INF/,\
ESH-INF/,\
.,\
lib/aws-java-sdk-core-1.11.213.jar,\
lib/aws-java-sdk-dynamodb-1.11.213.jar,\
lib/aws-java-sdk-kms-1.11.213.jar,\
lib/aws-java-sdk-s3-1.11.213.jar,\
lib/commons-codec-1.9.jar,\
lib/aws-java-sdk-core-1.11.509.jar,\
lib/aws-java-sdk-dynamodb-1.11.509.jar,\
lib/aws-java-sdk-kms-1.11.509.jar,\
lib/aws-java-sdk-s3-1.11.509.jar,\
lib/commons-codec-1.10.jar,\
lib/commons-logging-1.1.3.jar,\
lib/httpclient-4.5.2.jar,\
lib/httpcore-4.4.4.jar,\
lib/httpclient-4.5.5.jar,\
lib/httpcore-4.4.9.jar,\
lib/ion-java-1.0.2.jar,\
lib/jackson-annotations-2.6.0.jar,\
lib/jackson-core-2.6.7.jar,\
lib/jackson-databind-2.6.7.1.jar,\
lib/jackson-databind-2.6.7.2.jar,\
lib/jackson-dataformat-cbor-2.6.7.jar,\
lib/jmespath-java-1.11.213.jar,\
lib/jmespath-java-1.11.509.jar,\
lib/joda-time-2.8.1.jar
source.. = java/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading