Interface TxnLogBufferedWriter.DataSerializer<T>
- Enclosing class:
- TxnLogBufferedWriter<T>
public static interface TxnLogBufferedWriter.DataSerializer<T>
The serializer for the object which called by
TxnLogBufferedWriter.asyncAddData(T, org.apache.pulsar.transaction.coordinator.impl.TxnLogBufferedWriter.AddDataCallback, java.lang.Object).-
Method Summary
-
Method Details
-
getSerializedSize
Calculate the number of bytes taken by after serialization.- Parameters:
data- The object which called byTxnLogBufferedWriter.asyncAddData(T, org.apache.pulsar.transaction.coordinator.impl.TxnLogBufferedWriter.AddDataCallback, java.lang.Object).- Returns:
- The number of bytes taken after serialization.
-
serialize
Serialize toByteBuf. The returned ByteBuf will be release once after writing to Bookie complete, and if you still need to use the ByteBuf, should callByteBuf.retain()inserialize(Object)implementation.- Parameters:
data- The object which called byTxnLogBufferedWriter.asyncAddData(T, org.apache.pulsar.transaction.coordinator.impl.TxnLogBufferedWriter.AddDataCallback, java.lang.Object).- Returns:
- byte buf.
-
serialize
Serialize toByteBuf. The returned ByteBuf will be release once after writing to Bookie complete, and if you still need to use the ByteBuf, should callByteBuf.retain()inserialize(Object)implementation.- Parameters:
dataArray- The objects which called byTxnLogBufferedWriter.asyncAddData(T, org.apache.pulsar.transaction.coordinator.impl.TxnLogBufferedWriter.AddDataCallback, java.lang.Object).- Returns:
- byte buf.
-