Skip to content

Commit d0bdeea

Browse files
alex268blinkov
andauthored
Docs/java example update (#7704)
Co-authored-by: Ivan Blinkov <ivan@ydb.tech>
1 parent b23ee92 commit d0bdeea

File tree

11 files changed

+160
-239
lines changed

11 files changed

+160
-239
lines changed

ydb/docs/en/core/dev/example-app/_includes/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ A test app performs the following steps:
4040

4141
{% if oss %}[C++](../example-cpp.md#param-queries) | {% endif %} [C# (.NET)](../example-dotnet.md#param-queries) | [Go](../go/index.md#param-queries) | [Java](../java/index.md#param-queries) | Node.js | [PHP](../example-php.md#param-queries) | [Python](../python/index.md#param-queries)
4242

43-
{% include [scan_query.md](steps/08_scan_query.md) %}
44-
45-
{% if oss %}C++ | {% endif %} [C# (.NET)](../example-dotnet.md#scan-query) | [Go](../go/index.md#scan-query) | [Java](../java/index.md#scan-query) | [Node.js](../example-nodejs.md#scan-query) | PHP | [Python](../python/index.md#scan-query)
46-
4743
{% include [multistep_transactions.md](steps/09_multistep_transactions.md) %}
4844

4945
{% if oss %}[C++](../example-cpp.md#multistep-transactions) | {% endif %} C# (.NET) | Go | [Java](../java/index.md#multistep-transactions) | Node.js | PHP | Python
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Streaming reading {#async-requests}

ydb/docs/en/core/dev/example-app/java/_includes/run_custom.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ If authentication is enabled in the database, you also need to select the [authe
55
Run the command as follows:
66

77
```bash
8-
( cd ydb-java-examples/basic_example/target && \
9-
<auth_mode_var>="<auth_mode_value>" java -jar ydb-basic-example.jar <endpoint>?database=<database>)
8+
<auth_mode_var>="<auth_mode_value>" java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpcs://<endpoint>:<port>/<database>
109
```
1110

1211
where
@@ -19,6 +18,5 @@ where
1918
For example:
2019

2120
```bash
22-
( cd ydb-java-examples/basic_example/target && \
23-
YDB_ACCESS_TOKEN_CREDENTIALS="t1.9euelZqOnJuJlc..." java -jar ydb-basic-example.jar grpcs://ydb.example.com:2135?database=/somepath/somelocation)
21+
YDB_ACCESS_TOKEN_CREDENTIALS="..." java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpcs://ydb.example.com:2135/somepath/somelocation
2422
```
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
To connect to a locally deployed {{ ydb-short-name }} database according to the [Docker](../../../../quickstart.md) use case, run the following command in the default configuration:
22

33
```bash
4-
(cd ydb-java-examples/basic_example/target && \
5-
YDB_ANONYMOUS_CREDENTIALS=1 java -jar ydb-basic-example.jar grpc://localhost:2136?database=/local )
4+
YDB_ANONYMOUS_CREDENTIALS=1 java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpc://localhost:2136/local
65
```

ydb/docs/en/core/dev/example-app/java/index.md

Lines changed: 75 additions & 110 deletions
Large diffs are not rendered by default.

ydb/docs/en/core/recipes/ydb-sdk/retry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ Below are code examples showing the {{ ydb-short-name }} SDK built-in tools for
249249

250250
- Java
251251

252-
In the {{ ydb-short-name }} Java SDK, repeat queries are implemented by the `com.yandex.ydb.table.SessionRetryContext` helper class. This class is constructed with the `SessionRetryContext.create` method to which you pass the `SessionSupplier` interface implementation (usually an instance of the `TableClient` class).
252+
In the {{ ydb-short-name }} Java SDK, repeat queries are implemented by the `SessionRetryContext` helper class. This class is constructed with the `SessionRetryContext.create` method to which you pass the `SessionSupplier` interface implementation (usually an instance of the `TableClient` class or the `QueryClient` class).
253253
Additionally, the user can specify some other options
254254
* `maxRetries(int maxRetries)`: The maximum number of operation retries, not counting the first execution. Default value: `10`
255255
* `retryNotFound(boolean retryNotFound)`: The option to retry operations that returned the `NOT_FOUND` status. Enabled by default.
256-
* `idempotent(boolean idempotent)`: Indicates idempotency of operations. Idempotent operations will be retried for a broader range of errors. Disabled by default.
256+
* `idempotent(boolean idempotent)`: Indicates idempotence of operations. Idempotent operations will be retried for a broader range of errors. Disabled by default.
257257

258258
The `SessionRetryContext` class provides two methods to run operations with retries.
259259
* `CompletableFuture<Status> supplyStatus`: Executing the operation that returns the status. As an argument, it accepts the lambda `Function<Session, CompletableFuture<Status>> fn`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Асинхронное чтение {#async-requests}

ydb/docs/ru/core/dev/example-app/java/_includes/run_custom.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
Выполните команду по следующему образцу:
66

77
```bash
8-
( cd ydb-java-examples/basic_example/target && \
9-
<auth_mode_var>="<auth_mode_value>" java -jar ydb-basic-example.jar <endpoint>?database=<database>)
8+
<auth_mode_var>="<auth_mode_value>" java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpcs://<endpoint>:<port>/<database>
109
```
1110

1211
, где
@@ -19,6 +18,5 @@
1918
Например:
2019

2120
```bash
22-
( cd ydb-java-examples/basic_example/target && \
23-
YDB_ACCESS_TOKEN_CREDENTIALS="t1.9euelZqOnJuJlc..." java -jar ydb-basic-example.jar grpcs://ydb.example.com:2135?database=/somepath/somelocation)
24-
```
21+
YDB_ACCESS_TOKEN_CREDENTIALS="..." java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpcs://ydb.example.com:2135/somepath/somelocation
22+
```
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Для соединения с развернутой локальной базой данных YDB по сценарию [Docker](../../../../quickstart.md) в конфигурации по умолчанию выполните следующую команду:
22

33
```bash
4-
(cd ydb-java-examples/basic_example/target && \
5-
YDB_ANONYMOUS_CREDENTIALS=1 java -jar ydb-basic-example.jar grpc://localhost:2136?database=/local )
4+
YDB_ANONYMOUS_CREDENTIALS=1 java -jar ydb-java-examples/query-example/target/ydb-query-example.jar grpc://localhost:2136/local
65
```

0 commit comments

Comments
 (0)