[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Scherbakov updated IGNITE-15086: --- Epic Link: IGNITE-15081 > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > Fix For: 3.0.0-alpha3 > > Time Spent: 1.5h > Remaining Estimate: 0h > > Design a public tx API. > The proposed design includes async and sync APIs to execute a transaction. > The transaction facade looks like this: > {code:java} > /** > * Ignite Transactions facade. > */ > public interface IgniteTransactions { > /** > * Begins the transaction. > * > * @return The future. > */ > CompletableFuture beginAsync(); > /** > * Synchronously executes a closure within a transaction. > * > * If the closure is executed normally (no exceptions), the transaction > is automatically committed. > * > * @param clo The closure. > */ > void runInTransaction(Consumer clo); > } > {code} > Transacton interface: > {code:java} > /** > * The transaction. > */ > public interface Transaction { > /** > * Synchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void commit(); > /** > * Asynchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture commitAsync(); > /** > * Synchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void rollback(); > /** > * Asynchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture rollbackAsync(); > } > {code} > Example of synchronous transaction: > {code:java} > igniteTransactions.runInTransaction(tx -> { > Table txTable = table.withTransaction(tx); // table view enlisted > in the transaction. > txTable.upsertAsync(...); > tx.commit(); > }); > {code} > Example of asynchronous transaction: > {code:java} > igniteTransactions.beginAsync() > .thenApply(tx -> accounts.withTransaction(tx)) > .thenCompose(txTbl -> txTbl.upsertAsync(...).thenApply(i -> > txTbl.transaction())) > .thenCompose(Transaction::commitAsync); > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vyacheslav Koptilin updated IGNITE-15086: - Description: Design a public tx API. The proposed design includes async and sync APIs to execute a transaction. The transaction facade looks like this: {code:java} /** * Ignite Transactions facade. */ public interface IgniteTransactions { /** * Begins the transaction. * * @return The future. */ CompletableFuture beginAsync(); /** * Synchronously executes a closure within a transaction. * * If the closure is executed normally (no exceptions), the transaction is automatically committed. * * @param clo The closure. */ void runInTransaction(Consumer clo); } {code} Transacton interface: {code:java} /** * The transaction. */ public interface Transaction { /** * Synchronously commits a transaction. * Does nothing if it's already finished by committing or rolling back. */ void commit(); /** * Asynchronously commits a transaction. * Does nothing if it's already finished by committing or rolling back. * * @return The future. */ CompletableFuture commitAsync(); /** * Synchronously rolls back a transaction. * Does nothing if it's already finished by committing or rolling back. */ void rollback(); /** * Asynchronously rolls back a transaction. * Does nothing if it's already finished by committing or rolling back. * * @return The future. */ CompletableFuture rollbackAsync(); } {code} Example of synchronous transaction: {code:java} igniteTransactions.runInTransaction(tx -> { Table txTable = table.withTransaction(tx); // table view enlisted in the transaction. txTable.upsertAsync(...); tx.commit(); }); {code} Example of asynchronous transaction: {code:java} igniteTransactions.beginAsync() .thenApply(tx -> accounts.withTransaction(tx)) .thenCompose(txTbl -> txTbl.upsertAsync(...).thenApply(i -> txTbl.transaction())) .thenCompose(Transaction::commitAsync); {code} was: Design a public tx API. The proposed design includes async and sync APIs to execute a transaction. The transaction facade looks like this: {code} /** * Ignite Transactions facade. */ public interface IgniteTransactions { /** * Begins the transaction. * * @return The future. */ CompletableFuture beginAsync(); /** * Synchronously executes a closure within a transaction. * * If the closure is executed normally (no exceptions), the transaction is automatically committed. * * @param clo The closure. */ void runInTransaction(Consumer clo); } {code} > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > Time Spent: 1h 20m > Remaining Estimate: 0h > > Design a public tx API. > The proposed design includes async and sync APIs to execute a transaction. > The transaction facade looks like this: > {code:java} > /** > * Ignite Transactions facade. > */ > public interface IgniteTransactions { > /** > * Begins the transaction. > * > * @return The future. > */ > CompletableFuture beginAsync(); > /** > * Synchronously executes a closure within a transaction. > * > * If the closure is executed normally (no exceptions), the transaction > is automatically committed. > * > * @param clo The closure. > */ > void runInTransaction(Consumer clo); > } > {code} > Transacton interface: > {code:java} > /** > * The transaction. > */ > public interface Transaction { > /** > * Synchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void commit(); > /** > * Asynchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture commitAsync(); > /** > * Synchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void rollback(); > /** > * Asynchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture rollbackAsync(); > } > {code} > Example of synchronous transaction: > {code:java} > igniteTr
[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vyacheslav Koptilin updated IGNITE-15086: - Fix Version/s: 3.0.0-alpha3 > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > Fix For: 3.0.0-alpha3 > > Time Spent: 1h 20m > Remaining Estimate: 0h > > Design a public tx API. > The proposed design includes async and sync APIs to execute a transaction. > The transaction facade looks like this: > {code:java} > /** > * Ignite Transactions facade. > */ > public interface IgniteTransactions { > /** > * Begins the transaction. > * > * @return The future. > */ > CompletableFuture beginAsync(); > /** > * Synchronously executes a closure within a transaction. > * > * If the closure is executed normally (no exceptions), the transaction > is automatically committed. > * > * @param clo The closure. > */ > void runInTransaction(Consumer clo); > } > {code} > Transacton interface: > {code:java} > /** > * The transaction. > */ > public interface Transaction { > /** > * Synchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void commit(); > /** > * Asynchronously commits a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture commitAsync(); > /** > * Synchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > */ > void rollback(); > /** > * Asynchronously rolls back a transaction. > * Does nothing if it's already finished by committing or rolling back. > * > * @return The future. > */ > CompletableFuture rollbackAsync(); > } > {code} > Example of synchronous transaction: > {code:java} > igniteTransactions.runInTransaction(tx -> { > Table txTable = table.withTransaction(tx); // table view enlisted > in the transaction. > txTable.upsertAsync(...); > tx.commit(); > }); > {code} > Example of asynchronous transaction: > {code:java} > igniteTransactions.beginAsync() > .thenApply(tx -> accounts.withTransaction(tx)) > .thenCompose(txTbl -> txTbl.upsertAsync(...).thenApply(i -> > txTbl.transaction())) > .thenCompose(Transaction::commitAsync); > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vyacheslav Koptilin updated IGNITE-15086: - Description: Design a public tx API. The proposed design includes async and sync APIs to execute a transaction. The transaction facade looks like this: {code} /** * Ignite Transactions facade. */ public interface IgniteTransactions { /** * Begins the transaction. * * @return The future. */ CompletableFuture beginAsync(); /** * Synchronously executes a closure within a transaction. * * If the closure is executed normally (no exceptions), the transaction is automatically committed. * * @param clo The closure. */ void runInTransaction(Consumer clo); } {code} was: Design a public tx API. The proposed design includes async and sync APIs to execute a transaction. The transaction facade looks like this: {code} /** * Ignite Transactions facade. */ public interface IgniteTransactions { /** * Begins the transaction. * * @return The future. */ CompletableFuture beginAsync(); /** * Synchronously executes a closure within a transaction. * * @param clo The closure. */ void runInTransaction(Consumer clo); } {code} > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > Time Spent: 1h 20m > Remaining Estimate: 0h > > Design a public tx API. > The proposed design includes async and sync APIs to execute a transaction. > The transaction facade looks like this: > {code} > /** > * Ignite Transactions facade. > */ > public interface IgniteTransactions { > /** > * Begins the transaction. > * > * @return The future. > */ > CompletableFuture beginAsync(); > /** > * Synchronously executes a closure within a transaction. > * > * If the closure is executed normally (no exceptions), the transaction > is automatically committed. > * > * @param clo The closure. > */ > void runInTransaction(Consumer clo); > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Scherbakov updated IGNITE-15086: --- Description: Design a public tx API. The proposed design includes async and sync APIs to execute a transaction. The transaction facade looks like this: {code} /** * Ignite Transactions facade. */ public interface IgniteTransactions { /** * Begins the transaction. * * @return The future. */ CompletableFuture beginAsync(); /** * Synchronously executes a closure within a transaction. * * @param clo The closure. */ void runInTransaction(Consumer clo); } {code} was:Design a public tx API. > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > Time Spent: 10m > Remaining Estimate: 0h > > Design a public tx API. > The proposed design includes async and sync APIs to execute a transaction. > The transaction facade looks like this: > {code} > /** > * Ignite Transactions facade. > */ > public interface IgniteTransactions { > /** > * Begins the transaction. > * > * @return The future. > */ > CompletableFuture beginAsync(); > /** > * Synchronously executes a closure within a transaction. > * > * @param clo The closure. > */ > void runInTransaction(Consumer clo); > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (IGNITE-15086) Design a public tx API
[ https://issues.apache.org/jira/browse/IGNITE-15086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Scherbakov updated IGNITE-15086: --- Description: Design a public tx API. (was: Design a public tx API. Goals: * Asynchronous * Not attached to any thread) > Design a public tx API > -- > > Key: IGNITE-15086 > URL: https://issues.apache.org/jira/browse/IGNITE-15086 > Project: Ignite > Issue Type: Task >Reporter: Alexey Scherbakov >Assignee: Alexey Scherbakov >Priority: Major > Labels: iep-61, ignite-3 > > Design a public tx API. -- This message was sent by Atlassian Jira (v8.3.4#803005)