@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()); }