/** * Get the PackIndex for this PackFile. * * @param ctx * reader context to support reading from the backing store if * the index is not already loaded in memory. * @return the PackIndex. * @throws java.io.IOException * the pack index is not available, or is corrupt. */ public PackIndex getPackIndex(DfsReader ctx) throws IOException { return idx(ctx); }
long findOffset(DfsReader ctx, AnyObjectId id) throws IOException { return idx(ctx).findOffset(id); }
void resolve(DfsReader ctx, Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) throws IOException { idx(ctx).resolve(matches, id, matchLimit); }
/** * Obtain the total number of objects available in this pack. This method * relies on pack index, giving number of effectively available objects. * * @param ctx * current reader for the calling thread. * @return number of objects in index of this pack, likewise in this pack * @throws IOException * the index file cannot be loaded into memory. */ long getObjectCount(DfsReader ctx) throws IOException { return idx(ctx).getObjectCount(); }
long getObjectSize(DfsReader ctx, AnyObjectId id) throws IOException { final long offset = idx(ctx).findOffset(id); return 0 < offset ? getObjectSize(ctx, offset) : -1; }
/** * Check if an object is stored within this pack. * * @param ctx * reader context to support reading from the backing store if * the index is not already loaded in memory. * @param id * object to be located. * @return true if the object exists in this pack; false if it does not. * @throws java.io.IOException * the pack index is not available, or is corrupt. */ public boolean hasObject(DfsReader ctx, AnyObjectId id) throws IOException { final long offset = idx(ctx).findOffset(id); return 0 < offset && !isCorrupt(offset); }
private long findDeltaBase(DfsReader ctx, ObjectId baseId) throws IOException, MissingObjectException { long ofs = idx(ctx).findOffset(baseId); if (ofs < 0) throw new MissingObjectException(baseId, JGitText.get().missingDeltaBase); return ofs; }
/** * Get an object from this pack. * * @param ctx * temporary working space associated with the calling thread. * @param id * the object to obtain from the pack. Must not be null. * @return the object loader for the requested object if it is contained in * this pack; null if the object was not found. * @throws IOException * the pack file or the index could not be read. */ ObjectLoader get(DfsReader ctx, AnyObjectId id) throws IOException { long offset = idx(ctx).findOffset(id); return 0 < offset && !isCorrupt(offset) ? load(ctx, offset) : null; }
/** * Get the PackIndex for this PackFile. * * @param ctx * reader context to support reading from the backing store if * the index is not already loaded in memory. * @return the PackIndex. * @throws IOException * the pack index is not available, or is corrupt. */ public PackIndex getPackIndex(DfsReader ctx) throws IOException { return idx(ctx); }
/** * Get the PackIndex for this PackFile. * * @param ctx * reader context to support reading from the backing store if * the index is not already loaded in memory. * @return the PackIndex. * @throws java.io.IOException * the pack index is not available, or is corrupt. */ public PackIndex getPackIndex(DfsReader ctx) throws IOException { return idx(ctx); }
in = new BufferedInputStream(in, bs); idx = PackBitmapIndex.read( in, idx(ctx), getReverseIdx(ctx)); } finally { size = rc.position();
PackIndex idx = idx(ctx); PackReverseIndex revidx = new PackReverseIndex(idx); long cnt = idx.getObjectCount();
/** * Obtain the total number of objects available in this pack. This method * relies on pack index, giving number of effectively available objects. * * @param ctx * current reader for the calling thread. * @return number of objects in index of this pack, likewise in this pack * @throws IOException * the index file cannot be loaded into memory. */ long getObjectCount(DfsReader ctx) throws IOException { return idx(ctx).getObjectCount(); }
/** * Obtain the total number of objects available in this pack. This method * relies on pack index, giving number of effectively available objects. * * @param ctx * current reader for the calling thread. * @return number of objects in index of this pack, likewise in this pack * @throws IOException * the index file cannot be loaded into memory. */ long getObjectCount(DfsReader ctx) throws IOException { return idx(ctx).getObjectCount(); }
void resolve(DfsReader ctx, Set<ObjectId> matches, AbbreviatedObjectId id, int matchLimit) throws IOException { idx(ctx).resolve(matches, id, matchLimit); }
long getObjectSize(DfsReader ctx, AnyObjectId id) throws IOException { final long offset = idx(ctx).findOffset(id); return 0 < offset ? getObjectSize(ctx, offset) : -1; }
long getObjectSize(DfsReader ctx, AnyObjectId id) throws IOException { final long offset = idx(ctx).findOffset(id); return 0 < offset ? getObjectSize(ctx, offset) : -1; }
private long findDeltaBase(DfsReader ctx, ObjectId baseId) throws IOException, MissingObjectException { long ofs = idx(ctx).findOffset(baseId); if (ofs < 0) throw new MissingObjectException(baseId, JGitText.get().missingDeltaBase); return ofs; }
private long findDeltaBase(DfsReader ctx, ObjectId baseId) throws IOException, MissingObjectException { long ofs = idx(ctx).findOffset(baseId); if (ofs < 0) throw new MissingObjectException(baseId, JGitText.get().missingDeltaBase); return ofs; }