backtype.storm.transactional.partitioned
Class OpaquePartitionedTransactionalSpoutExecutor.Coordinator

java.lang.Object
  extended by backtype.storm.transactional.partitioned.OpaquePartitionedTransactionalSpoutExecutor.Coordinator
All Implemented Interfaces:
ITransactionalSpout.Coordinator<java.lang.Object>
Enclosing class:
OpaquePartitionedTransactionalSpoutExecutor

public class OpaquePartitionedTransactionalSpoutExecutor.Coordinator
extends java.lang.Object
implements ITransactionalSpout.Coordinator<java.lang.Object>


Constructor Summary
OpaquePartitionedTransactionalSpoutExecutor.Coordinator(java.util.Map conf, TopologyContext context)
           
 
Method Summary
 void close()
          Release any resources from this coordinator.
 java.lang.Object initializeTransaction(java.math.BigInteger txid, java.lang.Object prevMetadata)
          Create metadata for this particular transaction id which has never been emitted before.
 boolean isReady()
          Returns true if its ok to emit start a new transaction, false otherwise (will skip this transaction).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpaquePartitionedTransactionalSpoutExecutor.Coordinator

public OpaquePartitionedTransactionalSpoutExecutor.Coordinator(java.util.Map conf,
                                                               TopologyContext context)
Method Detail

initializeTransaction

public java.lang.Object initializeTransaction(java.math.BigInteger txid,
                                              java.lang.Object prevMetadata)
Description copied from interface: ITransactionalSpout.Coordinator
Create metadata for this particular transaction id which has never been emitted before. The metadata should contain whatever is necessary to be able to replay the exact batch for the transaction at a later point. The metadata is stored in Zookeeper. Storm uses the Kryo serializations configured in the component configuration for this spout to serialize and deserialize the metadata.

Specified by:
initializeTransaction in interface ITransactionalSpout.Coordinator<java.lang.Object>
Parameters:
txid - The id of the transaction.
prevMetadata - The metadata of the previous transaction
Returns:
the metadata for this new transaction

isReady

public boolean isReady()
Description copied from interface: ITransactionalSpout.Coordinator
Returns true if its ok to emit start a new transaction, false otherwise (will skip this transaction). You should sleep here if you want a delay between asking for the next transaction (this will be called repeatedly in a loop).

Specified by:
isReady in interface ITransactionalSpout.Coordinator<java.lang.Object>

close

public void close()
Description copied from interface: ITransactionalSpout.Coordinator
Release any resources from this coordinator.

Specified by:
close in interface ITransactionalSpout.Coordinator<java.lang.Object>