tisonkun commented on code in PR #2030:
URL: https://github.com/apache/zookeeper/pull/2030#discussion_r1256849152
##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/Request.java:
##########
@@ -164,6 +169,26 @@ public boolean isThrottlable() {
&& this.type != OpCode.createSession;
}
+ private transient byte[] serializeData;
+
+ @SuppressFBWarnings(value = "EI_EXPOSE_REP")
+ public byte[] getSerializeData() {
+ if (this.hdr == null) {
+ return null;
+ }
+
+ if (this.serializeData == null) {
+ try {
+ this.serializeData = Util.marshallTxnEntry(this.hdr, this.txn,
this.txnDigest);
+ } catch (IOException e) {
+ LOG.error("This really should be impossible.", e);
Review Comment:
Still I'm thinking of if we can assert this case won't happen. But it's an
inherited checked exception that can be coupled with more underneath functions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]