public class CompactionMap extends Object
CompactionMap is a composite of multiple PartialCompactionMap
instances. Operations performed on this map are delegated back to the individual
maps.| Modifier and Type | Field and Description |
|---|---|
static CompactionMap |
EMPTY
An empty map.
|
| Modifier and Type | Method and Description |
|---|---|
CompactionMap |
cons(PartialCompactionMap head)
Create a new
CompactionMap containing all maps
of this instances and additional the passed map head. |
RecordId |
get(RecordId before)
Retrieve the record id
before maps to or null
if no such id exists. |
int |
getDepth()
The depth of the compaction map is the number of partial compaction maps
this map consists of.
|
long[] |
getEstimatedWeights()
The weight of the compaction map is its memory consumption bytes
|
int |
getGeneration() |
long[] |
getRecordCounts()
Number of records referenced by the keys in this map.
|
long[] |
getSegmentCounts()
Number of segments referenced by the keys in this map.
|
void |
remove(Set<UUID> uuids)
Remove all keys from this map where
keys.contains(key.asUUID()). |
static long |
sum(long[] longs)
Java's lacking libraries...
|
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. |
public static final CompactionMap EMPTY
public 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 afterpublic boolean wasCompacted(@Nonnull UUID id)
id - segment identifier@CheckForNull public RecordId get(@Nonnull RecordId before)
before maps to or null
if no such id exists.before - before record idnullpublic void remove(@Nonnull Set<UUID> uuids)
keys.contains(key.asUUID()).uuids - uuids of the keys to remove@Nonnull public CompactionMap cons(@Nonnull PartialCompactionMap head)
CompactionMap containing all maps
of this instances and additional the passed map head.head - CompactionMap instancepublic static long sum(long[] longs)
longs - longspublic int getDepth()
cons(PartialCompactionMap)public int getGeneration()
public long[] getEstimatedWeights()
public long[] getSegmentCounts()
public long[] getRecordCounts()
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.