Top Description Inners Fields Constructors Methods
org.eclipse.jgit.notes

pack-priv Class FanoutBucket

extends InMemoryNoteBucket
Class Inheritance
Static Imports
org.eclipse.jgit.lib.FileMode.TREE

A note tree holding only note subtrees, each named using a 2 digit hex name. The fanout buckets/trees contain on average 256 subtrees, naming the subtrees by a slice of the ObjectId contained within them, from "00" through "ff". Each fanout bucket has a 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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private int
cnt

Number of non-null slots in table.

private static final byte[]
private final NoteBucket[]
table

Fan-out table similar to the PackIndex structure.

Inherited from org.eclipse.jgit.notes.InMemoryNoteBucket:
nonNotesprefixLen

Constructor Summary

AccessConstructor and Description
pack-priv
FanoutBucket(int prefixLen)

Method Summary

Modifier and TypeMethod and Description
pack-priv InMemoryNoteBucket
private TreeFormatter
build(boolean insert, ObjectInserter inserter)

private int
pack-priv InMemoryNoteBucket
pack-priv int
pack-priv NoteBucket
getBucket(int cell)

pack-priv Note
pack-priv ObjectId
pack-priv Iterator<Note>
pack-priv static InMemoryNoteBucket
pack-priv InMemoryNoteBucket
pack-priv void
setBucket(int cell, ObjectId id)

pack-priv void
setBucket(int cell, InMemoryNoteBucket bucket)

private int
pack-priv ObjectId

Field Detail

cntback to summary
private int cnt

Number of non-null slots in table.

hexcharback to summary
private static final byte[] hexchar
tableback 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 table[ objectId.getByte( prefixLen / 2 ) ]. If the slot is null there are no notes with that prefix.

Constructor Detail

FanoutBucketback to summary
pack-priv FanoutBucket(int prefixLen)

Method Detail

appendback to summary
pack-priv InMemoryNoteBucket append(Note note)

Implements abstract org.eclipse.jgit.notes.InMemoryNoteBucket.append.

Annotations
@Override
buildback to summary
private TreeFormatter build(boolean insert, ObjectInserter inserter) throws IOException
cellback to summary
private int cell(AnyObjectId id)
contractIfTooSmallback to summary
pack-priv InMemoryNoteBucket contractIfTooSmall(AnyObjectId noteOn, ObjectReader or) throws IOException
estimateSizeback to summary
pack-priv int estimateSize(AnyObjectId noteOn, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.estimateSize.

Annotations
@Override
getBucketback to summary
pack-priv NoteBucket getBucket(int cell)
getNoteback to summary
pack-priv Note getNote(AnyObjectId objId, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.getNote.

Annotations
@Override
getTreeIdback to summary
pack-priv ObjectId getTreeId()

Implements abstract org.eclipse.jgit.notes.NoteBucket.getTreeId.

Annotations
@Override
iteratorback to summary
pack-priv Iterator<Note> iterator(AnyObjectId objId, final ObjectReader reader) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.iterator.

Annotations
@Override
loadIfLazyback to summary
pack-priv static InMemoryNoteBucket loadIfLazy(NoteBucket b, AnyObjectId prefix, ObjectReader or) throws IOException
setback to summary
pack-priv InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.set.

Annotations
@Override
setBucketback to summary
pack-priv void setBucket(int cell, ObjectId id)
setBucketback to summary
pack-priv void setBucket(int cell, InMemoryNoteBucket bucket)
treeSizeback to summary
private int treeSize()
writeTreeback to summary
pack-priv ObjectId writeTree(ObjectInserter inserter) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.writeTree.

Annotations
@Override
org.eclipse.jgit.notes back to summary

private Class FanoutBucket.LazyNoteBucket

extends NoteBucket
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ObjectId

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv int
pack-priv Note
pack-priv ObjectId
pack-priv Iterator<Note>
private InMemoryNoteBucket
pack-priv InMemoryNoteBucket
pack-priv ObjectId

Field Detail

treeIdback to summary
private final ObjectId treeId

Constructor Detail

LazyNoteBucketback to summary
pack-priv LazyNoteBucket(ObjectId treeId)

Method Detail

estimateSizeback to summary
pack-priv int estimateSize(AnyObjectId objId, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.estimateSize.

Annotations
@Override
getNoteback to summary
pack-priv Note getNote(AnyObjectId objId, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.getNote.

Annotations
@Override
getTreeIdback to summary
pack-priv ObjectId getTreeId()

Implements abstract org.eclipse.jgit.notes.NoteBucket.getTreeId.

Annotations
@Override
iteratorback to summary
pack-priv Iterator<Note> iterator(AnyObjectId objId, ObjectReader reader) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.iterator.

Annotations
@Override
loadback to summary
private InMemoryNoteBucket load(AnyObjectId prefix, ObjectReader or) throws IOException
setback to summary
pack-priv InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException

Implements abstract org.eclipse.jgit.notes.NoteBucket.set.

Annotations
@Override
writeTreeback to summary
pack-priv ObjectId writeTree(ObjectInserter inserter)

Implements abstract org.eclipse.jgit.notes.NoteBucket.writeTree.

Annotations
@Override