/** * Get the new objects that were sent by the user * * @return the new objects that were sent by the user */ public ObjectIdSubclassMap<ObjectId> getNewObjectIds() { if (newObjectIds != null) return newObjectIds; return new ObjectIdSubclassMap<>(); }
private void initTable(int sz) { grow = sz >> 1; mask = sz - 1; table = createArray(sz); }
/** * Store an object for future lookup. * <p> * An existing mapping for <b>must not</b> be in this map. Callers must * first call {@link #get(AnyObjectId)} to verify there is no current * mapping prior to adding a new mapping, or use * {@link #addIfAbsent(ObjectId)}. * * @param newValue * the object to store. */ public <Q extends V> void add(Q newValue) { if (++size == grow) grow(); insert(newValue); }
private RefCache read() throws DhtException, TimeoutException { RefList.Builder<DhtRef> id = new RefList.Builder<DhtRef>(); RefList.Builder<DhtRef> sym = new RefList.Builder<DhtRef>(); ObjectIdSubclassMap<IdWithChunk> hints = new ObjectIdSubclassMap<IdWithChunk>(); for (Map.Entry<RefKey, RefData> e : scan()) { DhtRef ref = fromData(e.getKey().getName(), e.getValue()); if (ref.isSymbolic()) sym.add(ref); id.add(ref); if (ref.getObjectId() instanceof IdWithChunk && !hints.contains(ref.getObjectId())) hints.add((IdWithChunk) ref.getObjectId()); if (ref.getPeeledObjectId() instanceof IdWithChunk && !hints.contains(ref.getPeeledObjectId())) hints.add((IdWithChunk) ref.getPeeledObjectId()); } id.sort(); sym.sort(); return new RefCache(id.toRefList(), sym.toRefList(), hints); }
baseObjectIds = new ObjectIdSubclassMap<>(); baseObjectIds.add(baseId);
if (baseObjects != null) { ow.sort(RevSort.TOPO); if (!baseObjects.isEmpty()) ow.sort(RevSort.BOUNDARY, true); ow.markUninteresting(o); if (baseObjects != null && !baseObjects.isEmpty()) { o = ow.peel(o); if (o instanceof RevCommit) if (providedObjects != null // && !providedObjects.contains(c)) throw new MissingObjectException(c, Constants.TYPE_COMMIT); if (providedObjects.contains(o)) continue; else
/** * {@inheritDoc} * <p> * Returns true if this map contains the specified object. */ @Override public boolean contains(AnyObjectId toFind) { return get(toFind) != null; }
private void addObjectAndTrack(PackedObjectInfo oe) { entries[entryCount++] = oe; if (needNewObjectIds()) newObjectIds.add(oe); }
boolean isSkippedCommit(AnyObjectId commit) { return skipCommits.contains(commit); }
/** * Create an empty map. */ public ObjectIdSubclassMap() { initTable(INITIAL_TABLE_SIZE); }
private void finishRefAndObjSections() throws IOException { if (cur != null && cur.blockType() == REF_BLOCK_TYPE) { refs.finishSectionMaybeWriteIndex(); if (indexObjects && !obj2ref.isEmpty() && refs.idx.bytes > 0) { writeObjBlocks(); } obj2ref = null; } }
private RefCache read() throws DhtException, TimeoutException { RefList.Builder<DhtRef> id = new RefList.Builder<DhtRef>(); RefList.Builder<DhtRef> sym = new RefList.Builder<DhtRef>(); ObjectIdSubclassMap<IdWithChunk> hints = new ObjectIdSubclassMap<IdWithChunk>(); for (Map.Entry<RefKey, RefData> e : scan()) { DhtRef ref = fromData(e.getKey().getName(), e.getValue()); if (ref.isSymbolic()) sym.add(ref); id.add(ref); if (ref.getObjectId() instanceof IdWithChunk && !hints.contains(ref.getObjectId())) hints.add((IdWithChunk) ref.getObjectId()); if (ref.getPeeledObjectId() instanceof IdWithChunk && !hints.contains(ref.getPeeledObjectId())) hints.add((IdWithChunk) ref.getPeeledObjectId()); } id.sort(); sym.sort(); return new RefCache(id.toRefList(), sym.toRefList(), hints); }
baseObjectIds = new ObjectIdSubclassMap<ObjectId>(); baseObjectIds.add(baseId);
if (baseObjects != null) { ow.sort(RevSort.TOPO); if (!baseObjects.isEmpty()) ow.sort(RevSort.BOUNDARY, true); ow.markUninteresting(o); if (baseObjects != null && !baseObjects.isEmpty()) { o = ow.peel(o); if (o instanceof RevCommit) if (providedObjects != null // && !providedObjects.contains(c)) throw new MissingObjectException(c, Constants.TYPE_COMMIT); if (providedObjects.contains(o)) continue; else
/** * Returns true if this map contains the specified object. * * @param toFind * object to find. * @return true if the mapping exists for this object; false otherwise. */ public boolean contains(final AnyObjectId toFind) { return get(toFind) != null; }
private void addObjectAndTrack(PackedObjectInfo oe) { entries[entryCount++] = oe; if (needNewObjectIds()) newObjectIds.add(oe); }