public class PrepareTransactionMessage extends Message<PrepareTransactionMessage.Response,TransactionPrepareFailedException>
PrepareTransactionMessage
represents a transaction request to
a store.Modifier and Type | Class and Description |
---|---|
static class |
PrepareTransactionMessage.Response |
Message.MessageType, Message.NoException
Modifier and Type | Field and Description |
---|---|
java.util.Collection<Object._Impl> |
creates
The objects created during the transaction, unserialized.
|
boolean |
readOnly
A flag to indicate whether the transaction is read-only.
|
LongKeyMap<java.lang.Integer> |
reads |
java.util.Collection<SerializedObject> |
serializedCreates
The objects created during the transaction, serialized.
|
java.util.Collection<SerializedObject> |
serializedWrites
The objects modified during the transaction, serialized.
|
boolean |
singleStore
A flag to indicate whether objects from just a single (persistent) store
are involved in this transaction.
|
long |
tid |
java.util.Collection<Object._Impl> |
writes
The objects modified during the transaction, unserialized.
|
exceptionClass, messageType
Modifier | Constructor and Description |
---|---|
protected |
PrepareTransactionMessage(java.io.DataInput in) |
|
PrepareTransactionMessage(long tid)
Used to prepare transactions at remote workers.
|
|
PrepareTransactionMessage(long tid,
boolean singleStore,
boolean readOnly,
java.util.Collection<Object._Impl> toCreate,
LongKeyMap<java.lang.Integer> reads,
java.util.Collection<Object._Impl> writes)
Only used by the worker.
|
Modifier and Type | Method and Description |
---|---|
PrepareTransactionMessage.Response |
dispatch(RemoteIdentity<RemoteWorker> client,
MessageHandler h)
Visitor method.
|
protected PrepareTransactionMessage.Response |
readResponse(java.io.DataInput in)
Creates a Response message of the appropriate type using the provided
DataOutput |
protected void |
writeMessage(java.io.DataOutput out)
Writes this message out on the given output stream.
|
protected void |
writeResponse(java.io.DataOutput out,
PrepareTransactionMessage.Response r)
Writes a Response message of the appropriate type using the provided
DataOutput . |
readObject, readRef, receive, respond, respond, send, writeObject, writeRef
public final long tid
public final boolean singleStore
public final boolean readOnly
public final LongKeyMap<java.lang.Integer> reads
public final java.util.Collection<Object._Impl> creates
serializedCreates
field instead.public final java.util.Collection<SerializedObject> serializedCreates
creates
field
instead.public final java.util.Collection<Object._Impl> writes
serializedWrites
field instead.public final java.util.Collection<SerializedObject> serializedWrites
writes
field
instead.public PrepareTransactionMessage(long tid)
public PrepareTransactionMessage(long tid, boolean singleStore, boolean readOnly, java.util.Collection<Object._Impl> toCreate, LongKeyMap<java.lang.Integer> reads, java.util.Collection<Object._Impl> writes)
protected PrepareTransactionMessage(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public PrepareTransactionMessage.Response dispatch(RemoteIdentity<RemoteWorker> client, MessageHandler h) throws TransactionPrepareFailedException
Message
dispatch
in class Message<PrepareTransactionMessage.Response,TransactionPrepareFailedException>
client
- the node that is issuing the request.h
- the handler to which this message is to be dispatched.TransactionPrepareFailedException
protected void writeMessage(java.io.DataOutput out) throws java.io.IOException
Message
writeMessage
in class Message<PrepareTransactionMessage.Response,TransactionPrepareFailedException>
java.io.IOException
- if the DataOutput
fails.protected void writeResponse(java.io.DataOutput out, PrepareTransactionMessage.Response r) throws java.io.IOException
Message
DataOutput
.writeResponse
in class Message<PrepareTransactionMessage.Response,TransactionPrepareFailedException>
java.io.IOException
- if the DataOutput
fails.protected PrepareTransactionMessage.Response readResponse(java.io.DataInput in) throws java.io.IOException
Message
DataOutput
readResponse
in class Message<PrepareTransactionMessage.Response,TransactionPrepareFailedException>
java.io.IOException
- if the response is malformed, or if the DataInput
fails.