Use Avro binary serialization. You can't use the same class in this case, but it will look the same in terms of attributes and types. Avro has a very flexible schema support, it is splittable and fully supported by Hadoop out-of-the-box.
Your class' schema will look like this:
{"namespace": "your.package.name",
"type": "record",
"name": "SomeClass",
"fields": [
{"name": "attr1", "type": "YourType1"},
{"name": "attr2", "type": "YourType2"},
{"name": "attr3", "type": "YourType3"}
]
}