@Override public byte[] encodeTransaction() throws SQLException { assert(tx != null); TSOProto.Transaction.Builder transactionBuilder = TSOProto.Transaction.newBuilder(); transactionBuilder.setTimestamp(tx.getTransactionId()); transactionBuilder.setEpoch(tx.getEpoch()); byte[] encodedTxBytes = transactionBuilder.build().toByteArray(); // Add code of TransactionProvider at end of byte array encodedTxBytes = Arrays.copyOf(encodedTxBytes, encodedTxBytes.length + 1); encodedTxBytes[encodedTxBytes.length - 1] = getProvider().getCode(); return encodedTxBytes; }
public Builder mergeFrom(org.apache.omid.proto.TSOProto.Transaction other) { if (other == org.apache.omid.proto.TSOProto.Transaction.getDefaultInstance()) return this; if (other.hasTimestamp()) { setTimestamp(other.getTimestamp()); } if (other.hasReadTimestamp()) { setReadTimestamp(other.getReadTimestamp()); } if (other.hasVisibilityLevel()) { setVisibilityLevel(other.getVisibilityLevel()); } if (other.hasEpoch()) { setEpoch(other.getEpoch()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }