/** * Link the given next leaf after the given leaf. * * @param <T> The value type of the b+tree objects. * @param <A> The address type used to identify an inner or leaf tier. * @param mutation The mutation state container. * @param leaf The leaf. * @param nextLeaf The next leaf. */ public static <T, A> void link(Mutation<T, A> mutation, Tier<T, A> leaf, Tier<T, A> nextLeaf) { Structure<T, A> structure = mutation.getStructure(); Stage<T, A> writer = structure.getStage(); writer.dirty(mutation.getStash(), leaf); writer.dirty(mutation.getStash(), nextLeaf); nextLeaf.setNext(leaf.getNext()); leaf.setNext(nextLeaf.getAddress()); }