You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2022/02/03 17:11:22 UTC

[ignite-3] branch ignite-3.0.0-alpha4 updated: IGNITE-16427 Added indentations and fixes to codeblocks in aplha-4 docs. Fixes #615

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

sk0x50 pushed a commit to branch ignite-3.0.0-alpha4
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-3.0.0-alpha4 by this push:
     new 8edd85b  IGNITE-16427 Added indentations and fixes to codeblocks in aplha-4 docs. Fixes #615
8edd85b is described below

commit 8edd85badc78d07ca2f9853ed6f087763223f5fb
Author: IgGusev <de...@mail.ru>
AuthorDate: Thu Feb 3 20:09:10 2022 +0300

    IGNITE-16427 Added indentations and fixes to codeblocks in aplha-4 docs. Fixes #615
    
    Signed-off-by: Slava Koptilin <sl...@gmail.com>
    (cherry picked from commit e179bdcf1bbc59ea3cd098ab322dea789895e19f)
---
 docs/_docs/table-views.adoc                        | 31 ++++++++++++++++------
 .../transactions/performing-transactions.adoc      | 23 ++++++++--------
 2 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/docs/_docs/table-views.adoc b/docs/_docs/table-views.adoc
index a3f468a..1967fc7 100644
--- a/docs/_docs/table-views.adoc
+++ b/docs/_docs/table-views.adoc
@@ -26,21 +26,36 @@ See the examples below:
 +
 [source,text]
 ----
-CREATE TABLE MyTable (id INT, val INT); -> creates PUBLIC.MYTABLE
-ignite.tables().table("public.mytable"); -> returns PUBLIC.MYTABLE
-CREATE TABLE \"MyTable\" (id INT, val INT); -> creates PUBLIC.MyTable
-ignite.tables().table("public.\"MyTable\""); -> returns PUBLIC.MyTable
+// Creates PUBLIC.MYTABLE.
+CREATE TABLE MyTable (id INT, val INT);
+
+// Returns PUBLIC.MYTABLE.
+ignite.tables().table("public.mytable"); ->
+
+// Creates PUBLIC.MyTable.
+CREATE TABLE \"MyTable\" (id INT, val INT); ->
+
+// Returns PUBLIC.MyTable.
+ignite.tables().table("public.\"MyTable\""); ->
 ----
 
 * Tuples or columns:
 +
 [source,text]
 ----
-CREATE TABLE MyTable (id INT, \"Id\" INT, val INT); -> creates PUBLIC.MYTABLE (ID, Id, VAL)
+// Creates PUBLIC.MYTABLE (ID, Id, VAL).
+CREATE TABLE MyTable (id INT, \"Id\" INT, val INT);
+
 Tuple tuple = ...
-tuple.value("id") -> returns ID column's value
-tuple.value("Id") -> returns ID column's value
-tuple.value("\"Id\"") -> returns Id column's value
+
+// Returns ID column's value.
+tuple.value("id")
+
+// Returns ID column's value.
+tuple.value("Id")
+
+// Returns Id column's value.
+tuple.value("\"Id\"")
 ----
 
 ====
diff --git a/docs/_docs/transactions/performing-transactions.adoc b/docs/_docs/transactions/performing-transactions.adoc
index 2d026be..d389823 100644
--- a/docs/_docs/transactions/performing-transactions.adoc
+++ b/docs/_docs/transactions/performing-transactions.adoc
@@ -41,19 +41,20 @@ tab:Java[]
 ----
 protected Table accounts;
 protected Table customers;
+
 accounts.recordView().upsert(null, makeValue(1, BALANCE_1));
 accounts.recordView().upsert(null, makeValue(2, BALANCE_2));
 igniteTransactions.beginAsync()
-.thenCompose(tx -> accounts.recordView().getAsync(tx, makeKey(1))
-.thenCombine(accounts.recordView().getAsync(tx, makeKey(2)), (v1, v2) -> new Pair<>(v1, v2))
-.thenCompose(pair -> allOf(
-accounts.recordView().upsertAsync(
-tx, makeValue(1, pair.getFirst().doubleValue("balance") - DELTA)),
-accounts.recordView().upsertAsync(
-tx, makeValue(2, pair.getSecond().doubleValue("balance") + DELTA))
-)
-.thenApply(ignored -> tx)
-)
-).thenCompose(Transaction::commitAsync).join();
+    .thenCompose(tx -> accounts.recordView().getAsync(tx, makeKey(1))
+        .thenCombine(accounts.recordView().getAsync(tx, makeKey(2)), (v1, v2) -> new Pair<>(v1, v2))
+        .thenCompose(pair -> allOf(
+            accounts.recordView().upsertAsync(
+                tx, makeValue(1, pair.getFirst().doubleValue("balance") - DELTA)),
+            accounts.recordView().upsertAsync(
+                tx, makeValue(2, pair.getSecond().doubleValue("balance") + DELTA))
+        )
+        .thenApply(ignored -> tx)
+        )
+    ).thenCompose(Transaction::commitAsync).join();
 ----
 --
\ No newline at end of file