@InterfaceAudience.LimitedPrivate(value="coprocessor") @InterfaceStability.Evolving public class CompactionRequest extends Object implements Comparable<CompactionRequest>
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
|
int |
hashCode() |
boolean |
isAllFiles() |
boolean |
isMajor() |
boolean |
isOffPeak() |
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() |
void |
updateFiles(Collection<StoreFile> files) |
public CompactionRequest()
public CompactionRequest(Collection<StoreFile> files)
public void updateFiles(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
compactionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.