org.apache.hadoop.hbase.regionserver.compactions
Class CompactionRequest

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest
All Implemented Interfaces:
Comparable<CompactionRequest>, Runnable

public class CompactionRequest
extends Object
implements Comparable<CompactionRequest>, Runnable

This class holds all details necessary to run a compaction.


Nested Class Summary
static class CompactionRequest.Rejection
          Cleanup class to use when rejecting a compaction request from the queue.
 
Constructor Summary
CompactionRequest(HRegion r, Store s, List<StoreFile> files, boolean isMajor, int p)
           
 
Method Summary
 int compareTo(CompactionRequest request)
          This function will define where in the priority queue the request will end up.
 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
 long getSize()
          Gets the total size of all StoreFiles in compaction
 Store getStore()
          Gets the Store for the request
 boolean isMajor()
           
 void run()
           
 void setPriority(int p)
          Gets the priority for the request
 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

CompactionRequest

public CompactionRequest(HRegion r,
                         Store s,
                         List<StoreFile> files,
                         boolean isMajor,
                         int p)
Method Detail

compareTo

public int compareTo(CompactionRequest request)
This function will define where in the priority queue the request will end up. Those with the highest priorities will be first. When the priorities are the same it will first compare priority then date to maintain a FIFO functionality.

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.

Specified by:
compareTo in interface Comparable<CompactionRequest>

getHRegion

public HRegion getHRegion()
Gets the HRegion for the request


getStore

public Store getStore()
Gets the Store for the request


getFiles

public List<StoreFile> getFiles()
Gets the StoreFiles for the request


getSize

public long getSize()
Gets the total size of all StoreFiles in compaction


isMajor

public boolean isMajor()

getPriority

public int getPriority()
Gets the priority for the request


setPriority

public void setPriority(int p)
Gets the priority for the request


setServer

public void setServer(HRegionServer hrs)

toString

public String toString()
Overrides:
toString in class Object

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.