| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv DfsBlockCache | |
| private boolean | |
| pack-priv int | |
| pack-priv final DfsObjDatabase | |
| private static final int | INDEX_VERSION
Always produce version 2 indexes, to get CRC data. |
| private final int | |
| pack-priv List | |
| pack-priv ObjectIdOwnerMap | |
| pack-priv DfsPackDescription | |
| pack-priv DfsStreamKey | |
| pack-priv DfsInserter. | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private long | |
| private void | |
| public void | checkExisting(boolean
if check)false, will write out possibly-duplicate objects
without first checking whether they exist in the repo; default
is true.Check existence |
| private void | |
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| private ObjectId | |
| public void | flush()
Implements abstract org. Make all inserted objects visible. |
| private static void | |
| public ObjectId | insert(int
type code of the object to store. type, byte[] complete content of the object. data, int first position within off, int data.number of bytes to copy from len)data.Overrides org. Insert a single object into the store, returning its unique name. |
| public ObjectId | insert(int
type code of the object to store. type, long number of bytes to copy from len, InputStream in.stream providing the object content. The caller is responsible
for closing the stream. in)Implements abstract org. Insert a single object into the store, returning its unique name. |
| private byte[] | |
| private TemporaryBuffer. | |
| public DfsPackParser | newPackParser(InputStream
the input stream. The stream is not closed by the parser, and
must instead be closed by the caller once parsing is complete. in)Implements abstract org. Initialize a parser to read from a pack formatted stream. |
| public ObjectReader | newReader()
Implements abstract org. Open a reader for objects that may have been written by this inserter. |
| pack-priv void | |
| private void | |
| pack-priv void | |
| pack-priv PackIndex |
| cache | back to summary |
|---|---|
| pack-priv DfsBlockCache cache | |
| checkExisting | back to summary |
|---|---|
| private boolean checkExisting | |
| compression | back to summary |
|---|---|
| pack-priv int compression | |
| db | back to summary |
|---|---|
| pack-priv final DfsObjDatabase db | |
| INDEX_VERSION | back to summary |
|---|---|
| private static final int INDEX_VERSION Always produce version 2 indexes, to get CRC data. | |
| minBytesForObjectSizeIndex | back to summary |
|---|---|
| private final int minBytesForObjectSizeIndex | |
| objectList | back to summary |
|---|---|
| pack-priv List<PackedObjectInfo> objectList | |
| objectMap | back to summary |
|---|---|
| pack-priv ObjectIdOwnerMap<PackedObjectInfo> objectMap | |
| packDsc | back to summary |
|---|---|
| pack-priv DfsPackDescription packDsc | |
| packKey | back to summary |
|---|---|
| pack-priv DfsStreamKey packKey | |
| packOut | back to summary |
|---|---|
| pack-priv DfsInserter. | |
| rollback | back to summary |
|---|---|
| private boolean rollback | |
| DfsInserter | back to summary |
|---|---|
| protected DfsInserter(DfsObjDatabase db) Initialize a new inserter.
| |
| beginObject | back to summary |
|---|---|
| private long beginObject(int type, long len) throws IOException | |
| beginPack | back to summary |
|---|---|
| private void beginPack() throws IOException | |
| checkExisting | back to summary |
|---|---|
| public void checkExisting(boolean check) Check existence
| |
| clear | back to summary |
|---|---|
| private void clear() | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Release any resources used by this inserter. An inserter that has been released can be used again, but may need to be released after the subsequent usage.
| |
| endObject | back to summary |
|---|---|
| private ObjectId endObject(ObjectId id, long offset, long inflatedSize, int type) | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract org. Doc from org. Make all inserted objects visible. The flush may take some period of time to make the objects available to other threads.
| |
| index | back to summary |
|---|---|
| private static void index(OutputStream out, byte[] packHash, List<PackedObjectInfo> list) throws IOException | |
| insert | back to summary |
|---|---|
| public ObjectId insert(int type, byte[] data, int off, int len) throws IOException Overrides org. Doc from org. Insert a single object into the store, returning its unique name.
| |
| insert | back to summary |
|---|---|
| public ObjectId insert(int type, long len, InputStream in) throws IOException Implements abstract org. Doc from org. Insert a single object into the store, returning its unique name.
| |
| insertBuffer | back to summary |
|---|---|
| private byte[] insertBuffer(long len) | |
| maybeGetTemporaryBuffer | back to summary |
|---|---|
private TemporaryBuffer.
| |
| newPackParser | back to summary |
|---|---|
| public DfsPackParser newPackParser(InputStream in) throws IOException Implements abstract org. Doc from org. Initialize a parser to read from a pack formatted stream.
| |
| newReader | back to summary |
|---|---|
| public ObjectReader newReader() Implements abstract org. Doc from org. Open a reader for objects that may have been written by this inserter.
The returned reader allows the calling thread to read back recently
inserted objects without first calling
The returned reader should return this inserter instance from
Behavior is undefined if an insert method is called on the inserter in the
middle of reading from an
| |
| setCompressionLevel | back to summary |
|---|---|
| pack-priv void setCompressionLevel(int compression) | |
| sortObjectsById | back to summary |
|---|---|
| private void sortObjectsById() | |
| writeObjectSizeIndex | back to summary |
|---|---|
| pack-priv void writeObjectSizeIndex(DfsPackDescription pack, List<PackedObjectInfo> packedObjs) throws IOException | |
| writePackIndex | back to summary |
|---|---|
| pack-priv PackIndex writePackIndex(DfsPackDescription pack, byte[] packHash, List<PackedObjectInfo> list) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| pack-priv final DeflaterOutputStream | |
| pack-priv final CRC32 | |
| private byte[] | |
| private long | |
| private int | |
| private final Deflater | |
| pack-priv final byte[] | |
| private final MessageDigest | |
| private final DfsOutputStream |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| private byte[] | |
| private int | |
| private void | |
| pack-priv long | |
| private DfsBlock | |
| pack-priv byte[] | |
| pack-priv int | |
| private int | |
| private long | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[]
the data. data, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| private void | |
| pack-priv byte[] |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| compress | back to summary |
|---|---|
| pack-priv final DeflaterOutputStream compress | |
| crc32 | back to summary |
|---|---|
| pack-priv final CRC32 crc32 | |
| currBuf | back to summary |
|---|---|
| private byte[] currBuf | |
| currPos | back to summary |
|---|---|
| private long currPos | |
| currPtr | back to summary |
|---|---|
| private int currPtr | |
| deflater | back to summary |
|---|---|
| private final Deflater deflater | |
| hdrBuf | back to summary |
|---|---|
| pack-priv final byte[] hdrBuf | |
| md | back to summary |
|---|---|
| private final MessageDigest md | |
| out | back to summary |
|---|---|
| private final DfsOutputStream out | |
| PackStream | back to summary |
|---|---|
| pack-priv PackStream(DfsOutputStream out) | |
| beginObject | back to summary |
|---|---|
| pack-priv void beginObject(int objectType, long length) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| copyOf | back to summary |
|---|---|
| private byte[] copyOf(byte[] src, int ptr, int cnt) | |
| encodeTypeSize | back to summary |
|---|---|
| private int encodeTypeSize(int type, long rawLength) | |
| flushBlock | back to summary |
|---|---|
| private void flushBlock() throws IOException | |
| getCount | back to summary |
|---|---|
| pack-priv long getCount() | |
| getOrLoadBlock | back to summary |
|---|---|
| private DfsBlock getOrLoadBlock(long pos) throws IOException | |
| inflate | back to summary |
|---|---|
| pack-priv byte[] inflate(DfsReader ctx, long pos, int len) throws IOException, DataFormatException | |
| read | back to summary |
|---|---|
| pack-priv int read(long pos, byte[] dst, int ptr, int cnt) throws IOException | |
| setInput | back to summary |
|---|---|
| private int setInput(long pos, Inflater inf) throws IOException, DataFormatException | |
| toBlockStart | back to summary |
|---|---|
| private long toBlockStart(long pos) | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] data, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| writeNoHash | back to summary |
|---|---|
| private void writeNoHash(byte[] data, int off, int len) throws IOException | |
| writePackFooter | back to summary |
|---|---|
| pack-priv byte[] writePackFooter() throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(byte[]
the buffer into which the data is read. buf, int the start offset in array ptr, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| pos | back to summary |
|---|---|
| private long pos | |
| ReadBackStream | back to summary |
|---|---|
| pack-priv ReadBackStream(long offset) | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] buf, int ptr, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| Modifier and Type | Field and Description |
|---|---|
| private final DfsReader |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| public ObjectInserter | getCreatedFromInserter()
Overrides org. Get the |
| public Set | getShallowCommits()
Implements abstract org. Returns IDs for those commits which should be considered as shallow. |
| public boolean | has(AnyObjectId
identity of the object to test for existence of. objectId)Overrides org. Does the requested object exist in this database? |
| private byte[] | |
| public ObjectReader | newReader()
Implements abstract org. Construct a new reader from the same data. |
| public ObjectLoader | open(AnyObjectId
identity of the object to open. objectId, int hint about the type of object being requested, e.g.
typeHint)org.;
OBJ_ANY if the object type is not known, or does not
matter to the caller.Implements abstract org. Open an object from this database. |
| public Collection | resolve(AbbreviatedObjectId
abbreviated id to resolve to a complete identity. The
abbreviation must have a length of at least 2. id)Implements abstract org. Resolve an abbreviated ObjectId to its full form. |
| ctx | back to summary |
|---|---|
| private final DfsReader ctx | |
| Reader | back to summary |
|---|---|
| private Reader() | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Release any resources used by this reader. A reader that has been released can be used again, but may need to be released after the subsequent usage.
| |
| getCreatedFromInserter | back to summary |
|---|---|
| public ObjectInserter getCreatedFromInserter() Overrides org. Doc from org. Get the
| |
| getShallowCommits | back to summary |
|---|---|
| public Set Implements abstract org. Doc from org. Returns IDs for those commits which should be considered as shallow.
| |
| has | back to summary |
|---|---|
| public boolean has(AnyObjectId objectId) throws IOException Overrides org. Doc from org. Does the requested object exist in this database?
| |
| inflate | back to summary |
|---|---|
| private byte[] inflate(PackedObjectInfo obj, long zpos, int sz) throws IOException, CorruptObjectException | |
| newReader | back to summary |
|---|---|
| public ObjectReader newReader() Implements abstract org. Doc from org. Construct a new reader from the same data. Applications can use this method to build a new reader from the same data source, but for an different thread.
| |
| open | back to summary |
|---|---|
| public ObjectLoader open(AnyObjectId objectId, int typeHint) throws IOException Implements abstract org. Doc from org. Open an object from this database.
| |
| resolve | back to summary |
|---|---|
| public Collection Implements abstract org. Doc from org. Resolve an abbreviated ObjectId to its full form. This method searches for an ObjectId that begins with the abbreviation, and returns at least some matching candidates. If the returned collection is empty, no objects start with this abbreviation. The abbreviation doesn't belong to this repository, or the repository lacks the necessary objects to complete it. If the collection contains exactly one member, the abbreviation is (currently) unique within this database. There is a reasonably high probability that the returned id is what was previously abbreviated. If the collection contains 2 or more members, the abbreviation is not unique. In this case the implementation is only required to return at least 2 candidates to signal the abbreviation has conflicts. User friendly implementations should return as many candidates as reasonably possible, as the caller may be able to disambiguate further based on context. However since databases can be very large (e.g. 10 million objects) returning 625,000 candidates for the abbreviation "0" is simply unreasonable, so implementors should draw the line at around 256 matches.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectId | |
| private final long | |
| private final long | |
| private final DfsStreamKey | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | getCachedBytes()
Implements abstract org. Obtain a reference to the (possibly cached) bytes of this object. |
| public long | |
| public int | |
| public boolean | isLarge()
Overrides org. Whether this object is too large to obtain as a byte array. |
| public ObjectStream | openStream()
Implements abstract org. Obtain an input stream to read this object's data. |
| id | back to summary |
|---|---|
| private final ObjectId id | |
| pos | back to summary |
|---|---|
| private final long pos | |
| size | back to summary |
|---|---|
| private final long size | |
| srcPack | back to summary |
|---|---|
| private final DfsStreamKey srcPack | |
| type | back to summary |
|---|---|
| private final int type | |
| StreamLoader | back to summary |
|---|---|
| pack-priv StreamLoader(ObjectId id, int type, long sz, DfsStreamKey key, long pos) | |
| getCachedBytes | back to summary |
|---|---|
| public byte[] getCachedBytes() throws LargeObjectException Implements abstract org. Doc from org. Obtain a reference to the (possibly cached) bytes of this object. This method offers direct access to the internal caches, potentially saving on data copies between the internal cache and higher level code. Callers who receive this reference must not modify its contents. Changes (if made) will affect the cache but not the repository itself.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Implements abstract org. Doc from org. Get size of object in bytes
| |
| getType | back to summary |
|---|---|
| public int getType() Implements abstract org. Doc from org. Get Git in pack object type
| |
| isLarge | back to summary |
|---|---|
| public boolean isLarge() Overrides org. Doc from org. Whether this object is too large to obtain as a byte array.
| |
| openStream | back to summary |
|---|---|
| public ObjectStream openStream() throws IOException Implements abstract org. Doc from org. Obtain an input stream to read this object's data.
| |