This is an automated email from the ASF dual-hosted git repository.

dspavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 32963a9774e IGNITE-29017 Document Java thin client sizeLong API 
(#13520)
32963a9774e is described below

commit 32963a9774e412d8d419fa054a3f19017a398b36
Author: ignitetcbot <[email protected]>
AuthorDate: Wed Aug 26 23:57:09 2026 +0300

    IGNITE-29017 Document Java thin client sizeLong API (#13520)
---
 .../src/main/java/org/apache/ignite/snippets/JavaThinClient.java  | 8 ++++++--
 docs/_docs/thin-clients/java-thin-client.adoc                     | 3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java
 
b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java
index d6eade88077..d92726554ba 100644
--- 
a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java
+++ 
b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java
@@ -190,11 +190,12 @@ public class JavaThinClient {
         cache.put(101, "101");
 
         cache.removeAll(data.keySet());
-        assert cache.size() == 1;
+        long cacheSize = cache.sizeLong();
+        assert cacheSize == 1;
         assert "101".equals(cache.get(101));
 
         cache.removeAll();
-        assert 0 == cache.size();
+        assert cache.sizeLong() == 0;
         // end::key-value-operations[]
         System.out.println("done");
     }
@@ -495,6 +496,9 @@ public class JavaThinClient {
 
         IgniteClientFuture<String> getFut = cache.getAsync(1);
         getFut.thenAccept(val -> System.out.println(val)); // Non-blocking 
continuation.
+
+        IgniteClientFuture<Long> sizeFut = cache.sizeLongAsync();
+        sizeFut.thenAccept(size -> System.out.println("Cache size: " + size));
         //end::async-api[]
     }
 
diff --git a/docs/_docs/thin-clients/java-thin-client.adoc 
b/docs/_docs/thin-clients/java-thin-client.adoc
index 40776e91377..0474cfac16f 100644
--- a/docs/_docs/thin-clients/java-thin-client.adoc
+++ b/docs/_docs/thin-clients/java-thin-client.adoc
@@ -180,6 +180,8 @@ include::{sourceCodeFile}[tag=getOrCreateCache,indent=0]
 === Basic Cache Operations
 
 The following code snippet demonstrates how to execute basic cache operations 
from the thin client.
+Use `ClientCache.sizeLong(...)` to get the cache size as a `long`.
+The older `ClientCache.size(...)` method returns `int` and is deprecated.
 
 [source, java]
 -------------------------------------------------------------------------------
@@ -446,6 +448,7 @@ 
include::{sourceCodeFile}[tag=client-authentication,indent=0]
 == Async APIs
 
 Most network-bound thin client APIs have an async counterpart, for example, 
`ClientCache.get` and `ClientCache.getAsync`.
+For cache size operations, prefer `ClientCache.sizeLongAsync(...)`; the older 
`ClientCache.sizeAsync(...)` method returns `IgniteClientFuture<Integer>` and 
is deprecated.
 
 [source, java]
 -------------------------------------------------------------------------------

Reply via email to