@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( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.omid.proto.TSOProto.Transaction parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.omid.proto.TSOProto.Transaction) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
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; }
private Builder() { maybeForceBuilderInitialization(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public org.apache.omid.proto.TSOProto.Transaction build() { org.apache.omid.proto.TSOProto.Transaction result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
private static Builder create() { return new Builder(); }
public static Builder newBuilder(org.apache.omid.proto.TSOProto.Transaction prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.omid.proto.TSOProto.Transaction) { return mergeFrom((org.apache.omid.proto.TSOProto.Transaction)other); } else { super.mergeFrom(other); return this; } }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {