Skip to content

Instantly share code, notes, and snippets.

@apurvam
Last active November 28, 2016 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apurvam/2a92e13cd7602c9d8d81481f5b99a087 to your computer and use it in GitHub Desktop.
Save apurvam/2a92e13cd7602c9d8d81481f5b99a087 to your computer and use it in GitHub Desktop.
TransactionMetadata class
public class TransactionResponse {
/**
* All the error codes that may be returned by transactional methods.
*/
public enum TransactionError {
PRODUCER_FENCED,
NO_PID_MAPPING,
NOT_COORDINATOR_FOR_APP_ID,
INVALID_TXN_REQUEST,
COORDINATOR_NOT_AVAILABLE,
INVALID_SEQUENCE_NUMBER
}
/**
* Returns true if the request was successful, false otherwise.
*/
public boolean isSuccess();
/**
* If isSuccess returns false, this method will return the error that occurred in processing the transaction.
*/
public TransactionError getError();
/**
* The list of partitions currently part of the transaction.
*/
public List<TopicPartition> partitions();
/**
* The current epoch of this AppId.
*/
public long epoch();
/**
* The AppId for this transaction.
*/
public String appId();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment