The serialization type uses the enumeration ordinal, which can easily cause
deserialization failures if the order of the enumeration objects changes.
Therefore, the constant value int should be used for each type
eg??
@Override
public void serializeImpl(ByteBuffer buffer)
{ int type = PhysicalPlanType.INSERT.ordinal(); buffer.put((byte) type);
subSerialize(buffer); }
@Override
public void serializeImpl(ByteBuffer buffer)
{ int type = PhysicalPlanType.BATCHINSERT.ordinal(); buffer.put((byte) type);
subSerialize(buffer, 0, rowCount); }
Improvement:
@Override
public void serializeImpl(ByteBuffer buffer)
{ int type = PhysicalPlanType.INSERT.type; buffer.put((byte) type);
subSerialize(buffer); }
@Override
public void serializeImpl(ByteBuffer buffer)
{ int type = PhysicalPlanType.BATCHINSERT.type; buffer.put((byte) type);
subSerialize(buffer, 0, rowCount); }
Best,
------------------------------------
gongning