com.wepay.waltz.common.metadata.PartitionMetadataSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of waltz-common Show documentation
Show all versions of waltz-common Show documentation
Waltz is a distributed/replicated write ahead log for transactions.
package com.wepay.waltz.common.metadata;
import com.wepay.zktools.zookeeper.serializer.SerializerHelper;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
* Implements the methods to serialize and deserialize {@link PartitionMetadata} object.
*/
public class PartitionMetadataSerializer extends SerializerHelper {
public static final PartitionMetadataSerializer INSTANCE = new PartitionMetadataSerializer();
@Override
public void serialize(PartitionMetadata partitionMetadata, DataOutput out) throws IOException {
partitionMetadata.writeTo(out);
}
@Override
public PartitionMetadata deserialize(DataInput in) throws IOException {
return PartitionMetadata.readFrom(in);
}
}