A org.
merge-joins multiple
org. on the fly.
Tables higher/later in the stack shadow lower/earlier tables, hiding
references that been updated/replaced.
By default deleted references are skipped and not returned to the caller.
setIncludeDeletes(boolean) can be used to modify this behavior if
the caller needs to preserve deletions during partial compaction.
A MergedReftable is not thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | |
| private class | |
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final ReftableReader[] |
| Access | Constructor and Description |
|---|---|
| public | MergedReftable(List<ReftableReader>
stack of tables to read from. The base of the stack is at
index 0, the most recent should be at the top of the stack at
tableStack)tableStack.size() - 1. The top of the stack (higher
index) shadows the base of the stack (lower index).Initialize a merged table reader. |
| 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. |
| public RefCursor | byObjectId(AnyObjectId
object to find. name)Implements abstract org. Match references pointing to a specific object. |
| public boolean | hasObjectMap()
Implements abstract org. Whether this reftable can do a fast SHA1 => ref lookup |
| 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. |
| pack-priv int | |
| 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 updateIdx)updateIndex will be returned.Implements abstract org. Seek to an update index in a reference's log. |
| public RefCursor | seekRef(String
reference name. name)Implements abstract org. Seek to a reference. |
| public RefCursor | seekRefsWithPrefix(String
prefix to find. prefix)Implements abstract org. Seek references with prefix. |
| tables | back to summary |
|---|---|
| private final ReftableReader[] tables | |
| MergedReftable | back to summary |
|---|---|
| public MergedReftable(List<ReftableReader> tableStack) Initialize a merged table 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.
| |
| byObjectId | back to summary |
|---|---|
| public RefCursor byObjectId(AnyObjectId name) throws IOException Implements abstract org. Doc from org. Match references pointing to a specific object.
| |
| 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
| |
| 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.
| |
| queueSize | back to summary |
|---|---|
| pack-priv int queueSize() | |
| seekLog | back to summary |
|---|---|
| public LogCursor seekLog(String refName, long updateIdx) 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 name) 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
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Ref | |
| pack-priv final AnyObjectId |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Ref | getRef()
Overrides org. Get reference at the current position. |
| public boolean | next()
Overrides org. Check if another reference is available. |
| filteredRef | back to summary |
|---|---|
| pack-priv Ref filteredRef | |
| filterId | back to summary |
|---|---|
| pack-priv final AnyObjectId filterId | |
| FilteringMergedRefCursor | back to summary |
|---|---|
| pack-priv FilteringMergedRefCursor(AnyObjectId id) | |
| getRef | back to summary |
|---|---|
| public Ref getRef() Overrides org. Doc from org. Get reference at the current position. | |
| next | back to summary |
|---|---|
| public boolean next() throws IOException Overrides org. Doc from org. Check if another reference is available.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final LogCursor | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | |
| pack-priv long | |
| pack-priv String |
| lc | back to summary |
|---|---|
| pack-priv final LogCursor lc | |
| stackIdx | back to summary |
|---|---|
| pack-priv final int stackIdx | |
| LogQueueEntry | back to summary |
|---|---|
| pack-priv LogQueueEntry(LogCursor lc, int stackIdx) | |
| compare | back to summary |
|---|---|
| pack-priv static int compare(MergedReftable. | |
| index | back to summary |
|---|---|
| pack-priv long index() | |
| name | back to summary |
|---|---|
| pack-priv String name() | |
| Modifier and Type | Field and Description |
|---|---|
| private ReflogEntry | |
| private final PriorityQueue | |
| private String | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| 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. |
| private void |
| entry | back to summary |
|---|---|
| private ReflogEntry entry | |
| queue | back to summary |
|---|---|
| private final PriorityQueue<MergedReftable. | |
| refName | back to summary |
|---|---|
| private String refName | |
| updateIndex | back to summary |
|---|---|
| private long updateIndex | |
| MergedLogCursor | back to summary |
|---|---|
| pack-priv MergedLogCursor() | |
| add | back to summary |
|---|---|
| pack-priv void add(MergedReftable. | |
| 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.
| |
| skipShadowed | back to summary |
|---|---|
| private void skipShadowed(String name, long index) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private MergedReftable. | |
| private final PriorityQueue | |
| private Ref |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| 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. |
| private MergedReftable. | |
| 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
|
| private void |
| head | back to summary |
|---|---|
| private MergedReftable. | |
| queue | back to summary |
|---|---|
| private final PriorityQueue<MergedReftable. | |
| ref | back to summary |
|---|---|
| private Ref ref | |
| MergedRefCursor | back to summary |
|---|---|
| pack-priv MergedRefCursor() | |
| add | back to summary |
|---|---|
| pack-priv void add(MergedReftable. | |
| 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.
| |
| poll | back to summary |
|---|---|
| private MergedReftable. | |
| 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
| |
| skipShadowedRefs | back to summary |
|---|---|
| private void skipShadowedRefs(String name) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final RefCursor | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | |
| pack-priv String | |
| pack-priv long |
| rc | back to summary |
|---|---|
| pack-priv final RefCursor rc | |
| stackIdx | back to summary |
|---|---|
| pack-priv final int stackIdx | |
| RefQueueEntry | back to summary |
|---|---|
| pack-priv RefQueueEntry(RefCursor rc, int stackIdx) | |
| compare | back to summary |
|---|---|
| pack-priv static int compare(MergedReftable. | |
| name | back to summary |
|---|---|
| pack-priv String name() | |
| updateIndex | back to summary |
|---|---|
| pack-priv long updateIndex() | |