private InMemoryNoteBucket load(AnyObjectId prefix, ObjectReader or) throws IOException { AbbreviatedObjectId p = prefix.abbreviate(prefixLen + 2); InMemoryNoteBucket self = NoteParser.parse(p, treeId, or); table[cell(prefix)] = self; return self; } }
private void load(ObjectId rootTree) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ root = NoteParser.parse(none, rootTree, reader); } }
/** * Parse a tree object into a {@link NoteBucket} instance. * * The type of note tree is automatically detected by examining the items * within the tree, and allocating the proper storage type based on the * first note-like entry encountered. Since the method parses by guessing * the type on the first element, malformed note trees can be read as the * wrong type of tree. * * This method is not recursive, it parses the one tree given to it and * returns the bucket. If there are subtrees for note storage, they are * setup as lazy pointers that will be resolved at a later time. * * @param prefix * common hex digits that all notes within this tree share. The * root tree has {@code prefix.length() == 0}, the first-level * subtrees should be {@code prefix.length()==2}, etc. * @param treeId * the tree to read from the repository. * @param reader * reader to access the tree object. * @return bucket to holding the notes of the specified tree. * @throws IOException * {@code treeId} cannot be accessed. */ static InMemoryNoteBucket parse(AbbreviatedObjectId prefix, final ObjectId treeId, final ObjectReader reader) throws IOException { return new NoteParser(prefix, reader, treeId).parse(); }
private NonNoteEntry mergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList, NonNoteEntry theirsList) throws IOException { if (baseList == null && oursList == null && theirsList == null) return null; ObjectId baseId = write(baseList); ObjectId oursId = write(oursList); ObjectId theirsId = write(theirsList); inserter.flush(); Merger m = nonNotesMergeStrategy.newMerger(db, true); if (m instanceof ThreeWayMerger) ((ThreeWayMerger) m).setBase(baseId); if (!m.merge(oursId, theirsId)) throw new NotesMergeConflictException(baseList, oursList, theirsList); ObjectId resultTreeId = m.getResultTreeId(); AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ return NoteParser.parse(none, resultTreeId, reader).nonNotes; }
private InMemoryNoteBucket load(AnyObjectId prefix, ObjectReader or) throws IOException { AbbreviatedObjectId p = prefix.abbreviate(prefixLen + 2); InMemoryNoteBucket self = NoteParser.parse(p, treeId, or); table[cell(prefix)] = self; return self; } }
private void load(ObjectId rootTree) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ root = NoteParser.parse(none, rootTree, reader); } }
private void load(ObjectId rootTree) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ root = NoteParser.parse(none, rootTree, reader); } }
private InMemoryNoteBucket load(AnyObjectId prefix, ObjectReader or) throws IOException { AbbreviatedObjectId p = prefix.abbreviate(prefixLen + 2); InMemoryNoteBucket self = NoteParser.parse(p, treeId, or); table[cell(prefix)] = self; return self; } }
/** * Parse a tree object into a {@link NoteBucket} instance. * * The type of note tree is automatically detected by examining the items * within the tree, and allocating the proper storage type based on the * first note-like entry encountered. Since the method parses by guessing * the type on the first element, malformed note trees can be read as the * wrong type of tree. * * This method is not recursive, it parses the one tree given to it and * returns the bucket. If there are subtrees for note storage, they are * setup as lazy pointers that will be resolved at a later time. * * @param prefix * common hex digits that all notes within this tree share. The * root tree has {@code prefix.length() == 0}, the first-level * subtrees should be {@code prefix.length()==2}, etc. * @param treeId * the tree to read from the repository. * @param reader * reader to access the tree object. * @return bucket to holding the notes of the specified tree. * @throws IOException * {@code treeId} cannot be accessed. */ static InMemoryNoteBucket parse(AbbreviatedObjectId prefix, final ObjectId treeId, final ObjectReader reader) throws IOException { return new NoteParser(prefix, reader, treeId).parse(); }
/** * Parse a tree object into a {@link NoteBucket} instance. * * The type of note tree is automatically detected by examining the items * within the tree, and allocating the proper storage type based on the * first note-like entry encountered. Since the method parses by guessing * the type on the first element, malformed note trees can be read as the * wrong type of tree. * * This method is not recursive, it parses the one tree given to it and * returns the bucket. If there are subtrees for note storage, they are * setup as lazy pointers that will be resolved at a later time. * * @param prefix * common hex digits that all notes within this tree share. The * root tree has {@code prefix.length() == 0}, the first-level * subtrees should be {@code prefix.length()==2}, etc. * @param treeId * the tree to read from the repository. * @param reader * reader to access the tree object. * @return bucket to holding the notes of the specified tree. * @throws IOException * {@code treeId} cannot be accessed. */ static InMemoryNoteBucket parse(AbbreviatedObjectId prefix, final ObjectId treeId, final ObjectReader reader) throws IOException { return new NoteParser(prefix, reader, treeId).parse(); }
private NonNoteEntry mergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList, NonNoteEntry theirsList) throws IOException { if (baseList == null && oursList == null && theirsList == null) return null; ObjectId baseId = write(baseList); ObjectId oursId = write(oursList); ObjectId theirsId = write(theirsList); inserter.flush(); Merger m = nonNotesMergeStrategy.newMerger(db, true); if (m instanceof ThreeWayMerger) ((ThreeWayMerger) m).setBase(baseId); if (!m.merge(oursId, theirsId)) throw new NotesMergeConflictException(baseList, oursList, theirsList); ObjectId resultTreeId = m.getResultTreeId(); AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ return NoteParser.parse(none, resultTreeId, reader).nonNotes; }
private NonNoteEntry mergeNonNotes(NonNoteEntry baseList, NonNoteEntry oursList, NonNoteEntry theirsList) throws IOException { if (baseList == null && oursList == null && theirsList == null) return null; ObjectId baseId = write(baseList); ObjectId oursId = write(oursList); ObjectId theirsId = write(theirsList); inserter.flush(); Merger m = nonNotesMergeStrategy.newMerger(db, true); if (m instanceof ThreeWayMerger) ((ThreeWayMerger) m).setBase(baseId); if (!m.merge(oursId, theirsId)) throw new NotesMergeConflictException(baseList, oursList, theirsList); ObjectId resultTreeId = m.getResultTreeId(); AbbreviatedObjectId none = AbbreviatedObjectId.fromString(""); //$NON-NLS-1$ return NoteParser.parse(none, resultTreeId, reader).nonNotes; }