/
TransactionAttempt.java
47 lines (36 loc) · 1.05 KB
/
TransactionAttempt.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package backtype.storm.transactional;
import java.io.Serializable;
import java.math.BigInteger;
public class TransactionAttempt implements Serializable{
/** */
private static final long serialVersionUID = 1L;
BigInteger _txid;
long _attemptId;
// for kryo compatibility
public TransactionAttempt() {
}
public TransactionAttempt(BigInteger txid, long attemptId) {
_txid = txid;
_attemptId = attemptId;
}
public BigInteger getTransactionId() {
return _txid;
}
public long getAttemptId() {
return _attemptId;
}
@Override
public int hashCode() {
return _txid.hashCode();
}
@Override
public boolean equals(Object o) {
if(!(o instanceof TransactionAttempt)) return false;
TransactionAttempt other = (TransactionAttempt) o;
return _txid.equals(other._txid) && _attemptId == other._attemptId;
}
@Override
public String toString() {
return "" + _txid + ":" + _attemptId;
}
}