Class StateStoreSerializerPBImpl
java.lang.Object
org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreSerializer
org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializerPBImpl
Protobuf implementation of the State Store serializer.
-
Method Summary
Modifier and TypeMethodDescription<T extends BaseRecord>
Tdeserialize(byte[] byteArray, Class<T> clazz) Deserialize a bytes array into a record.<T extends BaseRecord>
Tdeserialize(String data, Class<T> clazz) Deserialize a string into a record.<T> TnewRecordInstance(Class<T> clazz) Create a new record.byte[]serialize(BaseRecord record) Serialize a record into a byte array.serializeString(BaseRecord record) Serialize a record into a string.Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreSerializer
getSerializer, getSerializer, newRecord
-
Method Details
-
newRecordInstance
Description copied from class:StateStoreSerializerCreate a new record.- Specified by:
newRecordInstancein classStateStoreSerializer- Type Parameters:
T- Type of the record.- Parameters:
clazz- Class of the new record.- Returns:
- New record.
-
serialize
Description copied from class:StateStoreSerializerSerialize a record into a byte array.- Specified by:
serializein classStateStoreSerializer- Parameters:
record- Record to serialize.- Returns:
- Byte array with the serialized record.
-
serializeString
Description copied from class:StateStoreSerializerSerialize a record into a string.- Specified by:
serializeStringin classStateStoreSerializer- Parameters:
record- Record to serialize.- Returns:
- String with the serialized record.
-
deserialize
Description copied from class:StateStoreSerializerDeserialize a bytes array into a record.- Specified by:
deserializein classStateStoreSerializer- Type Parameters:
T- Type of the record.- Parameters:
byteArray- Byte array to deserialize.clazz- Class of the record.- Returns:
- New record.
- Throws:
IOException- If it cannot deserialize the record.
-
deserialize
Description copied from class:StateStoreSerializerDeserialize a string into a record.- Specified by:
deserializein classStateStoreSerializer- Type Parameters:
T- Type of the record.- Parameters:
data- String with the data to deserialize.clazz- Class of the record.- Returns:
- New record.
- Throws:
IOException- If it cannot deserialize the record.
-