Skip to content

Commit

Permalink
Merge pull request #252 from ydb-platform/develop
Browse files Browse the repository at this point in the history
Release v2.2.0
  • Loading branch information
alex268 authored Mar 27, 2024
2 parents 4db66a7 + 6ce6e6f commit 0cb7564
Show file tree
Hide file tree
Showing 238 changed files with 11,912 additions and 3,832 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- develop
- release*
pull_request:
type: [opened, reopened, edited]
type: [opened, reopened, edited, synchronize]

jobs:
build:
Expand All @@ -22,10 +22,10 @@ jobs:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand All @@ -44,10 +44,10 @@ jobs:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
Expand All @@ -57,5 +57,7 @@ jobs:
run: mvn $MAVEN_ARGS test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- develop
- release*
pull_request:
type: [opened, reopened, edited]
type: [opened, reopened, edited, synchronize]

jobs:
build:
Expand All @@ -22,12 +22,12 @@ jobs:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: sdk

- name: Set up JDK 8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand All @@ -53,7 +53,7 @@ jobs:
working-directory: ./sdk
run: mvn $MAVEN_ARGS install

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-yc
ref: develop
Expand All @@ -67,7 +67,7 @@ jobs:
working-directory: ./yc
run: mvn $MAVEN_ARGS -Dydb.auth-api.version=$AUTH_API_VERSION install

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-examples
ref: develop
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
Expand Down Expand Up @@ -71,12 +71,12 @@ jobs:
gpg --list-secret-keys --keyid-format LONG
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Set up Maven Central Repository
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2.2.0 ##

* Updated implementation of CoordinationService
* Added module for QueryService
* Added module for ExportService
* Added common module with basic interfaces for transactions and retries
* Core: Added basic support of long operations
* Core: Added support for tracing requests with id
* Table: Added readRows operation in table service
* Topics: Added support of transaction between tables and topics

## 2.1.12 ##

* Test common: Changed visibility of YdbDockerContainer
Expand Down
14 changes: 0 additions & 14 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,3 @@ Copyright 2022 YANDEX LLC
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 YANDEX LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2019 YANDEX LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Firstly you can import YDB Java BOM to specify correct versions of SDK modules.
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-bom</artifactId>
<version>2.1.12</version>
<version>2.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
37 changes: 33 additions & 4 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>tech.ydb</groupId>
<version>2.1.12</version>
<version>2.2.0</version>
<artifactId>ydb-sdk-bom</artifactId>
<name>Java SDK Bill of Materials</name>
<description>Java SDK Bill of Materials (BOM)</description>
Expand All @@ -15,8 +15,8 @@

<properties>
<ydb-auth-api.version>1.0.0</ydb-auth-api.version>
<ydb-proto-api.version>1.5.2</ydb-proto-api.version>
<yc-auth.version>2.1.1</yc-auth.version>
<ydb-proto-api.version>1.6.2</ydb-proto-api.version>
<yc-auth.version>2.2.0</yc-auth.version>
</properties>

<licenses>
Expand Down Expand Up @@ -55,6 +55,11 @@
<version>${ydb-auth-api.version}</version>
</dependency>

<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-core</artifactId>
Expand All @@ -75,11 +80,21 @@
<artifactId>ydb-sdk-topic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-export</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-coordination</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-query</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>tech.ydb.test</groupId>
Expand All @@ -101,11 +116,25 @@
<groupId>tech.ydb.auth</groupId>
<artifactId>yc-auth-provider</artifactId>
<version>${yc-auth.version}</version>
<!-- Exclude grpc dependencies to avoid conflict with ydb-proto-api -->
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>tech.ydb.auth</groupId>
<artifactId>yc-auth-provider-shaded</artifactId>
<version>${yc-auth.version}</version>
<!-- Exclude grpc dependencies to avoid conflict with ydb-proto-api -->
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -115,7 +144,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.12.1</version>
<configuration>
<target>1.8</target>
<source>1.8</source>
Expand Down
43 changes: 43 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-parent</artifactId>
<version>2.2.0</version>
</parent>

<artifactId>ydb-sdk-common</artifactId>
<name>Common module of Java SDK for YDB</name>
<description>Common module of Java SDK for YDB</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-core</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
30 changes: 30 additions & 0 deletions common/src/main/java/tech/ydb/common/retry/ErrorPolicy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package tech.ydb.common.retry;

/**
* Recipes should use the configured error policy to decide how to retry
* errors like unsuccessful {@link tech.ydb.core.StatusCode}.
*
* @author Aleksandr Gorshenin
* @param <T> Type of errors to check
*/
public interface ErrorPolicy<T> {

/**
* Returns true if the given value should be retried
*
* @param value value to check
* @return true if value is retryable
*/
boolean isRetryable(T value);

/**
* Returns true if the given exception should be retried
* Usually exceptions are never retried, but some policies can implement more difficult logic
*
* @param ex exception to check
* @return true if exception is retryable
*/
default boolean isRetryable(Exception ex) {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package tech.ydb.common.retry;

import java.util.concurrent.ThreadLocalRandom;


/**
*
* @author Aleksandr Gorshenin
*/
public abstract class ExponentialBackoffRetry implements RetryPolicy {
private final long backoffMs;
private final int backoffCeiling;

protected ExponentialBackoffRetry(long backoffMs, int backoffCeiling) {
this.backoffMs = backoffMs;
this.backoffCeiling = backoffCeiling;
}

protected long backoffTimeMillis(int retryNumber) {
int slots = 1 << Math.min(retryNumber, backoffCeiling);
long delay = backoffMs * slots;
return delay + ThreadLocalRandom.current().nextLong(delay);
}

/**
* Return current base of backoff delays
* @return backoff base duration in milliseconds
*/
public long getBackoffMillis() {
return backoffMs;
}

/**
* Return current maximal level of backoff exponent
* @return maximal level of backoff exponent
*/
public int getBackoffCeiling() {
return backoffCeiling;
}
}
Loading

0 comments on commit 0cb7564

Please sign in to comment.