Package org.eclipse.jgit.notes
Class LeafBucket
java.lang.Object
org.eclipse.jgit.notes.NoteBucket
org.eclipse.jgit.notes.InMemoryNoteBucket
org.eclipse.jgit.notes.LeafBucket
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
FieldsModifier and TypeFieldDescriptionprivate intNumber of items innotes.(package private) static final intprivate Note[]All note blobs in this bucket, sorted sequentially.Fields inherited from class org.eclipse.jgit.notes.InMemoryNoteBucket
nonNotes, prefixLen -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) InMemoryNoteBucketprivate TreeFormatterbuild()(package private) intestimateSize(AnyObjectId noteOn, ObjectReader or) (package private) Noteget(int index) (package private) NotegetNote(AnyObjectId objId, ObjectReader or) (package private) ObjectIdprivate voiditerator(AnyObjectId objId, ObjectReader reader) (package private) voidparseOneEntry(AnyObjectId noteOn, AnyObjectId noteData) private intsearch(AnyObjectId objId) (package private) InMemoryNoteBucketset(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) private boolean(package private) intsize()(package private) FanoutBucketsplit()private inttreeSize(int nameLen) (package private) ObjectIdwriteTree(ObjectInserter inserter)
-
Field Details
-
MAX_SIZE
static final int MAX_SIZE- See Also:
-
notes
All note blobs in this bucket, sorted sequentially. -
cnt
private int cntNumber of items innotes.
-
-
Constructor Details
-
LeafBucket
LeafBucket(int prefixLen)
-
-
Method Details
-
search
-
getNote
- Specified by:
getNotein classNoteBucket
-
get
-
size
int size() -
iterator
- Specified by:
iteratorin classNoteBucket
-
estimateSize
- Specified by:
estimateSizein classNoteBucket- Throws:
IOException
-
set
InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException - Specified by:
setin classNoteBucket- Throws:
IOException
-
writeTree
- Specified by:
writeTreein classNoteBucket- Throws:
IOException
-
getTreeId
ObjectId getTreeId()- Specified by:
getTreeIdin classNoteBucket
-
build
-
treeSize
private int treeSize(int nameLen) -
parseOneEntry
-
append
- Specified by:
appendin classInMemoryNoteBucket
-
growIfFull
private void growIfFull() -
shouldSplit
private boolean shouldSplit() -
split
FanoutBucket split()
-