For a partial compaction callers should setIncludeDeletes(boolean)
to true to ensure the new reftable continues to use a delete marker
to shadow any lower reftable that may have the reference present.
By default all log entries within the range defined by
setReflogExpireMinUpdateIndex(long) and setReflogExpireMaxUpdateIndex(long) are
copied, even if no references in the output file match the log records.
Callers may truncate the log to a more recent time horizon with
setReflogExpireOldestReflogTimeMillis(long), or disable the log altogether with
setOldestReflogTimeMillis(Long.MAX_VALUE).
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private long | |
| private long | |
| private long | |
| private ReftableWriter. | |
| private final ArrayDeque | |
| private final ReftableWriter |
| Access | Constructor and Description |
|---|---|
| public | ReftableCompactor(OutputStream
stream to write the compacted tables to. Caller is responsible
for closing out)out.Creates a new compactor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAll(List<ReftableReader>
tables to compact. Tables should be ordered oldest first/most
recent last so that the more recent tables can shadow the
older results. Caller is responsible for closing the readers. readers)Add all of the tables, in the specified order. |
| public void | |
| public ReftableWriter. | Returns: statistics of the last written reftable.Get statistics of the last written reftable. |
| private void | |
| private void | |
| public ReftableCompactor | Returns: thisconfiguration for the reftable. cfg)Set configuration for the reftable. |
| public ReftableCompactor | Returns: thistrue to include deletions in the output, which may be
necessary for partial compaction.Whether to include deletions in the output, which may be necessary for partial compaction. |
| public ReftableCompactor | Returns: thisthe maximum update index for log entries that appear in the
compacted reftable. This should be at least 1 higher than the
prior reftable's max)maxUpdateIndex if this table will be
used in a stack.Set the maximum update index for log entries that appear in the compacted reftable. |
| public ReftableCompactor | Returns: thisthe minimum update index for log entries that appear in the
compacted reftable. This should be 1 higher than the prior
reftable's min)maxUpdateIndex if this table will be used
in a stack.Set the minimum update index for log entries that appear in the compacted reftable. |
| public ReftableCompactor | Returns: thisoldest log time to preserve. Entries whose timestamps are
timeMillis)>= timeMillis will be copied into the output file. Log
entries that predate timeMillis will be discarded.
Specified in Java standard milliseconds since the epoch.Set oldest reflog time to preserve. |
| includeDeletes | back to summary |
|---|---|
| private boolean includeDeletes | |
| reflogExpireMaxUpdateIndex | back to summary |
|---|---|
| private long reflogExpireMaxUpdateIndex | |
| reflogExpireMinUpdateIndex | back to summary |
|---|---|
| private long reflogExpireMinUpdateIndex | |
| reflogExpireOldestReflogTimeMillis | back to summary |
|---|---|
| private long reflogExpireOldestReflogTimeMillis | |
| stats | back to summary |
|---|---|
| private ReftableWriter. | |
| tables | back to summary |
|---|---|
| private final ArrayDeque<ReftableReader> tables | |
| writer | back to summary |
|---|---|
| private final ReftableWriter writer | |
| ReftableCompactor | back to summary |
|---|---|
| public ReftableCompactor(OutputStream out) Creates a new compactor.
| |
| addAll | back to summary |
|---|---|
| public void addAll(List<ReftableReader> readers) throws IOException Add all of the tables, in the specified order.
| |
| compact | back to summary |
|---|---|
| public void compact() throws IOException Write a compaction to
| |
| getStats | back to summary |
|---|---|
| public ReftableWriter. Get statistics of the last written reftable.
| |
| mergeLogs | back to summary |
|---|---|
| private void mergeLogs(MergedReftable mr) throws IOException | |
| mergeRefs | back to summary |
|---|---|
| private void mergeRefs(MergedReftable mr) throws IOException | |
| setConfig | back to summary |
|---|---|
| public ReftableCompactor setConfig(ReftableConfig cfg) Set configuration for the reftable.
| |
| setIncludeDeletes | back to summary |
|---|---|
| public ReftableCompactor setIncludeDeletes(boolean deletes) Whether to include deletions in the output, which may be necessary for partial compaction.
| |
| setReflogExpireMaxUpdateIndex | back to summary |
|---|---|
| public ReftableCompactor setReflogExpireMaxUpdateIndex(long max) Set the maximum update index for log entries that appear in the compacted reftable.
| |
| setReflogExpireMinUpdateIndex | back to summary |
|---|---|
| public ReftableCompactor setReflogExpireMinUpdateIndex(long min) Set the minimum update index for log entries that appear in the compacted reftable.
| |
| setReflogExpireOldestReflogTimeMillis | back to summary |
|---|---|
| public ReftableCompactor setReflogExpireOldestReflogTimeMillis(long timeMillis) Set oldest reflog time to preserve.
| |