backtype.storm.transactional.partitioned
Class OpaquePartitionedTransactionalSpoutExecutor.Coordinator
java.lang.Object
backtype.storm.transactional.partitioned.OpaquePartitionedTransactionalSpoutExecutor.Coordinator
- All Implemented Interfaces:
- ITransactionalSpout.Coordinator<Object>
- Enclosing class:
- OpaquePartitionedTransactionalSpoutExecutor
public class OpaquePartitionedTransactionalSpoutExecutor.Coordinator
- extends Object
- implements ITransactionalSpout.Coordinator<Object>
|
Method Summary |
void |
close()
Release any resources from this coordinator. |
Object |
initializeTransaction(BigInteger txid,
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 |
OpaquePartitionedTransactionalSpoutExecutor.Coordinator
public OpaquePartitionedTransactionalSpoutExecutor.Coordinator(Map conf,
TopologyContext context)
initializeTransaction
public Object initializeTransaction(BigInteger txid,
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<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<Object>
close
public void close()
- Description copied from interface:
ITransactionalSpout.Coordinator
- Release any resources from this coordinator.
- Specified by:
close in interface ITransactionalSpout.Coordinator<Object>
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.