public final class SparkTransactionClient extends Object
SparkTransactionHandler
through HTTP. It is used by tasks executed inside
executor processes.Constructor and Description |
---|
SparkTransactionClient(URI txServiceBaseURI) |
SparkTransactionClient(URI txServiceBaseURI,
long txPollIntervalMillis) |
Modifier and Type | Method and Description |
---|---|
org.apache.tephra.Transaction |
getTransaction(int stageId,
long timeout,
TimeUnit timeUnit)
Returns the
Transaction for the given stage. |
public SparkTransactionClient(URI txServiceBaseURI)
public SparkTransactionClient(URI txServiceBaseURI, long txPollIntervalMillis)
public org.apache.tephra.Transaction getTransaction(int stageId, long timeout, TimeUnit timeUnit) throws TimeoutException, InterruptedException, org.apache.tephra.TransactionFailureException
Transaction
for the given stage.stageId
- the stage id to query for Transaction
.timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentTransaction
to be used for the given stage.TimeoutException
- if the wait timed outInterruptedException
- if the current thread was interrupted while waitingorg.apache.tephra.TransactionFailureException
- if failed to get transaction for the given stage. Calling this method again
with the same stage id will result in the same exceptionCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.