/** @deprecated use {@link TransactionEditCodecs.TransactionEditCodecV4} instead, it is still here for * unit-tests only */ @Override @Deprecated public void encode(TransactionEdit src, DataOutput out) throws IOException { out.writeLong(src.getWritePointer()); // use ordinal for predictable size, though this does not support evolution out.writeInt(src.getState().ordinal()); out.writeLong(src.getExpiration()); out.writeLong(src.getCommitPointer()); out.writeBoolean(src.getCanCommit()); Set<ChangeId> changes = src.getChanges(); if (changes == null) { out.writeInt(0); } else { out.writeInt(changes.size()); for (ChangeId c : changes) { byte[] cKey = c.getKey(); out.writeInt(cKey.length); out.write(cKey); } } // NOTE: we didn't have visibilityUpperBound in V1, it was added in V2 // we didn't have transaction type, truncateInvalidTx and truncateInvalidTxTime in V1 and V2, // it was added in V3 }
/** @deprecated use {@link TransactionEditCodecs.TransactionEditCodecV4} instead, it is still here for * unit-tests only */ @Override @Deprecated public void encode(TransactionEdit src, DataOutput out) throws IOException { out.writeLong(src.getWritePointer()); // use ordinal for predictable size, though this does not support evolution out.writeInt(src.getState().ordinal()); out.writeLong(src.getExpiration()); out.writeLong(src.getCommitPointer()); out.writeBoolean(src.getCanCommit()); Set<ChangeId> changes = src.getChanges(); if (changes == null) { out.writeInt(0); } else { out.writeInt(changes.size()); for (ChangeId c : changes) { byte[] cKey = c.getKey(); out.writeInt(cKey.length); out.write(cKey); } } // NOTE: we didn't have visibilityUpperBound in V1, it was added in V2 // we didn't have transaction type, truncateInvalidTx and truncateInvalidTxTime in V1 and V2, // it was added in V3 }
/** @deprecated use {@link TransactionEditCodecs.TransactionEditCodecV4} instead, it is still here for * unit-tests only */ @Override @Deprecated public void encode(TransactionEdit src, DataOutput out) throws IOException { out.writeLong(src.getWritePointer()); // use ordinal for predictable size, though this does not support evolution out.writeInt(src.getState().ordinal()); out.writeLong(src.getExpiration()); out.writeLong(src.getCommitPointer()); out.writeBoolean(src.getCanCommit()); Set<ChangeId> changes = src.getChanges(); if (changes == null) { out.writeInt(0); } else { out.writeInt(changes.size()); for (ChangeId c : changes) { byte[] cKey = c.getKey(); out.writeInt(cKey.length); out.write(cKey); } } // NOTE: we didn't have visibilityUpperBound in V1, it was added in V2 // we didn't have transaction type, truncateInvalidTx and truncateInvalidTxTime in V1 and V2, // it was added in V3 }
/** * Creates a new instance from {@link co.cask.tephra.persist.TransactionEdit}. */ @Deprecated public static TransactionEdit convertCaskTxEdit(co.cask.tephra.persist.TransactionEdit txEdit) { if (txEdit == null) { return null; } return new TransactionEdit(txEdit.getWritePointer(), txEdit.getVisibilityUpperBound(), TransactionEdit.State.valueOf(txEdit.getState().toString()), txEdit.getExpiration(), txEdit.getChanges(), txEdit.getCommitPointer(), txEdit.getCanCommit(), txEdit.getType(), txEdit.getTruncateInvalidTx(), txEdit.getTruncateInvalidTxTime(), txEdit.getParentWritePointer(), txEdit.getCheckpointPointers()); }
switch (edit.getState()) { case INPROGRESS: long expiration = edit.getExpiration(); TransactionType type = edit.getType();
switch (edit.getState()) { case INPROGRESS: long expiration = edit.getExpiration(); TransactionType type = edit.getType();