/** * Adds or replaces an element in the tree with the given node. * <p> * <!-- Implementation detail: If the number of cached entries (entries held directly by this * tree) reaches {@link #DEFAULT_NORMALIZATION_THRESHOLD}, this tree will {@link #normalize()} * itself. * * --> * * @param node The {@link org.locationtech.geogig.model.Node Node} to add or replace. * @return a reference to this {@link org.locationtech.geogig.model.impl.RevTreeBuilder * RevTreeBuilder} */ public synchronized boolean put(final Node node) { Preconditions.checkNotNull(node, "node can't be null"); putInternal(node); if (numPendingChanges() >= this.normalizationThreshold) { // hit the split factor modification tolerance, lets normalize normalize(); } return true; }
RevTree tree; final int numPendingChanges = numPendingChanges(); if (bucketTreesByBucket.isEmpty() && numPendingChanges <= CanonicalNodeNameOrder.normalizedSizeLimit(this.depth)) {
/** * Adds or replaces an element in the tree with the given node. * <p> * <!-- Implementation detail: If the number of cached entries (entries held directly by this * tree) reaches {@link #DEFAULT_NORMALIZATION_THRESHOLD}, this tree will {@link #normalize()} * itself. * * --> * * @param node The {@link org.locationtech.geogig.model.Node Node} to add or replace. * @return a reference to this {@link org.locationtech.geogig.model.RevTreeBuilder * RevTreeBuilder} */ public synchronized boolean put(final Node node) { Preconditions.checkNotNull(node, "node can't be null"); putInternal(node); if (numPendingChanges() >= this.normalizationThreshold) { // hit the split factor modification tolerance, lets normalize normalize(); } return true; }
RevTree tree; final int numPendingChanges = numPendingChanges(); if (bucketTreesByBucket.isEmpty() && numPendingChanges <= CanonicalNodeNameOrder.normalizedSizeLimit(this.depth)) {