class Mobi::Mtld::Da::Carrier::BucketHandler

Copyright
Author

A bucket is a section of the data file. It has an ID, length and a byte array of data. Each bucket type has a specific format. This class handles the conversion of bucket data(binary bytes) to actual values.

The following buckets are handled:

- Property Names   - a unique list of property names. The order is the index.
- Property Values  - a unique list of property values. The order is the index.
- Properties       - collections of property name IDs to property value IDs
- IPv4 Radix Tree  - contains the data for the left/right branches of a tree
                     and property collection IDs

The bucket handler expects the buckets to be in the above order.

Constants

NO_CONTAINER
NO_VALUE
ORDER_SET_CONTAINER

Attributes

property_names[R]
property_string_names[R]
tree_lefts[R]
tree_properties[R]
tree_rights[R]

Public Class Methods

new() click to toggle source

Public Instance Methods

needs_buckets() click to toggle source

Checks if all the necessary buckets have been supplied and processed.

return

TRUE if all buckets complete, FALSE otherwise

process_bucket(bucket_id, file_crc32, bucket_data) click to toggle source

Process a bucket identified by “bucketId”. The bucket CRC-32 hash is verified before parsing the bucket data.