public class ReftableReader extends Reftable
ReftableReader is not thread-safe. Concurrent readers need their own
instance to read from the same file.
includeDeletes| Constructor and Description |
|---|
ReftableReader(BlockSource src)
Initialize a new reftable reader.
|
| Modifier and Type | Method and Description |
|---|---|
LogCursor |
allLogs()
Seek reader to read log records.
|
RefCursor |
allRefs()
Seek to the first reference, to iterate in order.
|
int |
blockSize()
Get the block size in bytes chosen for this file by the writer.
|
RefCursor |
byObjectId(AnyObjectId id)
Match references pointing to a specific object.
|
void |
close() |
long |
maxUpdateIndex()
Get the maximum update index for log entries that appear in this
reftable.
|
long |
minUpdateIndex()
Get the minimum update index for log entries that appear in this
reftable.
|
LogCursor |
seekLog(String refName,
long updateIndex)
Seek to an update index in a reference's log.
|
RefCursor |
seekRef(String refName)
Seek either to a reference, or a reference subtree.
|
long |
size()
Get size of the reftable, in bytes.
|
public ReftableReader(BlockSource src)
src - the file content to read.public int blockSize()
throws IOException
BlockSource will be
aligned to the block size.IOException - file cannot be read.public long minUpdateIndex()
throws IOException
maxUpdateIndex if this table is used in a stack.IOException - file cannot be read.public long maxUpdateIndex()
throws IOException
maxUpdateIndex if this table is used in a stack.IOException - file cannot be read.public RefCursor allRefs() throws IOException
allRefs in class ReftableIOException - if references cannot be read.public RefCursor seekRef(String refName) throws IOException
If refName ends with "/" the method will seek to the
subtree of all references starting with refName as a prefix. If
no references start with this prefix, an empty cursor is returned.
Otherwise exactly refName will be looked for. If present, the
returned cursor will iterate exactly one entry. If not found, an empty
cursor is returned.
seekRef in class ReftablerefName - reference name or subtree to find.IOException - if references cannot be read.public RefCursor byObjectId(AnyObjectId id) throws IOException
byObjectId in class Reftableid - object to find.IOException - if references cannot be read.public LogCursor allLogs() throws IOException
allLogs in class ReftableIOException - if logs cannot be read.public LogCursor seekLog(String refName, long updateIndex) throws IOException
seekLog in class ReftablerefName - exact name of the reference whose log to read.updateIndex - most recent index to return first in the log cursor. Log
records at or before updateIndex will be returned.IOException - if logs cannot be read.public long size()
throws IOException
IOException - size cannot be obtained.public void close()
throws IOException
close in interface AutoCloseableclose in class ReftableIOExceptionCopyright © 2018 Eclipse JGit Project. All rights reserved.