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

pack-priv Class LeafBucket

extends InMemoryNoteBucket
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH, .FileMode.REGULAR_FILE

A note tree holding only notes, with no subtrees. The leaf bucket contains on average less than 256 notes, all of whom share the same leading prefix. If a notes branch has less than 256 notes, the top level tree of the branch should be a LeafBucket. Once a notes branch has more than 256 notes, the root should be a FanoutBucket and the LeafBucket will appear only as a cell of a FanoutBucket. Entries within the LeafBucket are stored sorted by ObjectId, and lookup is performed using binary search. As the entry list should contain fewer than 256 elements, the average number of compares to find an element should be less than 8 due to the O(log N) lookup behavior. A LeafBucket must be parsed from a tree object by NoteParser.

Field Summary

Modifier and TypeField and Description
private int
cnt

Number of items in notes.

pack-priv static final int
private Note[]
notes

All note blobs in this bucket, sorted sequentially.

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

Constructor Summary

AccessConstructor and Description
pack-priv
LeafBucket(int prefixLen)

Method Summary

Modifier and TypeMethod and Description
pack-priv InMemoryNoteBucket
private TreeFormatter
pack-priv int
pack-priv Note
get(int index)

pack-priv Note
pack-priv ObjectId
private void
pack-priv Iterator<Note>
pack-priv void
private int
pack-priv InMemoryNoteBucket
private boolean
pack-priv int
size()

pack-priv FanoutBucket
private int
treeSize(int nameLen)

pack-priv ObjectId

Field Detail

cntback to summary
private int cnt

Number of items in notes.

MAX_SIZEback to summary
pack-priv static final int MAX_SIZE
notesback to summary
private Note[] notes

All note blobs in this bucket, sorted sequentially.

Constructor Detail

LeafBucketback to summary
pack-priv LeafBucket(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()
estimateSizeback to summary
pack-priv int estimateSize(AnyObjectId noteOn, ObjectReader or) throws IOException

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

Annotations
@Override
getback to summary
pack-priv Note get(int index)
getNoteback to summary
pack-priv Note getNote(AnyObjectId objId, ObjectReader or)

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
growIfFullback to summary
private void growIfFull()
iteratorback to summary
pack-priv Iterator<Note> iterator(AnyObjectId objId, ObjectReader reader)

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

Annotations
@Override
parseOneEntryback to summary
pack-priv void parseOneEntry(AnyObjectId noteOn, AnyObjectId noteData)
searchback to summary
private int search(AnyObjectId objId)
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
shouldSplitback to summary
private boolean shouldSplit()
sizeback to summary
pack-priv int size()
splitback to summary
pack-priv FanoutBucket split()
treeSizeback to summary
private int treeSize(int nameLen)
writeTreeback to summary
pack-priv ObjectId writeTree(ObjectInserter inserter) throws IOException

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

Annotations
@Override