Package com.apple.foundationdb.record.provider.foundationdb.layers.interning
A layer for mapping potentially long strings to and from more compact tuple elements.
A string identifier that is part of a KeySpace
will be part of the key for every record and every index entry is a record store following that key space.
Since FoundationDB does not do prefix compression, this can add up to a lot of space when the string is long enough to really express anything.
Space is saved by replacing the string in the key Tuple
with an integer gotten by interning it.
This interning operation is very similar to what the DirectoryLayer
does, except that whereas the directory layer actually identifies space between the root of the key-value store,
an interned path element might be anywhere in the path.
-
Class Summary Class Description HighContentionAllocator A supplier of unique integers that tries to balance size of the integer and conflicts on the assignment.HighContentionAllocator.AllocationWindow A range of possible values to try.ScopedInterningLayer An implementation ofLocatableResolver
that is backed by theStringInterningLayer
.StringInterningLayer A persistent bidirectional unique mapping between strings and integers.