Skip to content

Commit cc7bfa0

Browse files
authored
Merge pull request #320 from alex268/master
Small fix and CI action update
2 parents fef5bde + f638501 commit cc7bfa0

File tree

4 files changed

+103
-31
lines changed

4 files changed

+103
-31
lines changed

.github/workflows/ci.yaml

+97-28
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,113 @@ on:
44
push:
55
branches:
66
- master
7-
- develop
87
- release*
98
pull_request:
109
type: [opened, reopened, edited, synchronize]
1110

1211
jobs:
12+
prepare:
13+
name: Prepare Maven cache
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
MAVEN_ARGS: --batch-mode -Dstyle.color=always
18+
19+
steps:
20+
- name: Checkout YDB Java SDK
21+
uses: actions/checkout@v4
22+
with:
23+
path: sdk
24+
25+
- name: Checkout YDB YC Auth provider
26+
uses: actions/checkout@v4
27+
with:
28+
repository: ydb-platform/ydb-java-yc
29+
path: yc
30+
31+
- name: Checkout YDB JDBC Driver
32+
uses: actions/checkout@v4
33+
with:
34+
repository: ydb-platform/ydb-jdbc-driver
35+
path: jdbc
36+
37+
- name: Checkout YDB Java Examples
38+
uses: actions/checkout@v4
39+
with:
40+
repository: ydb-platform/ydb-java-examples
41+
path: examples
42+
43+
- name: Set up Java
44+
uses: actions/setup-java@v4
45+
with:
46+
java-version: 17
47+
distribution: 'temurin'
48+
cache: 'maven'
49+
cache-dependency-path: |
50+
sdk/pom.xml
51+
sdk/bom/pom.xml
52+
yc/pom.xml
53+
jdbc/pom.xml
54+
55+
- name: Download YDB Java SDK dependencies
56+
working-directory: ./sdk
57+
run: mvn $MAVEN_ARGS dependency:go-offline
58+
59+
- name: Download YDB YC Auth provider dependencies
60+
working-directory: ./yc
61+
run: mvn $MAVEN_ARGS dependency:go-offline
62+
63+
- name: Download YDB JDBC Driver dependencies
64+
working-directory: ./jdbc
65+
run: mvn $MAVEN_ARGS dependency:go-offline
66+
67+
- name: Download YDB Java Examples dependencies
68+
working-directory: ./examples
69+
run: mvn $MAVEN_ARGS dependency:go-offline
70+
1371
build:
14-
name: YDB Java SDK CI with Maven
72+
name: YDB Java SDK CI on JDK
1573
runs-on: ubuntu-latest
74+
needs: prepare
1675

1776
strategy:
1877
matrix:
1978
java: [ '8', '11', '17']
2079

2180
env:
22-
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true
81+
MAVEN_ARGS: --batch-mode -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true
2382

2483
steps:
25-
- uses: actions/checkout@v4
84+
- name: Checkout YDB Java SDK
85+
uses: actions/checkout@v4
2686
with:
2787
path: sdk
2888

29-
- name: Set up JDK 8
89+
- name: Checkout YDB YC Auth provider
90+
uses: actions/checkout@v4
91+
with:
92+
repository: ydb-platform/ydb-java-yc
93+
path: yc
94+
95+
- name: Checkout YDB JDBC Driver
96+
uses: actions/checkout@v4
97+
with:
98+
repository: ydb-platform/ydb-jdbc-driver
99+
path: jdbc
100+
101+
- name: Set up Java
30102
uses: actions/setup-java@v4
31103
with:
32104
java-version: ${{ matrix.java }}
33105
distribution: 'temurin'
34106
cache: 'maven'
107+
cache-dependency-path: |
108+
sdk/pom.xml
109+
sdk/bom/pom.xml
110+
yc/pom.xml
111+
jdbc/pom.xml
35112
36-
- name: Extract SDK version
113+
- name: Extract YDB Java SDK version
37114
working-directory: ./sdk
38115
run: |
39116
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
@@ -45,38 +122,30 @@ jobs:
45122
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
46123
echo "AUTH_API_VERSION=$VERSION" >> "$GITHUB_ENV"
47124
48-
- name: Download YDK SDK dependencies
49-
working-directory: ./sdk
50-
run: mvn $MAVEN_ARGS dependency:go-offline
51-
52-
- name: Build YDB SDK
125+
- name: Build YDB Java SDK
53126
working-directory: ./sdk
54127
run: mvn $MAVEN_ARGS install
55128

56-
- uses: actions/checkout@v4
57-
with:
58-
repository: ydb-platform/ydb-java-yc
59-
ref: develop
60-
path: yc
61-
62-
- name: Download YDB YC Auth provider dependencies
63-
working-directory: ./yc
64-
run: mvn $MAVEN_ARGS -Dydb.auth-api.version=$AUTH_API_VERSION dependency:go-offline
65-
66129
- name: Build YDB YC Auth provider
67130
working-directory: ./yc
68131
run: mvn $MAVEN_ARGS -Dydb.auth-api.version=$AUTH_API_VERSION install
69132

70-
- uses: actions/checkout@v4
133+
- name: Extract YDB JDBC Driver version
134+
working-directory: ./jdbc
135+
run: |
136+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
137+
echo "JDBC_VERSION=$VERSION" >> "$GITHUB_ENV"
138+
139+
- name: Build YDB JDBC Driver with tests
140+
working-directory: ./jdbc
141+
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION install
142+
143+
- name: Checkout YDB Java Examples
144+
uses: actions/checkout@v4
71145
with:
72146
repository: ydb-platform/ydb-java-examples
73-
ref: master
74147
path: examples
75148

76-
- name: Download dependencies
77-
working-directory: ./examples
78-
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION dependency:go-offline
79-
80149
- name: Test examples with Maven
81150
working-directory: ./examples
82-
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION test
151+
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION -Dydb.jdbc.version=$JDBC_VERSION test

query/src/main/java/tech/ydb/query/impl/QueryClientImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import tech.ydb.core.grpc.GrpcTransport;
1212
import tech.ydb.query.QueryClient;
1313
import tech.ydb.query.QuerySession;
14+
import tech.ydb.table.SessionPoolStats;
1415

1516
/**
1617
*
@@ -46,8 +47,8 @@ public void updatePoolMaxSize(int maxSize) {
4647
pool.updateMaxSize(maxSize);
4748
}
4849

49-
SessionPool getSessionPool() {
50-
return pool;
50+
public SessionPoolStats getSessionPoolStats() {
51+
return pool.getStats();
5152
}
5253

5354
@Override

query/src/main/java/tech/ydb/query/impl/SessionPool.java

+2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ public void destroy() {
250250

251251
@Override
252252
public void close() {
253+
logger.trace("QuerySession[{}] closed with broke status {}", getId(), isBroken);
254+
253255
stats.released.increment();
254256
if (isBroken || isStopped) {
255257
queue.delete(this);

query/src/main/java/tech/ydb/query/impl/TableClientImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ScheduledExecutorService getScheduler() {
4949

5050
@Override
5151
public SessionPoolStats sessionPoolStats() {
52-
return proxy.getSessionPool().getStats();
52+
return proxy.getSessionPoolStats();
5353
}
5454

5555
@Override

0 commit comments

Comments
 (0)