Data

class Data(buff=None)

Bases: object

Data is basic unit of serialization. It stores binary form of an object serialized by serialization service

to_bytes()

Returns byte array representation of internal binary format.

Returns

(byte array), byte array representation of internal binary format.

get_type()

Returns serialization type of binary form.

Returns

Serialization type of binary form.

total_size()

Returns the total size of Data in bytes.

Returns

(int), total size of Data in bytes.

data_size()

Returns size of internal binary data in bytes.

Returns

(int), size of internal binary data in bytes.

get_partition_hash()
Returns partition hash calculated for serialized object.
Partition hash is used to determine partition of a Data and is calculated using
  • PartitioningStrategy during serialization.

  • If partition hash is not set then hash_code() is used.

Returns

partition hash

is_portable()

Determines whether this Data is created from a Portable. object or not.

Returns

(bool), true if source object is Portable, false otherwise.

has_partition_hash()

Determines whether this Data has partition hash or not.

Returns

(bool), true if Data has partition hash, false otherwise.

hash_code()

Returns the murmur hash of the internal data.

Returns

the murmur hash of the internal data.