@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); dest.setParentWritePointer(in.readLong()); int checkpointPointersLen = in.readInt(); if (checkpointPointersLen >= 0) { long[] checkpointPointers = new long[checkpointPointersLen]; for (int i = 0; i < checkpointPointersLen; i++) { checkpointPointers[i] = in.readLong(); } dest.setCheckpointPointers(checkpointPointers); } }
@Override public void encode(TransactionEdit src, DataOutput out) throws IOException { super.encode(src, out); out.writeLong(src.getParentWritePointer()); long[] checkpointPointers = src.getCheckpointPointers(); if (checkpointPointers == null) { out.writeInt(-1); } else { out.writeInt(checkpointPointers.length); for (int i = 0; i < checkpointPointers.length; i++) { out.writeLong(checkpointPointers[i]); } } }
@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); int typeIdx = in.readInt(); // null transaction type is represented as -1 if (typeIdx < 0) { dest.setType(null); } else { try { dest.setType(TransactionType.values()[typeIdx]); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Type enum ordinal value is out of range: " + typeIdx); } } int truncateInvalidTxSize = in.readInt(); Set<Long> truncateInvalidTx = emptySet(dest.getTruncateInvalidTx()); for (int i = 0; i < truncateInvalidTxSize; i++) { truncateInvalidTx.add(in.readLong()); } dest.setTruncateInvalidTx(truncateInvalidTx); dest.setTruncateInvalidTxTime(in.readLong()); }
@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); int typeIdx = in.readInt(); // null transaction type is represented as -1 if (typeIdx < 0) { dest.setType(null); } else { try { dest.setType(TransactionType.values()[typeIdx]); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Type enum ordinal value is out of range: " + typeIdx); } } int truncateInvalidTxSize = in.readInt(); Set<Long> truncateInvalidTx = emptySet(dest.getTruncateInvalidTx()); for (int i = 0; i < truncateInvalidTxSize; i++) { truncateInvalidTx.add(in.readLong()); } dest.setTruncateInvalidTx(truncateInvalidTx); dest.setTruncateInvalidTxTime(in.readLong()); }
@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); int typeIdx = in.readInt(); // null transaction type is represented as -1 if (typeIdx < 0) { dest.setType(null); } else { try { dest.setType(TransactionType.values()[typeIdx]); } catch (ArrayIndexOutOfBoundsException e) { throw new IOException("Type enum ordinal value is out of range: " + typeIdx); } } int truncateInvalidTxSize = in.readInt(); Set<Long> truncateInvalidTx = emptySet(dest.getTruncateInvalidTx()); for (int i = 0; i < truncateInvalidTxSize; i++) { truncateInvalidTx.add(in.readLong()); } dest.setTruncateInvalidTx(truncateInvalidTx); dest.setTruncateInvalidTxTime(in.readLong()); }
@Override public void encode(TransactionEdit src, DataOutput out) throws IOException { super.encode(src, out); out.writeLong(src.getParentWritePointer()); long[] checkpointPointers = src.getCheckpointPointers(); if (checkpointPointers == null) { out.writeInt(-1); } else { out.writeInt(checkpointPointers.length); for (int i = 0; i < checkpointPointers.length; i++) { out.writeLong(checkpointPointers[i]); } } }
@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); dest.setParentWritePointer(in.readLong()); int checkpointPointersLen = in.readInt(); if (checkpointPointersLen >= 0) { long[] checkpointPointers = new long[checkpointPointersLen]; for (int i = 0; i < checkpointPointersLen; i++) { checkpointPointers[i] = in.readLong(); } dest.setCheckpointPointers(checkpointPointers); } }
@Override public void decode(TransactionEdit dest, DataInput in) throws IOException { super.decode(dest, in); dest.setParentWritePointer(in.readLong()); int checkpointPointersLen = in.readInt(); if (checkpointPointersLen >= 0) { long[] checkpointPointers = new long[checkpointPointersLen]; for (int i = 0; i < checkpointPointersLen; i++) { checkpointPointers[i] = in.readLong(); } dest.setCheckpointPointers(checkpointPointers); } }
@Override public void encode(TransactionEdit src, DataOutput out) throws IOException { super.encode(src, out); out.writeLong(src.getParentWritePointer()); long[] checkpointPointers = src.getCheckpointPointers(); if (checkpointPointers == null) { out.writeInt(-1); } else { out.writeInt(checkpointPointers.length); for (int i = 0; i < checkpointPointers.length; i++) { out.writeLong(checkpointPointers[i]); } } }