|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.compactions.CompactionRequest
public class CompactionRequest
This class holds all details necessary to run a compaction.
Nested Class Summary | |
---|---|
static class |
CompactionRequest.CompactionState
An enum for the region compaction state |
static class |
CompactionRequest.Rejection
Cleanup class to use when rejecting a compaction request from the queue. |
Constructor Summary | |
---|---|
CompactionRequest(HRegion r,
Store s,
CompactSelection files,
boolean isMajor,
int p)
|
|
CompactionRequest(HRegion region,
Store store,
int priority)
Constructor for a custom compaction. |
Method Summary | |
---|---|
int |
compareTo(CompactionRequest request)
This function will define where in the priority queue the request will end up. |
void |
finishRequest()
|
static CompactionRequest.CompactionState |
getCompactionState(long regionId)
Find out if a given region in compaction now. |
CompactSelection |
getCompactSelection()
Gets the compact selection object for the request |
List<StoreFile> |
getFiles()
Gets the StoreFiles for the request |
HRegion |
getHRegion()
Gets the HRegion for the request |
int |
getPriority()
Gets the priority for the request |
static CompactionRequest |
getRequestForTesting(Store store,
org.apache.hadoop.conf.Configuration conf,
Collection<StoreFile> selection,
boolean isMajor)
Create a simple compaction request just for testing - this lets you specify everything you would need in the general case of testing compactions from an external perspective (e.g. |
long |
getSize()
Gets the total size of all StoreFiles in compaction |
Store |
getStore()
Gets the Store for the request |
boolean |
isMajor()
|
static void |
postRequest(CompactionRequest cr)
|
static void |
preRequest(CompactionRequest cr)
|
void |
run()
|
void |
setIsMajor(boolean isMajor)
Specify if this compaction should be a major compaction based on the state of the store |
void |
setPriority(int p)
Gets the priority for the request |
void |
setSelection(CompactSelection files)
Set the files (and, implicitly, the size of the compaction based on those files) |
void |
setServer(HRegionServer hrs)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompactionRequest(HRegion region, Store store, int priority)
region
- region that is being compactedstore
- store which is being compactedpriority
- specified priority with which this compaction should enter the queue.public CompactionRequest(HRegion r, Store s, CompactSelection files, boolean isMajor, int p)
Method Detail |
---|
public static CompactionRequest getRequestForTesting(Store store, org.apache.hadoop.conf.Configuration conf, Collection<StoreFile> selection, boolean isMajor)
store
- conf
- selection
- isMajor
-
public static CompactionRequest.CompactionState getCompactionState(long regionId)
regionId
-
public static void preRequest(CompactionRequest cr)
public static void postRequest(CompactionRequest cr)
public void finishRequest()
public int compareTo(CompactionRequest request)
Note: The date is only accurate to the millisecond which means it is possible that two requests were inserted into the queue within a millisecond. When that is the case this function will break the tie arbitrarily.
compareTo
in interface Comparable<CompactionRequest>
public HRegion getHRegion()
public Store getStore()
public CompactSelection getCompactSelection()
public List<StoreFile> getFiles()
public long getSize()
public boolean isMajor()
public int getPriority()
public void setPriority(int p)
public void setServer(HRegionServer hrs)
public void setSelection(CompactSelection files)
files
- files that should be included in the compactionpublic void setIsMajor(boolean isMajor)
isMajor
- true if the system determines that this compaction should be a major
compactionpublic String toString()
toString
in class Object
public void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |