public final class Transactions extends Object
Transaction and TransactionSystemClient.| Modifier and Type | Method and Description |
|---|---|
static void |
abortQuietly(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.Transaction tx) |
static com.google.common.base.Supplier<co.cask.tephra.TransactionContext> |
constantContextSupplier(co.cask.tephra.TransactionSystemClient txClient,
Iterable<? extends co.cask.tephra.TransactionAware> txAwares) |
static com.google.common.base.Supplier<co.cask.tephra.TransactionContext> |
constantContextSupplier(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.TransactionAware txAware) |
static co.cask.tephra.TransactionExecutor |
createTransactionExecutor(co.cask.tephra.TransactionExecutorFactory factory,
Iterable<? extends co.cask.tephra.TransactionAware> txAwares)
Handy method to create
TransactionExecutor (See TEPHRA-71). |
static co.cask.tephra.TransactionExecutor |
createTransactionExecutor(co.cask.tephra.TransactionExecutorFactory factory,
co.cask.tephra.TransactionAware txAware) |
static co.cask.tephra.TransactionExecutor |
createTransactionExecutor(TransactionExecutorFactory factory,
co.cask.tephra.TransactionSystemClient txClient,
Iterable<? extends co.cask.tephra.TransactionAware> txAwares)
Handy method to create
TransactionExecutor (See TEPHRA-71). |
static co.cask.tephra.TransactionExecutor |
createTransactionExecutor(TransactionExecutorFactory factory,
co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.TransactionAware txAware)
Handy method to create
TransactionExecutor with single TransactionAware. |
static <V> V |
execute(co.cask.tephra.TransactionContext txContext,
String name,
Callable<V> callable)
Executes the given
Callable in a short transaction using the given TransactionContext. |
static void |
execute(co.cask.tephra.TransactionContext txContext,
String name,
Runnable runnable)
Executes the given
Runnable in a short transaction using the given TransactionContext. |
static void |
invalidateQuietly(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.Transaction tx) |
public static void abortQuietly(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.Transaction tx)
public static void invalidateQuietly(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.Transaction tx)
public static com.google.common.base.Supplier<co.cask.tephra.TransactionContext> constantContextSupplier(co.cask.tephra.TransactionSystemClient txClient,
co.cask.tephra.TransactionAware txAware)
public static com.google.common.base.Supplier<co.cask.tephra.TransactionContext> constantContextSupplier(co.cask.tephra.TransactionSystemClient txClient,
Iterable<? extends co.cask.tephra.TransactionAware> txAwares)
public static co.cask.tephra.TransactionExecutor createTransactionExecutor(TransactionExecutorFactory factory, co.cask.tephra.TransactionSystemClient txClient, Iterable<? extends co.cask.tephra.TransactionAware> txAwares)
TransactionExecutor (See TEPHRA-71).public static co.cask.tephra.TransactionExecutor createTransactionExecutor(TransactionExecutorFactory factory, co.cask.tephra.TransactionSystemClient txClient, co.cask.tephra.TransactionAware txAware)
TransactionExecutor with single TransactionAware.public static co.cask.tephra.TransactionExecutor createTransactionExecutor(co.cask.tephra.TransactionExecutorFactory factory,
Iterable<? extends co.cask.tephra.TransactionAware> txAwares)
TransactionExecutor (See TEPHRA-71).public static co.cask.tephra.TransactionExecutor createTransactionExecutor(co.cask.tephra.TransactionExecutorFactory factory,
co.cask.tephra.TransactionAware txAware)
public static void execute(co.cask.tephra.TransactionContext txContext,
String name,
Runnable runnable)
throws co.cask.tephra.TransactionFailureException
Runnable in a short transaction using the given TransactionContext.txContext - the TransactionContext for managing the transaction lifecyclename - descriptive name for the runnablerunnable - the Runnable to be executed inside a transactionco.cask.tephra.TransactionFailureException - if failed to execute in a transaction. The cause of the exception carries the
reason of failure.public static <V> V execute(co.cask.tephra.TransactionContext txContext,
String name,
Callable<V> callable)
throws co.cask.tephra.TransactionFailureException
Callable in a short transaction using the given TransactionContext.txContext - the TransactionContext for managing the transaction lifecyclename - descriptive name for the runnablecallable - the Callable to be executed inside a transactionCallable.call()co.cask.tephra.TransactionFailureException - if failed to execute in a transaction. The cause of the exception carries the
reason of failure.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.