ReftableReader is not thread-safe. Concurrent readers need their own
instance to read from the same file.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| pack-priv static final LongList | |
| private LongMap | |
| private long | |
| private BlockReader | |
| private long | |
| private long | |
| private long | |
| private long | |
| private long | |
| private int | |
| private BlockReader | |
| private long | |
| private long | |
| private long | |
| private BlockReader | |
| private long | |
| private final BlockSource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public LogCursor | allLogs()
Implements abstract org. Seek reader to read log records. |
| public RefCursor | allRefs()
Implements abstract org. Seek to the first reference, to iterate in order. |
| private BlockReader | |
| private int | |
| public int | Returns: the block size in bytes chosen for this file by the writer. Most reads from theorg. will be
aligned to the block size.Get the block size in bytes chosen for this file by the writer. |
| public RefCursor | byObjectId(AnyObjectId
object to find. id)Implements abstract org. Match references pointing to a specific object. |
| public void | close()
Implements java. Closes this resource, relinquishing any underlying resources. |
| public boolean | hasObjectMap()
Implements abstract org. Whether this reftable can do a fast SHA1 => ref lookup |
| private void | |
| private void | |
| private void | |
| public long | maxUpdateIndex()
Implements abstract org. Get the maximum update index for ref entries that appear in this reftable. |
| public long | minUpdateIndex()
Implements abstract org. Get the minimum update index for ref entries that appear in this reftable. |
| private BlockReader | |
| private int | |
| private void | |
| private void | |
| private byte[] | |
| private BlockReader | |
| private BlockReader | |
| public LogCursor | seekLog(String
exact name of the reference whose log to read. refName, long most recent index to return first in the log cursor. Log
records at or before updateIndex)updateIndex will be returned.Implements abstract org. Seek to an update index in a reference's log. |
| public RefCursor | seekRef(String
reference name. refName)Implements abstract org. Seek to a reference. |
| public RefCursor | seekRefsWithPrefix(String
prefix to find. prefix)Implements abstract org. Seek references with prefix. |
| public long |
| blockSize | back to summary |
|---|---|
| private int blockSize | |
| EMPTY_LONG_LIST | back to summary |
|---|---|
| pack-priv static final LongList EMPTY_LONG_LIST | |
| indexCache | back to summary |
|---|---|
| private LongMap<BlockReader> indexCache | |
| logEnd | back to summary |
|---|---|
| private long logEnd | |
| logIndex | back to summary |
|---|---|
| private BlockReader logIndex | |
| logIndexPosition | back to summary |
|---|---|
| private long logIndexPosition | |
| logPosition | back to summary |
|---|---|
| private long logPosition | |
| maxUpdateIndex | back to summary |
|---|---|
| private long maxUpdateIndex | |
| minUpdateIndex | back to summary |
|---|---|
| private long minUpdateIndex | |
| objEnd | back to summary |
|---|---|
| private long objEnd | |
| objIdLen | back to summary |
|---|---|
| private int objIdLen | |
| objIndex | back to summary |
|---|---|
| private BlockReader objIndex | |
| objIndexPosition | back to summary |
|---|---|
| private long objIndexPosition | |
| objPosition | back to summary |
|---|---|
| private long objPosition | |
| refEnd | back to summary |
|---|---|
| private long refEnd | |
| refIndex | back to summary |
|---|---|
| private BlockReader refIndex | |
| refIndexPosition | back to summary |
|---|---|
| private long refIndexPosition | |
| src | back to summary |
|---|---|
| private final BlockSource src | |
| ReftableReader | back to summary |
|---|---|
| public ReftableReader(BlockSource src) Initialize a new reftable reader.
| |
| allLogs | back to summary |
|---|---|
| public LogCursor allLogs() throws IOException Implements abstract org. Doc from org. Seek reader to read log records.
| |
| allRefs | back to summary |
|---|---|
| public RefCursor allRefs() throws IOException Implements abstract org. Doc from org. Seek to the first reference, to iterate in order.
| |
| binarySearch | back to summary |
|---|---|
| private BlockReader binarySearch(byte blockType, byte[] key, long startPos, long endPos) throws IOException | |
| blocksIn | back to summary |
|---|---|
| private int blocksIn(long pos, long end) | |
| blockSize | back to summary |
|---|---|
| public int blockSize() throws IOException Get the block size in bytes chosen for this file by the writer.
| |
| byObjectId | back to summary |
|---|---|
| public RefCursor byObjectId(AnyObjectId id) throws IOException Implements abstract org. Doc from org. Match references pointing to a specific object.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| hasObjectMap | back to summary |
|---|---|
| public boolean hasObjectMap() throws IOException Implements abstract org. Doc from org. Whether this reftable can do a fast SHA1 => ref lookup
| |
| initLogIndex | back to summary |
|---|---|
| private void initLogIndex() throws IOException | |
| initObjIndex | back to summary |
|---|---|
| private void initObjIndex() throws IOException | |
| initRefIndex | back to summary |
|---|---|
| private void initRefIndex() throws IOException | |
| maxUpdateIndex | back to summary |
|---|---|
| public long maxUpdateIndex() throws IOException Implements abstract org. Doc from org. Get the maximum update index for ref entries that appear in this reftable.
| |
| minUpdateIndex | back to summary |
|---|---|
| public long minUpdateIndex() throws IOException Implements abstract org. Doc from org. Get the minimum update index for ref entries that appear in this reftable.
| |
| readBlock | back to summary |
|---|---|
| private BlockReader readBlock(long pos, long end) throws IOException | |
| readBlockLen | back to summary |
|---|---|
| private int readBlockLen(long pos) throws IOException | |
| readFileFooter | back to summary |
|---|---|
| private void readFileFooter() throws IOException | |
| readFileHeader | back to summary |
|---|---|
| private void readFileHeader() throws IOException | |
| readHeaderOrFooter | back to summary |
|---|---|
| private byte[] readHeaderOrFooter(long pos, int len) throws IOException | |
| readIndex | back to summary |
|---|---|
| private BlockReader readIndex(long pos) throws IOException | |
| seek | back to summary |
|---|---|
| private BlockReader seek(byte blockType, byte[] key, BlockReader idx, long startPos, long endPos) throws IOException | |
| seekLog | back to summary |
|---|---|
| public LogCursor seekLog(String refName, long updateIndex) throws IOException Implements abstract org. Doc from org. Seek to an update index in a reference's log.
| |
| seekRef | back to summary |
|---|---|
| public RefCursor seekRef(String refName) throws IOException Implements abstract org. Doc from org. Seek to a reference.
This method will seek to the reference
| |
| seekRefsWithPrefix | back to summary |
|---|---|
| public RefCursor seekRefsWithPrefix(String prefix) throws IOException Implements abstract org. Doc from org. Seek references with prefix.
The method will seek all the references starting with
| |
| size | back to summary |
|---|---|
| public long size() throws IOException Get size of the reftable, in bytes.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv BlockReader | |
| private ReflogEntry | |
| private final byte[] | |
| private String | |
| private final long | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv | LogCursorImpl(long
end of the log data in the reftable. scanEnd, byte[] if non-null, limits the scan to precisely that refname. match)Scans logs from this table until scanEnd position. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| public ReflogEntry | getReflogEntry()
Implements abstract org. Get current log entry. |
| public String | getRefName()
Implements abstract org. Get name of the current reference. |
| public long | getUpdateIndex()
Implements abstract org. Get identifier of the transaction that created the log record. |
| public boolean | next()
Implements abstract org. Check if another log record is available. |
| block | back to summary |
|---|---|
| pack-priv BlockReader block | |
| entry | back to summary |
|---|---|
| private ReflogEntry entry | |
| match | back to summary |
|---|---|
| private final byte[] match | |
| refName | back to summary |
|---|---|
| private String refName | |
| scanEnd | back to summary |
|---|---|
| private final long scanEnd | |
| updateIndex | back to summary |
|---|---|
| private long updateIndex | |
| LogCursorImpl | back to summary |
|---|---|
| pack-priv LogCursorImpl(long scanEnd, byte[] match) Scans logs from this table until scanEnd position.
| |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| getReflogEntry | back to summary |
|---|---|
| public ReflogEntry getReflogEntry() Implements abstract org. Doc from org. Get current log entry.
| |
| getRefName | back to summary |
|---|---|
| public String getRefName() Implements abstract org. Doc from org. Get name of the current reference. | |
| getUpdateIndex | back to summary |
|---|---|
| public long getUpdateIndex() Implements abstract org. Doc from org. Get identifier of the transaction that created the log record.
| |
| next | back to summary |
|---|---|
| public boolean next() throws IOException Implements abstract org. Doc from org. Check if another log record is available.
| |
| Modifier and Type | Field and Description |
|---|---|
| private BlockReader | |
| private LongList | |
| private int | |
| private final ObjectId | |
| private Ref | |
| private final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| public Ref | getRef()
Implements abstract org. Get reference at the current position. |
| pack-priv void | |
| pack-priv void | |
| public boolean | next()
Implements abstract org. Check if another reference is available. |
| public void | seekPastPrefix(String
prefix that should be skipped. All previous refs before it
will be skipped. prefixName)Implements abstract org. Seeks forward to the first ref record lexicographically beyond
|
| block | back to summary |
|---|---|
| private BlockReader block | |
| blockPos | back to summary |
|---|---|
| private LongList blockPos | |
| listIdx | back to summary |
|---|---|
| private int listIdx | |
| match | back to summary |
|---|---|
| private final ObjectId match | |
| ref | back to summary |
|---|---|
| private Ref ref | |
| scanEnd | back to summary |
|---|---|
| private final long scanEnd | |
| ObjCursorImpl | back to summary |
|---|---|
| pack-priv ObjCursorImpl(long scanEnd, AnyObjectId id) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| getRef | back to summary |
|---|---|
| public Ref getRef() Implements abstract org. Doc from org. Get reference at the current position. | |
| initScan | back to summary |
|---|---|
| pack-priv void initScan() throws IOException | |
| initSeek | back to summary |
|---|---|
| pack-priv void initSeek() throws IOException | |
| next | back to summary |
|---|---|
| public boolean next() throws IOException Implements abstract org. Doc from org. Check if another reference is available.
| |
| seekPastPrefix | back to summary |
|---|---|
| public void seekPastPrefix(String prefixName) throws IOException Implements abstract org. Doc from org. Seeks forward to the first ref record lexicographically beyond
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv BlockReader | |
| private final byte[] | |
| private final boolean | |
| private Ref | |
| private final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| public Ref | getRef()
Implements abstract org. Get reference at the current position. |
| public boolean | next()
Implements abstract org. Check if another reference is available. |
| public void | seekPastPrefix(String
prefix that should be skipped. All previous refs before it
will be skipped. prefixName)Implements abstract org. Seeks forward to the first ref record lexicographically beyond
|
| block | back to summary |
|---|---|
| pack-priv BlockReader block | |
| match | back to summary |
|---|---|
| private final byte[] match | |
| prefix | back to summary |
|---|---|
| private final boolean prefix | |
| ref | back to summary |
|---|---|
| private Ref ref | |
| scanEnd | back to summary |
|---|---|
| private final long scanEnd | |
| RefCursorImpl | back to summary |
|---|---|
| pack-priv RefCursorImpl(long scanEnd, byte[] match, boolean prefix) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| getRef | back to summary |
|---|---|
| public Ref getRef() Implements abstract org. Doc from org. Get reference at the current position. | |
| next | back to summary |
|---|---|
| public boolean next() throws IOException Implements abstract org. Doc from org. Check if another reference is available.
| |
| seekPastPrefix | back to summary |
|---|---|
| public void seekPastPrefix(String prefixName) throws IOException Implements abstract org. Doc from org. Seeks forward to the first ref record lexicographically beyond
| |