-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b06589
commit 96ea924
Showing
2 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
.../java/com/alibaba/rocketmq/common/protocol/header/CheckTransactionStateRequestHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* $Id: EndTransactionRequestHeader.java 1835 2013-05-16 02:00:50Z shijia.wxr $ | ||
*/ | ||
package com.alibaba.rocketmq.common.protocol.header; | ||
|
||
import com.alibaba.rocketmq.remoting.CommandCustomHeader; | ||
import com.alibaba.rocketmq.remoting.annotation.CFNotNull; | ||
import com.alibaba.rocketmq.remoting.exception.RemotingCommandException; | ||
|
||
|
||
/** | ||
* @author [email protected] [email protected] | ||
* | ||
*/ | ||
public class CheckTransactionStateRequestHeader implements CommandCustomHeader { | ||
@CFNotNull | ||
private Long tranStateTableOffset; | ||
@CFNotNull | ||
private Long commitLogOffset; | ||
|
||
|
||
@Override | ||
public void checkFields() throws RemotingCommandException { | ||
} | ||
|
||
|
||
public Long getTranStateTableOffset() { | ||
return tranStateTableOffset; | ||
} | ||
|
||
|
||
public void setTranStateTableOffset(Long tranStateTableOffset) { | ||
this.tranStateTableOffset = tranStateTableOffset; | ||
} | ||
|
||
|
||
public Long getCommitLogOffset() { | ||
return commitLogOffset; | ||
} | ||
|
||
|
||
public void setCommitLogOffset(Long commitLogOffset) { | ||
this.commitLogOffset = commitLogOffset; | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...java/com/alibaba/rocketmq/common/protocol/header/CheckTransactionStateResponseHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* $Id: EndTransactionResponseHeader.java 1835 2013-05-16 02:00:50Z shijia.wxr $ | ||
*/ | ||
package com.alibaba.rocketmq.common.protocol.header; | ||
|
||
import com.alibaba.rocketmq.common.sysflag.MessageSysFlag; | ||
import com.alibaba.rocketmq.remoting.CommandCustomHeader; | ||
import com.alibaba.rocketmq.remoting.annotation.CFNotNull; | ||
import com.alibaba.rocketmq.remoting.exception.RemotingCommandException; | ||
|
||
|
||
/** | ||
* @author [email protected] [email protected] | ||
* | ||
*/ | ||
public class CheckTransactionStateResponseHeader implements CommandCustomHeader { | ||
@CFNotNull | ||
private String producerGroup; | ||
@CFNotNull | ||
private Long tranStateTableOffset; | ||
@CFNotNull | ||
private Long commitLogOffset; | ||
@CFNotNull | ||
private Integer commitOrRollback; // TransactionCommitType | ||
// TransactionRollbackType | ||
|
||
|
||
@Override | ||
public void checkFields() throws RemotingCommandException { | ||
if (MessageSysFlag.TransactionCommitType == this.commitOrRollback) { | ||
return; | ||
} | ||
|
||
if (MessageSysFlag.TransactionRollbackType == this.commitOrRollback) { | ||
return; | ||
} | ||
|
||
throw new RemotingCommandException("commitOrRollback field wrong"); | ||
} | ||
|
||
|
||
public String getProducerGroup() { | ||
return producerGroup; | ||
} | ||
|
||
|
||
public void setProducerGroup(String producerGroup) { | ||
this.producerGroup = producerGroup; | ||
} | ||
|
||
|
||
public Long getTranStateTableOffset() { | ||
return tranStateTableOffset; | ||
} | ||
|
||
|
||
public void setTranStateTableOffset(Long tranStateTableOffset) { | ||
this.tranStateTableOffset = tranStateTableOffset; | ||
} | ||
|
||
|
||
public Long getCommitLogOffset() { | ||
return commitLogOffset; | ||
} | ||
|
||
|
||
public void setCommitLogOffset(Long commitLogOffset) { | ||
this.commitLogOffset = commitLogOffset; | ||
} | ||
|
||
|
||
public Integer getCommitOrRollback() { | ||
return commitOrRollback; | ||
} | ||
|
||
|
||
public void setCommitOrRollback(Integer commitOrRollback) { | ||
this.commitOrRollback = commitOrRollback; | ||
} | ||
} |