@InterfaceAudience.LimitedPrivate(value="coprocessor") @InterfaceStability.Evolving public class CompactionRequest extends Object implements Comparable<CompactionRequest>
Modifier and Type | Class and Description |
---|---|
private static class |
CompactionRequest.DisplayCompactionType |
Modifier and Type | Field and Description |
---|---|
private Collection<StoreFile> |
filesToCompact |
private CompactionRequest.DisplayCompactionType |
isMajor |
private boolean |
isOffPeak |
private static org.apache.commons.logging.Log |
LOG |
private int |
priority |
private String |
regionName |
private long |
selectionTime |
private String |
storeName |
private Long |
timeInNanos |
private long |
totalSize |
Constructor and Description |
---|
CompactionRequest()
This ctor should be used by coprocessors that want to subclass CompactionRequest.
|
CompactionRequest(Collection<StoreFile> files) |
Modifier and Type | Method and Description |
---|---|
void |
afterExecute()
Called after compaction is executed by CompactSplitThread; for use by coproc subclasses.
|
void |
beforeExecute()
Called before compaction is executed by CompactSplitThread; for use by coproc subclasses.
|
CompactionRequest |
combineWith(CompactionRequest other)
Combines the request with other request.
|
int |
compareTo(CompactionRequest request)
This function will define where in the priority queue the request will
end up.
|
boolean |
equals(Object obj) |
Collection<StoreFile> |
getFiles() |
int |
getPriority()
Gets the priority for the request
|
long |
getSelectionTime() |
long |
getSize()
Gets the total size of all StoreFiles in compaction
|
boolean |
isAllFiles() |
boolean |
isMajor() |
boolean |
isOffPeak() |
private void |
recalculateSize()
Recalculate the size of the compaction based on current files.
|
void |
setDescription(String regionName,
String storeName)
Sets the region/store name, for logging.
|
void |
setIsMajor(boolean isMajor,
boolean isAllFiles)
Specify if this compaction should be a major compaction based on the state of the store
|
void |
setOffPeak(boolean value) |
void |
setPriority(int p)
Sets the priority for the request
|
String |
toString() |
private static final org.apache.commons.logging.Log LOG
private boolean isOffPeak
private CompactionRequest.DisplayCompactionType isMajor
private int priority
private Collection<StoreFile> filesToCompact
private long selectionTime
private Long timeInNanos
private String regionName
private String storeName
private long totalSize
public CompactionRequest()
public CompactionRequest(Collection<StoreFile> files)
public void beforeExecute()
public void afterExecute()
public CompactionRequest combineWith(CompactionRequest other)
other
- Request to combine with.public int compareTo(CompactionRequest request)
Note: The enqueue timestamp is accurate to the nanosecond. if two requests have same timestamp then this function will break the tie arbitrarily with hashCode() comparing.
compareTo
in interface Comparable<CompactionRequest>
public Collection<StoreFile> getFiles()
public void setDescription(String regionName, String storeName)
public long getSize()
public boolean isAllFiles()
public boolean isMajor()
public int getPriority()
public void setPriority(int p)
public boolean isOffPeak()
public void setOffPeak(boolean value)
public long getSelectionTime()
public void setIsMajor(boolean isMajor, boolean isAllFiles)
isMajor
- true if the system determines that this compaction should be a major
compactionprivate void recalculateSize()
files
- files that should be included in the compactionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.