Package com.apple.foundationdb.record.provider.common

Support classes that do not depend on FoundationDB. Although the Record Layer only works with FoundationDB, a few of its pieces do not actually need the FDB API and might conceivably be used with a different backend, if there ever were one.

Serialization

The underlying database is a key-value store, mapping a byte-array key to a byte-array value. Serializing a record is the process of converting it to and from the byte-array value. The heavy lifting of record serialization is done by Protocol Buffers, using MessageLite.toByteArray() and Message.Builder.mergeFrom(byte[]). This is done by the RecordSerializer. To make records self-identifying, the record is wrapped in the RecordTypeUnion message, which has one field for each record type.

A serializer can also do other transformations between the raw message and the on-disk format. For example, TransformedRecordSerializer does compression and encryption.

Instrumentation

A StoreTimer is optionally associated with each open FDBRecordContext. This makes it available to an open FDBRecordStore. It accumulates timing information for all the operations performed by the context on the store, classified by StoreTimer.Event type.