public static interface ITransactionalSpout.Coordinator<X>
Modifier and Type | Method and Description |
---|---|
void |
close()
Release any resources from this coordinator.
|
X |
initializeTransaction(BigInteger txid,
X 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).
|
X initializeTransaction(BigInteger txid, X prevMetadata)
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.
txid
- The id of the transaction.prevMetadata
- The metadata of the previous transactionboolean isReady()
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).
void close()
Release any resources from this coordinator.
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.