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() |
RefCursor |
byObjectId(AnyObjectId id)
Match references pointing to a specific object.
|
void |
close() |
long |
maxUpdateIndex() |
long |
minUpdateIndex() |
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
Reftable
allRefs
in class Reftable
IOException
- if references cannot be read.public RefCursor seekRef(String refName) throws IOException
Reftable
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 Reftable
refName
- reference name or subtree to find.IOException
- if references cannot be read.public RefCursor byObjectId(AnyObjectId id) throws IOException
Reftable
byObjectId
in class Reftable
id
- object to find.IOException
- if references cannot be read.public LogCursor allLogs() throws IOException
Reftable
allLogs
in class Reftable
IOException
- if logs cannot be read.public LogCursor seekLog(String refName, long updateIndex) throws IOException
Reftable
seekLog
in class Reftable
refName
- 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 AutoCloseable
close
in class Reftable
IOException
Copyright © 2018 Eclipse JGit Project. All rights reserved.