On 5/26/20 4:46 PM, Xiangdong Huang wrote:
Hi Giorgio,
Welcome to discuss the class/interface design.
I believe there must be a lot of class/interface design we can improve in
the current implementation.
Are you talking about the PageHeader and ChunkHeader?
IMO, they are considered as JavaBeans, and serialization/deserialization
methods are needed (if we do not use java.io.Serializable)
Yes, but suggest to create an appropriate interface, because if i need
to test only those, i can mock. Example.
public interface DataSerializable {
void serializeTo(OutputStream stream) throws SerializationException;
void serializeTo(ByteBuffer buffer) throws SerializationException;
}
public class PageHeader implements DataSerializable {
}
So you can treat a PageHeader, ChunkHeader as the think and create
composition
while deserializing. This will our development for us because we can
just implement DataSerializable and mock
whatever we want without importing the real implementation.
This is my point, if the community agrees i can provide a PR. We are
slowly progressing with the native but still a lot of time is needed
since we use our free time and weekends.
Best Regards,
Giorgio.