prefixLen that defines how many digits it
skips in an ObjectId before it gets to the digits matching table.
The root tree has prefixLen == 0, and thus does not skip any digits.
For ObjectId "c0ffee...", the note (if it exists) will be stored within the
bucket table[0xc0].
The first level tree has prefixLen == 2, and thus skips the first two
digits. For the same example "c0ffee..." object, its note would be found
within the table[0xff] bucket (as first 2 digits "c0" are skipped).
Each subtree is loaded on-demand, reducing startup latency for reads that
only need to examine a few objects. However, due to the rather uniform
distribution of the SHA-1 hash that is used for ObjectIds, accessing 256
objects is very likely to load all of the subtrees into memory.
A FanoutBucket must be parsed from a tree object by NoteParser.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final byte[] | |
| private final NoteBucket[] | table
Fan-out table similar to the PackIndex structure. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv InMemoryNoteBucket | |
| private TreeFormatter | |
| private int | |
| pack-priv InMemoryNoteBucket | |
| pack-priv int | estimateSize(AnyObjectId noteOn, ObjectReader or)
Implements abstract org.
|
| pack-priv NoteBucket | |
| pack-priv Note | getNote(AnyObjectId objId, ObjectReader or)
Implements abstract org.
|
| pack-priv ObjectId | |
| pack-priv Iterator | iterator(AnyObjectId objId, final ObjectReader reader)
Implements abstract org.
|
| pack-priv static InMemoryNoteBucket | |
| pack-priv InMemoryNoteBucket | set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or)
Implements abstract org.
|
| pack-priv void | |
| pack-priv void | |
| private int | |
| pack-priv ObjectId |
| cnt | back to summary |
|---|---|
| private int cnt Number of non-null slots in | |
| hexchar | back to summary |
|---|---|
| private static final byte[] hexchar | |
| table | back to summary |
|---|---|
| private final NoteBucket[] table Fan-out table similar to the PackIndex structure.
Notes for an object are stored within the sub-bucket that is held here as
| |
| FanoutBucket | back to summary |
|---|---|
| pack-priv FanoutBucket(int prefixLen) | |
| append | back to summary |
|---|---|
| pack-priv InMemoryNoteBucket append(Note note) Implements abstract org.
| |
| build | back to summary |
|---|---|
| private TreeFormatter build(boolean insert, ObjectInserter inserter) throws IOException | |
| cell | back to summary |
|---|---|
| private int cell(AnyObjectId id) | |
| contractIfTooSmall | back to summary |
|---|---|
| pack-priv InMemoryNoteBucket contractIfTooSmall(AnyObjectId noteOn, ObjectReader or) throws IOException | |
| estimateSize | back to summary |
|---|---|
| pack-priv int estimateSize(AnyObjectId noteOn, ObjectReader or) throws IOException Implements abstract org.
| |
| getBucket | back to summary |
|---|---|
| pack-priv NoteBucket getBucket(int cell) | |
| getNote | back to summary |
|---|---|
| pack-priv Note getNote(AnyObjectId objId, ObjectReader or) throws IOException Implements abstract org.
| |
| getTreeId | back to summary |
|---|---|
| pack-priv ObjectId getTreeId() Implements abstract org.
| |
| iterator | back to summary |
|---|---|
| pack-priv Iterator Implements abstract org.
| |
| loadIfLazy | back to summary |
|---|---|
| pack-priv static InMemoryNoteBucket loadIfLazy(NoteBucket b, AnyObjectId prefix, ObjectReader or) throws IOException | |
| set | back to summary |
|---|---|
| pack-priv InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException Implements abstract org.
| |
| setBucket | back to summary |
|---|---|
| pack-priv void setBucket(int cell, ObjectId id) | |
| setBucket | back to summary |
|---|---|
| pack-priv void setBucket(int cell, InMemoryNoteBucket bucket) | |
| treeSize | back to summary |
|---|---|
| private int treeSize() | |
| writeTree | back to summary |
|---|---|
| pack-priv ObjectId writeTree(ObjectInserter inserter) throws IOException Implements abstract org.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | estimateSize(AnyObjectId objId, ObjectReader or)
Implements abstract org.
|
| pack-priv Note | getNote(AnyObjectId objId, ObjectReader or)
Implements abstract org.
|
| pack-priv ObjectId | |
| pack-priv Iterator | iterator(AnyObjectId objId, ObjectReader reader)
Implements abstract org.
|
| private InMemoryNoteBucket | |
| pack-priv InMemoryNoteBucket | set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or)
Implements abstract org.
|
| pack-priv ObjectId |
| treeId | back to summary |
|---|---|
| private final ObjectId treeId | |
| LazyNoteBucket | back to summary |
|---|---|
| pack-priv LazyNoteBucket(ObjectId treeId) | |
| estimateSize | back to summary |
|---|---|
| pack-priv int estimateSize(AnyObjectId objId, ObjectReader or) throws IOException Implements abstract org.
| |
| getNote | back to summary |
|---|---|
| pack-priv Note getNote(AnyObjectId objId, ObjectReader or) throws IOException Implements abstract org.
| |
| getTreeId | back to summary |
|---|---|
| pack-priv ObjectId getTreeId() Implements abstract org.
| |
| iterator | back to summary |
|---|---|
| pack-priv Iterator Implements abstract org.
| |
| load | back to summary |
|---|---|
| private InMemoryNoteBucket load(AnyObjectId prefix, ObjectReader or) throws IOException | |
| set | back to summary |
|---|---|
| pack-priv InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException Implements abstract org.
| |
| writeTree | back to summary |
|---|---|
| pack-priv ObjectId writeTree(ObjectInserter inserter) Implements abstract org.
| |