Skip to content

Commit 0562ced

Browse files
authored
Merge pull request #67 from alex268/master
Upgrade to SDK v2.4 and small fixes
2 parents d20a616 + db293ce commit 0562ced

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

jdbc/spring-flyway-app/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<properties>
1414
<maven.compiler.release>17</maven.compiler.release>
1515
<kotlin.version>1.9.22</kotlin.version>
16-
<hibernate.ydb.dialect.version>0.9.2</hibernate.ydb.dialect.version>
16+
<hibernate.ydb.dialect.version>1.5.2</hibernate.ydb.dialect.version>
1717
<spring.boot.version>3.2.1</spring.boot.version>
18-
<flyway.ydb.dialect.version>1.0.0-RC0</flyway.ydb.dialect.version>
19-
<flyway.core.version>10.7.1</flyway.core.version>
18+
<flyway.ydb.dialect.version>1.0.0</flyway.ydb.dialect.version>
19+
<flyway.core.version>11.20.3</flyway.core.version>
2020
</properties>
2121
<dependencies>
2222
<dependency>
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>org.flywaydb</groupId>
5858
<artifactId>flyway-core</artifactId>
59-
<version>10.7.1</version>
59+
<version>${flyway.core.version}</version>
6060
</dependency>
6161

6262
<dependency>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<log4j.version>2.22.1</log4j.version>
1919
<jcommander.version>1.82</jcommander.version>
2020

21-
<ydb.sdk.version>2.3.18</ydb.sdk.version>
21+
<ydb.sdk.version>2.4.6</ydb.sdk.version>
2222
</properties>
2323

2424
<modules>

ydb-cookbook/src/main/java/tech/ydb/examples/simple/Scheme.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ protected void run(GrpcTransport transport, String pathPrefix) {
3535
.getValue();
3636

3737
System.out.println("--[self]---------------------------");
38-
System.out.println(result1.getSelf());
38+
System.out.println(result1.getEntry());
3939
System.out.println("-----------------------------------");
4040

4141
ListDirectoryResult result2 = schemeClient.listDirectory(directoryPath)
4242
.join()
4343
.getValue();
4444

4545
System.out.println("--[self]---------------------------");
46-
System.out.println(result2.getSelf());
46+
System.out.println(result2.getEntry());
4747
System.out.println("--[children]-----------------------");
48-
System.out.println(result2.getChildren());
48+
System.out.println(result2.getEntryChildren());
4949
System.out.println("-----------------------------------");
5050

5151
for (int i = 0; i < 3; i++) {

ydb-cookbook/src/main/java/tech/ydb/examples/topic/ControlPlane.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected void run(GrpcTransport transport) {
5252
.build())
5353
.setPartitioningSettings(PartitioningSettings.newBuilder()
5454
.setMinActivePartitions(4)
55-
.setPartitionCountLimit(10)
55+
.setMaxActivePartitions(10)
5656
.build())
5757
.setPartitionWriteSpeedBytesPerSecond(2 * 1024 * 1024) // 2 MB
5858
.setPartitionWriteBurstBytes(4 * 1024 * 1024) // 4 MB
@@ -76,8 +76,7 @@ protected void run(GrpcTransport transport) {
7676
TopicDescription description = describeTopic(TOPIC_NAME, topicClient);
7777

7878
assert description.getPartitioningSettings().getMinActivePartitions() == 4;
79-
// getPartitionCountLimit is temporally ignored by server
80-
assert description.getPartitioningSettings().getPartitionCountLimit() == 0;
79+
assert description.getPartitioningSettings().getMaxActivePartitions() == 10;
8180
assert description.getPartitionWriteSpeedBytesPerSecond() == 2 * 1024 * 1024;
8281
assert description.getPartitionWriteBurstBytes() == 4 * 1024 * 1024;
8382
assert description.getConsumers().size() == 2;
@@ -94,6 +93,7 @@ protected void run(GrpcTransport transport) {
9493
.build())
9594
.setAlterPartitioningSettings(AlterPartitioningSettings.newBuilder()
9695
.setMinActivePartitions(6)
96+
.setMaxActivePartitions(6)
9797
.build())
9898
.setPartitionWriteSpeedBytesPerSecond(4 * 1024 * 1024)
9999
.build())
@@ -106,8 +106,7 @@ protected void run(GrpcTransport transport) {
106106
TopicDescription description = describeTopic(TOPIC_NAME, topicClient);
107107

108108
assert description.getPartitioningSettings().getMinActivePartitions() == 6;
109-
// getPartitionCountLimit is temporally ignored by server
110-
assert description.getPartitioningSettings().getPartitionCountLimit() == 0;
109+
assert description.getPartitioningSettings().getMaxActivePartitions() == 6;
111110
assert description.getPartitionWriteSpeedBytesPerSecond() == 4 * 1024 * 1024;
112111
assert description.getPartitionWriteBurstBytes() == 4 * 1024 * 1024;
113112
assert description.getConsumers().size() == 2;
@@ -123,7 +122,7 @@ protected void run(GrpcTransport transport) {
123122

124123
topicClient.alterTopic(TOPIC_NAME, AlterTopicSettings.newBuilder()
125124
.setAlterPartitioningSettings(AlterPartitioningSettings.newBuilder()
126-
.setPartitionCountLimit(8)
125+
.setMaxActivePartitions(8)
127126
.build())
128127
.setRetentionPeriod(Duration.ofHours(13))
129128
.setRetentionStorageMb(512)
@@ -159,8 +158,7 @@ protected void run(GrpcTransport transport) {
159158
TopicDescription description = describeTopic(TOPIC_NAME, topicClient);
160159

161160
assert description.getPartitioningSettings().getMinActivePartitions() == 6;
162-
// getPartitionCountLimit is temporally ignored by server
163-
assert description.getPartitioningSettings().getPartitionCountLimit() == 0;
161+
assert description.getPartitioningSettings().getMaxActivePartitions() == 8;
164162
assert Objects.equals(description.getRetentionPeriod(), Duration.ofHours(13));
165163
assert description.getRetentionStorageMb() == 512;
166164
assert description.getPartitionWriteSpeedBytesPerSecond() == 4 * 1024 * 1024;
@@ -216,7 +214,7 @@ public TopicDescription describeTopic(String topicPath, TopicClient topicClient)
216214
.append(" ActivePartitions: ").append(description.getPartitioningSettings().getMinActivePartitions())
217215
.append("\n")
218216
.append(" PartitionCountLimit: ").append(description.getPartitioningSettings()
219-
.getPartitionCountLimit()).append("\n")
217+
.getMaxActivePartitions()).append("\n")
220218
.append("getPartitionWriteSpeedBytesPerSecond: ")
221219
.append(description.getPartitionWriteSpeedBytesPerSecond()).append("\n")
222220
.append("getPartitionWriteBurstBytes: ").append(description.getPartitionWriteBurstBytes())

ydb-cookbook/src/main/java/tech/ydb/examples/topic/transactions/TransactionReadAsync.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
9+
910
import tech.ydb.common.transaction.TxMode;
1011
import tech.ydb.core.Result;
1112
import tech.ydb.core.Status;
@@ -20,8 +21,8 @@
2021
import tech.ydb.topic.read.AsyncReader;
2122
import tech.ydb.topic.read.Message;
2223
import tech.ydb.topic.read.PartitionSession;
23-
import tech.ydb.topic.read.events.DataReceivedEvent;
2424
import tech.ydb.topic.read.events.AbstractReadEventHandler;
25+
import tech.ydb.topic.read.events.DataReceivedEvent;
2526
import tech.ydb.topic.read.events.PartitionSessionClosedEvent;
2627
import tech.ydb.topic.read.events.ReaderClosedEvent;
2728
import tech.ydb.topic.read.events.StartPartitionSessionEvent;
@@ -80,6 +81,7 @@ public void onMessages(DataReceivedEvent event) {
8081
.join().getValue();
8182

8283
// Update offsets in transaction
84+
@SuppressWarnings("deprecation")
8385
Status updateStatus = reader.updateOffsetsInTransaction(transaction, message.getPartitionOffsets(),
8486
new UpdateOffsetsInTransactionSettings.Builder().build())
8587
// Do not commit transaction without waiting for updateOffsetsInTransaction result

0 commit comments

Comments
 (0)