@Override
    public void write(DataOutput out) throws IOException {
        Text.writeString(out, GsonUtils.GSON.toJson(this));
    }
@Test
    void write() throws IOException {
        long txnId = 9137;
        BinlogConsumeStateVO binlog = new BinlogConsumeStateVO();
        binlog.getBinlogMap().put(
                new BinlogConsumeStateVO.BinlogIdVO(1),
                new BinlogConsumeStateVO.BinlogLSNVO(2, 1));
        MVEpoch epoch = new MVEpoch(new MvId(0, 1024));
        epoch.onReady();
        epoch.onSchedule();
        epoch.onCommitting();
        epoch.onCommitted(binlog);
        epoch.setStartTimeMilli(1024);
        epoch.setCommitTimeMilli(1024);

        assertEquals(MVEpoch.EpochState.COMMITTED, epoch.getState());
        DataOutputBuffer buffer = new DataOutputBuffer(1024);
        epoch.write(buffer);
        byte[] bytes = buffer.getData();

        DataInput input = new DataInputStream(new ByteArrayInputStream(buffer.getData()));
        MVEpoch deserialized = MVEpoch.read(input);
        assertEquals(epoch, deserialized);
    }