org.apache.hadoop.hbase
Class RegionHistorian

java.lang.Object
  extended by org.apache.hadoop.hbase.RegionHistorian
All Implemented Interfaces:
HConstants

public class RegionHistorian
extends Object
implements HConstants

The Region Historian task is to keep track of every modification a region has to go through. Public methods are used to update the information in the .META. table and to retrieve it. This is a Singleton. By default, the Historian is offline; it will not log. Its enabled in the regionserver and master down in their guts after there's some certainty the .META. has been deployed.


Nested Class Summary
static class RegionHistorian.HistorianColumnKey
           
 class RegionHistorian.RegionHistoryInformation
          Inner class that only contains information about an event.
 
Field Summary
 
Fields inherited from interface org.apache.hadoop.hbase.HConstants
ALL_META_COLUMNS, ALL_VERSIONS, COL_REGIONINFO, COL_REGIONINFO_ARRAY, COL_SERVER, COL_SPLITA, COL_SPLITB, COL_STARTCODE, COLUMN_FAMILY, COLUMN_FAMILY_ARRAY, COLUMN_FAMILY_HISTORIAN, COLUMN_FAMILY_HISTORIAN_STR, COLUMN_FAMILY_STR, DEFAULT_CLIENT_RETRIES, DEFAULT_HOST, DEFAULT_MASTER_ADDRESS, DEFAULT_MASTER_INFOPORT, DEFAULT_MASTER_PORT, DEFAULT_MAX_FILE_SIZE, DEFAULT_REGION_SERVER_CLASS, DEFAULT_REGIONSERVER_ADDRESS, DEFAULT_REGIONSERVER_INFOPORT, DEFAULT_SIZE_RESERVATION_BLOCK, EMPTY_BYTE_ARRAY, EMPTY_END_ROW, EMPTY_START_ROW, FILE_SYSTEM_VERSION, FOREVER, HBASE_CLIENT_RETRIES_NUMBER_KEY, HBASE_DIR, HREGION_LOGDIR_NAME, HREGION_OLDLOGFILE_NAME, IN_MEMORY, LAST_ROW, LATEST_TIMESTAMP, MAJOR_COMPACTION_PERIOD, MASTER_ADDRESS, META_ROW_DELIMITER, META_TABLE_NAME, NAME, NINES, REGION_SERVER_CLASS, REGION_SERVER_IMPL, REGIONSERVER_ADDRESS, RETRY_BACKOFF, ROOT_TABLE_NAME, THREAD_WAKE_FREQUENCY, UTF8_ENCODING, VERSION_FILE_NAME, VERSIONS, ZERO_L, ZEROES
 
Method Summary
 void addRegionAssignment(HRegionInfo info, String serverName)
          Method to add a creation event to the row in the .META table
 void addRegionCompaction(HRegionInfo info, String timeTaken)
          Method to add a compaction event to the row in the .META table
 void addRegionCreation(HRegionInfo info)
          Method to add a creation event to the row in the .META table
 void addRegionFlush(HRegionInfo info, String timeTaken)
          Method to add a flush event to the row in the .META table
 void addRegionOpen(HRegionInfo info, HServerAddress address)
          Method to add a opening event to the row in the .META table
 void addRegionSplit(HRegionInfo oldInfo, HRegionInfo newInfo1, HRegionInfo newInfo2)
          Method to add a split event to the rows in the .META table with information from oldInfo.
static RegionHistorian getInstance()
          Get the RegionHistorian Singleton instance.
 List<RegionHistorian.RegionHistoryInformation> getRegionHistory(String regionName)
          Returns, for a given region name, an ordered list by timestamp of all values in the historian column of the .META.
 boolean isOnline()
           
 void offline()
          Offlines the historian.
 void online(HBaseConfiguration c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RegionHistorian getInstance()
Get the RegionHistorian Singleton instance.

Returns:
The region historian

getRegionHistory

public List<RegionHistorian.RegionHistoryInformation> getRegionHistory(String regionName)
Returns, for a given region name, an ordered list by timestamp of all values in the historian column of the .META. table.

Parameters:
regionName - Region name as a string
Returns:
List of RegionHistoryInformation or null if we're offline.

addRegionAssignment

public void addRegionAssignment(HRegionInfo info,
                                String serverName)
Method to add a creation event to the row in the .META table

Parameters:
info -
serverName -

addRegionCreation

public void addRegionCreation(HRegionInfo info)
Method to add a creation event to the row in the .META table

Parameters:
info -

addRegionOpen

public void addRegionOpen(HRegionInfo info,
                          HServerAddress address)
Method to add a opening event to the row in the .META table

Parameters:
info -
address -

addRegionSplit

public void addRegionSplit(HRegionInfo oldInfo,
                           HRegionInfo newInfo1,
                           HRegionInfo newInfo2)
Method to add a split event to the rows in the .META table with information from oldInfo.

Parameters:
oldInfo -
newInfo1 -
newInfo2 -

addRegionCompaction

public void addRegionCompaction(HRegionInfo info,
                                String timeTaken)
Method to add a compaction event to the row in the .META table

Parameters:
info -
timeTaken -

addRegionFlush

public void addRegionFlush(HRegionInfo info,
                           String timeTaken)
Method to add a flush event to the row in the .META table

Parameters:
info -
timeTaken -

isOnline

public boolean isOnline()
Returns:
True if the historian is online. When offline, will not add updates to the .META. table.

online

public void online(HBaseConfiguration c)
Parameters:
c - Online the historian. Invoke after cluster has spun up.

offline

public void offline()
Offlines the historian.

See Also:
online(HBaseConfiguration)


Copyright © 2008 The Apache Software Foundation