public class OpaquePartitionedTransactionalSpoutExecutor.Coordinator extends Object implements ITransactionalSpout.Coordinator<Object>
Constructor and Description |
---|
Coordinator(Map conf,
TopologyContext context) |
Modifier and Type | Method and Description |
---|---|
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).
|
public Coordinator(Map conf, TopologyContext context)
public Object initializeTransaction(BigInteger txid, Object prevMetadata)
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.
initializeTransaction
in interface ITransactionalSpout.Coordinator<Object>
txid
- The id of the transaction.prevMetadata
- The metadata of the previous transactionpublic boolean isReady()
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).
isReady
in interface ITransactionalSpout.Coordinator<Object>
public void close()
ITransactionalSpout.Coordinator
Release any resources from this coordinator.
close
in interface ITransactionalSpout.Coordinator<Object>
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.