trait Transaction extends AutoCloseable
This trait represents a shuffle "transaction", and it is specific to a transfer (or set of transfers).
It is useful in that it groups a set of sends and receives requires in order to carry an action against a peer. It can be used to find statistics about the transfer (bytes send/received, throughput), and it also can be waited on, for blocking clients.
NOTE: a Transaction is thread safe w.r.t. a connection's callback. Calling methods on the transaction outside of waitForCompletion produces undefined behavior.
- Alphabetic
- By Inheritance
- Transaction
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
close(): Unit
- Definition Classes
- AutoCloseable
- Annotations
- @throws( classOf[java.lang.Exception] )
-
abstract
def
getErrorMessage: Option[String]
Get error messages that could have occurred during the transaction.
Get error messages that could have occurred during the transaction.
- returns
returns an optional error message
-
abstract
def
getHeader: Long
Return this transaction's header, for debug purposes
-
abstract
def
getStats: TransactionStats
Get the statistics object (bytes sent/recv, tx time, and throughput are available)
-
abstract
def
getStatus: TransactionStatus.Value
Get the status this transaction is in.
Get the status this transaction is in. Callbacks use this to handle various transaction states (e.g. success, error, etc.)
-
abstract
def
peerExecutorId(): Long
Get the peer executor id if available
Get the peer executor id if available
- Note
this can throw if the
Transactionwas not created due to an Active Message
-
abstract
def
releaseMessage(): MetadataTransportBuffer
Hands over a message (a host-side request or response at the moment) that is held in the Transaction
Hands over a message (a host-side request or response at the moment) that is held in the Transaction
- returns
a
TransportBufferinstance
- Note
The caller must call
closeon the returned message
-
abstract
def
respond(response: ByteBuffer, cb: TransactionCallback): Transaction
For
Requesttransactions,respondwill be able to reply to a peer who issued the requestFor
Requesttransactions,respondwill be able to reply to a peer who issued the request- response
a direct ByteBuffer
- cb
triggered when the response succeds/fails
- returns
a
Transactionobject that can be used to wait for this response to complete
- Note
this is only available for server-side transactions, and will throw if attempted from a client
-
abstract
def
waitForCompletion(): Unit
Block until this transaction is completed.
Block until this transaction is completed.
NOTE: not only does this include the transaction time, but it also includes the code performed in the callback. If the callback would block, you could end up in a situation of deadlock.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )