fabric.messages
Class UnauthenticatedPrepareTransactionMessage

java.lang.Object
  extended by fabric.messages.Message<RemoteStore,UnauthenticatedPrepareTransactionMessage.Response>
      extended by fabric.messages.UnauthenticatedPrepareTransactionMessage

public class UnauthenticatedPrepareTransactionMessage
extends Message<RemoteStore,UnauthenticatedPrepareTransactionMessage.Response>

A PrepareTransactionMessage represents a transaction request to a store.


Nested Class Summary
static class UnauthenticatedPrepareTransactionMessage.Response
           
 
Nested classes/interfaces inherited from class fabric.messages.Message
Message.MessageType
 
Field Summary
 long commitTime
           
 java.util.Collection<Object._Impl> creates
          The objects created during the transaction, unserialized.
 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.
 long tid
           
 java.util.Collection<Object._Impl> writes
          The objects modified during the transaction, unserialized.
 
Fields inherited from class fabric.messages.Message
messageType
 
Constructor Summary
protected UnauthenticatedPrepareTransactionMessage(java.io.DataInput in)
          Deserialization constructor.
  UnauthenticatedPrepareTransactionMessage(long tid, long commitTime)
          Used to prepare transactions at remote workers.
  UnauthenticatedPrepareTransactionMessage(long tid, long commitTime, java.util.Collection<Object._Impl> toCreate, LongKeyMap<java.lang.Integer> reads, java.util.Collection<Object._Impl> writes)
          Only used by the worker.
 
Method Summary
 UnauthenticatedPrepareTransactionMessage.Response dispatch(MessageHandlerThread w)
          Calls the appropriate handle(...) method on the handler.
 UnauthenticatedPrepareTransactionMessage.Response response(RemoteStore node, java.io.DataInput in)
          Creates a Response message of the appropriate type using the provided input stream.
 UnauthenticatedPrepareTransactionMessage.Response send(RemoteStore store)
           
 void write(java.io.DataOutput out)
          Writes this message out on the given output stream.
 
Methods inherited from class fabric.messages.Message
dispatch, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tid

public final long tid

commitTime

public final long commitTime

reads

public final LongKeyMap<java.lang.Integer> reads

creates

public final java.util.Collection<Object._Impl> creates
The objects created during the transaction, unserialized. This will only be non-null on the worker. The store should use the serializedCreates field instead.


serializedCreates

public final java.util.Collection<SerializedObject> serializedCreates
The objects created during the transaction, serialized. This will only be non-null on the store. The worker should use the creates field instead.


writes

public final java.util.Collection<Object._Impl> writes
The objects modified during the transaction, unserialized. This will only be non-null on the worker. The store should use the serializedWrites field instead.


serializedWrites

public final java.util.Collection<SerializedObject> serializedWrites
The objects modified during the transaction, serialized. This will only be non-null on the store. The worker should use the writes field instead.

Constructor Detail

UnauthenticatedPrepareTransactionMessage

public UnauthenticatedPrepareTransactionMessage(long tid,
                                                long commitTime)
Used to prepare transactions at remote workers.


UnauthenticatedPrepareTransactionMessage

public UnauthenticatedPrepareTransactionMessage(long tid,
                                                long commitTime,
                                                java.util.Collection<Object._Impl> toCreate,
                                                LongKeyMap<java.lang.Integer> reads,
                                                java.util.Collection<Object._Impl> writes)
Only used by the worker.


UnauthenticatedPrepareTransactionMessage

protected UnauthenticatedPrepareTransactionMessage(java.io.DataInput in)
                                            throws java.io.IOException
Deserialization constructor. Used only by the store.

Throws:
java.io.IOException
Method Detail

dispatch

public UnauthenticatedPrepareTransactionMessage.Response dispatch(MessageHandlerThread w)
Description copied from class: Message
Calls the appropriate handle(...) method on the handler.

Overrides:
dispatch in class Message<RemoteStore,UnauthenticatedPrepareTransactionMessage.Response>
Returns:
the result computed by the handler

send

public UnauthenticatedPrepareTransactionMessage.Response send(RemoteStore store)
                                                       throws UnreachableNodeException
Throws:
UnreachableNodeException

response

public UnauthenticatedPrepareTransactionMessage.Response response(RemoteStore node,
                                                                  java.io.DataInput in)
                                                           throws java.io.IOException
Description copied from class: Message
Creates a Response message of the appropriate type using the provided input stream.

Specified by:
response in class Message<RemoteStore,UnauthenticatedPrepareTransactionMessage.Response>
Parameters:
node - the remote node from which the response originated.
in - Input stream containing the message.
Returns:
A Response message with the appropriate type.
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from class: Message
Writes this message out on the given output stream. Only used by the worker.

Specified by:
write in class Message<RemoteStore,UnauthenticatedPrepareTransactionMessage.Response>
Throws:
java.io.IOException - if the output stream throws an IOException.