public interface PartialCompactionMap
PartialCompactionMap maps uncompacted to compacted record ids
from a single compaction cycle.CompactionMap| Modifier and Type | Method and Description |
|---|---|
void |
compress()
Compressing this map ensures it takes up as little heap as possible.
|
RecordId |
get(RecordId before)
Retrieve the record id
before maps to or null
if no such id exists. |
long |
getEstimatedWeight()
The weight of the compaction map is its heap memory consumption in bytes.
|
long |
getRecordCount()
Number of records referenced by the keys in this map.
|
long |
getSegmentCount()
Number of segments referenced by the keys in this map.
|
boolean |
isEmpty()
Determine whether this map contains keys at all.
|
void |
put(RecordId before,
RecordId after)
Adds a new entry to the compaction map.
|
void |
remove(Set<UUID> uuids)
Remove all keys from this map where
keys.contains(key.asUUID()). |
boolean |
wasCompacted(UUID id)
Checks whether content in the segment with the given identifier was
compacted to new segments.
|
boolean |
wasCompactedTo(RecordId before,
RecordId after)
Checks whether the record with the given
before identifier was
compacted to a new record with the given after identifier. |
boolean wasCompactedTo(@Nonnull RecordId before, @Nonnull RecordId after)
before identifier was
compacted to a new record with the given after identifier.before - before record identifierafter - after record identifierbefore was compacted to afterboolean wasCompacted(@Nonnull UUID id)
id - segment identifier@CheckForNull RecordId get(@Nonnull RecordId before)
before maps to or null
if no such id exists.before - before record idnullvoid put(@Nonnull RecordId before, @Nonnull RecordId after)
before - before record idafter - after record idIllegalArgumentException - if before already exists in the mapvoid remove(@Nonnull Set<UUID> uuids)
keys.contains(key.asUUID()).uuids - uuids of the keys to removevoid compress()
long getSegmentCount()
long getRecordCount()
boolean isEmpty()
true iff this map is emptylong getEstimatedWeight()
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.