Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/package-dynamodb-store--bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 'Bug report for the java-server-sdk-dynamodb-store package'
about: Create a report to help us improve
title: ''
labels: 'package: java-server-sdk-dynamodb-store, bug'
assignees: ''
---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request for the java-server-sdk-dynamodb-store package
about: Suggest an idea for this project
title: ''
labels: 'package: java-server-sdk-dynamodb-store, enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
6 changes: 6 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ runs:
sudo apt-get install redis-server -y
sudo service redis-server start

- name: Setup DynamoDB Service
shell: bash
if: ${{ inputs.workspace_path == 'lib/java-server-sdk-dynamodb-store' }}
run: |
sudo docker run -d -p 8000:8000 amazon/dynamodb-local

- name: Restore dependencies
shell: bash
id: restore
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/java-server-sdk-dynamodb-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: java-server-sdk-dynamodb-store

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-test-java-server-sdk-dynamodb-store:
strategy:
matrix:
java-version: [8, 11, 17, 19]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/java-server-sdk-dynamodb-store'
java_version: ${{ matrix.java-version }}

build-test-java-server-sdk-dynamodb-store-windows:
strategy:
matrix:
java-version: [11, 17]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

# DynamoDB Local 2.6.0+ requires Java 17, so it gets its own JDK independent of the version under test.
- name: Setup Java for DynamoDB Local
id: dynamodb-java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}

- name: Setup DynamoDB Service
shell: pwsh
env:
DYNAMODB_JAVA_HOME: ${{ steps.dynamodb-java.outputs.path }}
run: |
$ProgressPreference = "SilentlyContinue"
iwr -outf dynamo.zip https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.zip
mkdir dynamo
Expand-Archive -Path dynamo.zip -DestinationPath dynamo
cd dynamo
$java = Join-Path $env:DYNAMODB_JAVA_HOME "bin\java.exe"
$proc = Start-Process -PassThru -FilePath $java -ArgumentList "-D`"java.library.path=./DynamoDBLocal_lib`"","-jar","DynamoDBLocal.jar"
$deadline = (Get-Date).AddSeconds(60)
while ($true) {
try { (New-Object System.Net.Sockets.TcpClient("127.0.0.1", 8000)).Close(); break } catch {}
if ($proc.HasExited) { throw "DynamoDB Local exited before it started listening on port 8000" }
if ((Get-Date) -gt $deadline) { throw "DynamoDB Local did not start listening on port 8000 within 60 seconds" }
Start-Sleep -Seconds 1
}

- name: Restore dependencies
shell: bash
run: lib/java-server-sdk-dynamodb-store/gradlew dependencies -p lib/java-server-sdk-dynamodb-store

- name: Build
shell: bash
id: build
run: lib/java-server-sdk-dynamodb-store/gradlew build -p lib/java-server-sdk-dynamodb-store

- name: Build Jar
shell: bash
run: lib/java-server-sdk-dynamodb-store/gradlew jar -p lib/java-server-sdk-dynamodb-store

- name: Run Tests
if: steps.build.outcome == 'success'
shell: bash
run: lib/java-server-sdk-dynamodb-store/gradlew test -p lib/java-server-sdk-dynamodb-store

- name: Build Documentation
shell: bash
run: lib/java-server-sdk-dynamodb-store/gradlew javadoc -p lib/java-server-sdk-dynamodb-store
1 change: 1 addition & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- lib/sdk/server-ai
- lib/java-server-sdk-otel
- lib/java-server-sdk-redis-store
- lib/java-server-sdk-dynamodb-store
dry_run:
description: 'Is this a dry run. If so no docs will be published.'
type: boolean
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- lib/sdk/server-ai
- lib/java-server-sdk-otel
- lib/java-server-sdk-redis-store
- lib/java-server-sdk-dynamodb-store
prerelease:
description: 'Is this a prerelease.'
type: boolean
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
package-server-sdk-ai-released: ${{ steps.release.outputs['lib/sdk/server-ai--release_created'] }}
package-server-sdk-otel-released: ${{ steps.release.outputs['lib/java-server-sdk-otel--release_created'] }}
package-server-sdk-redis-store-released: ${{ steps.release.outputs['lib/java-server-sdk-redis-store--release_created'] }}
package-server-sdk-dynamodb-store-released: ${{ steps.release.outputs['lib/java-server-sdk-dynamodb-store--release_created'] }}

steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
Expand Down Expand Up @@ -160,6 +161,39 @@ jobs:
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}

release-server-sdk-dynamodb-store:
runs-on: ubuntu-latest
needs: release-please
permissions:
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-server-sdk-dynamodb-store-released == 'true'}}
steps:
- uses: actions/checkout@v4

- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.1.0
name: Get secrets
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/sonatype/central/username = SONATYPE_USER_NAME,
/production/common/releasing/sonatype/central/password = SONATYPE_PASSWORD,
/production/common/releasing/java/keyId = SIGNING_KEY_ID'
s3_path_pairs: 'launchdarkly-releaser/java/code-signing-keyring.gpg = code-signing-keyring.gpg'

- uses: ./.github/actions/full-release
with:
workspace_path: lib/java-server-sdk-dynamodb-store
dry_run: false
prerelease: false
code_signing_keyring: ${{ github.workspace }}/code-signing-keyring.gpg
signing_key_id: ${{ env.SIGNING_KEY_ID }}
signing_key_passphrase: ''
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}

release-sdk-internal:
runs-on: ubuntu-latest
needs: release-please
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"lib/sdk/server-ai": "0.3.0",
"lib/java-server-sdk-otel": "0.2.0",
"lib/java-server-sdk-redis-store": "3.2.0",
"lib/java-server-sdk-dynamodb-store": "5.0.0",
"lib/shared/common": "2.5.0",
"lib/shared/internal": "1.12.2",
"lib/shared/test-helpers": "2.1.0",
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
| ---------------------------------------------------------------------------- |--------------------------------------------------------------| ---------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- |
| [@launchdarkly/java-server-sdk-otel](lib/java-server-sdk-otel/README.md) | [![Documentation][server-otel-docs-badge]][server-otel-docs-link] | [![maven][server-otel-maven-badge]][server-otel-maven-link] | [Issues][server-otel-issues] | [![Actions Status][server-otel-ci-badge]][server-otel-ci-link] |
| [@launchdarkly/java-server-sdk-redis-store](lib/java-server-sdk-redis-store/README.md) | [![Documentation][server-redis-docs-badge]][server-redis-docs-link] | [![maven][server-redis-maven-badge]][server-redis-maven-link] | [Issues][server-redis-issues] | [![Actions Status][server-redis-ci-badge]][server-redis-ci-link] |
| [@launchdarkly/java-server-sdk-dynamodb-store](lib/java-server-sdk-dynamodb-store/README.md) | [![Documentation][server-dynamodb-docs-badge]][server-dynamodb-docs-link] | [![maven][server-dynamodb-maven-badge]][server-dynamodb-maven-link] | [Issues][server-dynamodb-issues] | [![Actions Status][server-dynamodb-ci-badge]][server-dynamodb-ci-link] |

## Organization

Expand Down Expand Up @@ -81,6 +82,15 @@ We encourage pull requests and other contributions from the community. Check out
[server-redis-docs-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
[server-redis-docs-link]: https://launchdarkly.github.io/java-core/lib/java-server-sdk-redis-store/

[//]: # 'java-server-sdk-dynamodb-store'
[server-dynamodb-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-dynamodb-store%22+
[server-dynamodb-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-server-sdk-dynamodb-store
[server-dynamodb-maven-link]: https://central.sonatype.com/artifact/com.launchdarkly/launchdarkly-java-server-sdk-dynamodb-store
[server-dynamodb-ci-badge]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-dynamodb-store.yml/badge.svg
[server-dynamodb-ci-link]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-dynamodb-store.yml
[server-dynamodb-docs-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
[server-dynamodb-docs-link]: https://launchdarkly.github.io/java-core/lib/java-server-sdk-dynamodb-store/

[//]: # 'java-sdk-internal'
[sdk-internal-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-sdk-internal%22+
[sdk-internal-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-sdk-internal
Expand Down
6 changes: 6 additions & 0 deletions lib/java-server-sdk-dynamodb-store/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
bin
69 changes: 69 additions & 0 deletions lib/java-server-sdk-dynamodb-store/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Change log

All notable changes to the LaunchDarkly Java SDK DynamoDB integration will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [5.0.0] - 2022-12-07
This release corresponds to the 6.0.0 release of the LaunchDarkly Java SDK. Any application code that is being updated to use the 6.0.0 SDK, and was using a 4.x version of `launchdarkly-java-server-sdk-dynamodb`, should now use a 5.x version instead.

There are no functional differences in the behavior of the DynamoDB integration; the differences are only related to changes in the usage of interface types for configuration in the SDK.

### Added:
- `DynamoDb.bigSegmentStore()`, which creates a configuration builder for use with Big Segments. Previously, the `DynamoDb.dataStore()` builder was used for both regular data stores and Big Segment stores.

### Changed:
- The type `DynamoDbDataStoreBuilder` has been removed, replaced by a generic type `DynamoDbStoreBuilder`. Application code would not normally need to reference these types by name, but if necessary, use either `DynamoDbStoreBuilder<PersistentDataStore>` or `DynamoDbStoreBuilder<BigSegmentStore>` depending on whether you are configuring a regular data store or a Big Segment store.

## [4.0.0] - 2022-10-06
This release updates the package to use the new logging mechanism that was introduced in version [5.10.0](https://github.com/launchdarkly/java-server-sdk/releases/tag/5.10.0) of the LaunchDarkly Java SDK, so that log output from the DynamoDB integration is handled in whatever way was specified by the SDK's logging configuration, instead of always using SLF4J.

This version of the package will not work with SDK versions earlier than 5.10.0; that is the only reason for the 4.0.0 major version increment. The functionality of the package is otherwise unchanged, and there are no API changes.

## [3.1.1] - 2022-04-15
### Fixed:
- If the SDK attempts to store a feature flag or segment whose total data size is over the 400KB limit for DynamoDB items, this integration will now log (at `Error` level) a message like `The item "my-flag-key" in "features" was too large to store in DynamoDB and was dropped` but will still process all other data updates. Previously, it would cause the SDK to enter an error state in which the oversized item would be pointlessly retried and other updates might be lost.

## [3.1.0] - 2022-02-04
### Added:
- Added support for Big Segments. An Early Access Program for creating and syncing Big Segments from customer data platforms is available to enterprise customers.

## [3.0.0] - 2020-06-02
This release is for use with versions 5.0.0 and higher of [`launchdarkly-java-server-sdk`](https://github.com/launchdarkly/java-server-sdk).

For more information about changes in the SDK database integrations, see the [4.x to 5.0 migration guide](https://docs-stg.launchdarkly.com/252/sdk/server-side/java/migration-4-to-5/).

### Changed:
- The entry point is now `com.launchdarkly.sdk.server.integrations.DynamoDb` rather than `com.launchdarkly.client.integrations.DynamoDb`.
- The SLF4J logger name is now `com.launchdarkly.sdk.server.LDClient.DataStore.DynamoDb` rather than `com.launchdarkly.client.integrations.DynamoDbDataStoreImpl`.

### Removed:
- Removed the deprecated entry point `com.launchdarkly.client.dynamodb.DynamoDbComponents`.


## [2.1.0] - 2020-01-30
### Added:
- New classes `com.launchdarkly.client.integrations.DynamoDb` and `com.launchdarkly.client.integrations.DynamoDbDataStoreBuilder`, which serve the same purpose as the previous classes but are designed to work with the newer persistent data store API introduced in [Java SDK 4.12.0](https://github.com/launchdarkly/java-server-sdk/releases/tag/4.12.0).

### Deprecated:
- The old interface in the `com.launchdarkly.client.integrations.dynamodb` package.

## [2.0.2] - 2019-12-11
### Changed:
- Updated the AWS SDK DynamoDB dependency to version 2.10.32. Your application can always specify its own desired version of the dependency; this is just the version that is used for building the library.

## [2.0.1] - 2019-05-13
### Changed:
- Corresponding to the SDK package name change from `com.launchdarkly:launchdarkly-client` to `com.launchdarkly:launchdarkly-java-server-sdk`, this package is now called `com.launchdarkly:launchdarkly-java-server-sdk-dynamodb-store`. The functionality of the package, including the package names and class names in the code, has not changed.

## [1.0.1] - 2019-05-13
### Changed:
- Corresponding to the SDK package name change from `com.launchdarkly:launchdarkly-client` to `com.launchdarkly:launchdarkly-java-server-sdk`, this package is now called `com.launchdarkly:launchdarkly-java-server-sdk-dynamodb-store`. The functionality of the package, including the package names and class names in the code, has not changed.

## [2.0.0] - 2018-12-12

Initial release of the implementation that is based on AWS SDK 2.x. This has the same functionality as version 1.0.0, but uses the DynamoDB client classes from the more recent AWS API.

Note that AWS SDK 2.x has a minimum Java version of 8, so if you require Java 7 compatibility you should use the 1.x releases of this library.

## [1.0.0] - 2018-12-12

Initial release of the implementation that is based on AWS SDK 1.x.
Loading
Loading