org.apache.hadoop.hbase.regionserver
Class HRegionServer

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.HRegionServer
All Implemented Interfaces:
Runnable, Abortable, HBaseRPCErrorHandler, HRegionInterface, VersionedProtocol, RegionServerServices, Stoppable

public class HRegionServer
extends Object
implements HRegionInterface, HBaseRPCErrorHandler, Runnable, RegionServerServices

HRegionServer makes a set of HRegions available to clients. It checks in with the HMaster. There are many HRegionServers in a single HBase deployment.


Field Summary
protected  boolean abortRequested
           
 CompactSplitThread compactSplitThread
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected  boolean fsOk
           
protected  AtomicBoolean haveRootRegion
           
protected  HLog hlog
           
protected  HLog hlogForMeta
           
protected  boolean isOnline
           
protected  ReentrantReadWriteLock lock
           
static org.apache.commons.logging.Log LOG
           
protected  int numRegionsToReport
           
protected  Map<String,HRegion> onlineRegions
          Map of regions currently being served by this region server.
static String REGIONSERVER
          region server process name
static String REGIONSERVER_CONF
          region server configuration name
protected  boolean stopped
           
protected  int threadWakeFrequency
           
 
Fields inherited from interface org.apache.hadoop.hbase.ipc.HRegionInterface
VERSION
 
Constructor Summary
HRegionServer(org.apache.hadoop.conf.Configuration conf)
          Starts a HRegionServer at the default location
 
Method Summary
 void abort(String reason)
           
 void abort(String reason, Throwable cause)
          Cause the server to exit without closing the regions it is serving, the log it is using and without notifying the master.
protected  boolean addRegionsInTransition(HRegionInfo region, String currentAction)
          String currentAction) throws RegionAlreadyInTransitionException { Add region to this regionservers list of in transitions regions ONLY if its not already byte[] encodedName = region.getEncodedNameAsBytes(); in transition.
protected  long addRowLock(Integer r, HRegion region)
           
protected  long addScanner(RegionScanner s)
           
 void addToOnlineRegions(HRegion region)
          Add to online regions.
 Result append(byte[] regionName, Append append)
          Appends values to one or more columns values in a row.
 boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths, byte[] regionName)
          Atomically bulk load several HFiles into an open region
 boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths, byte[] regionName, boolean assignSeqNum)
          Atomically bulk load several HFiles into an open region
 boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete)
          Atomically checks if a row/family/qualifier value match the expectedValue.
 boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete)
          Atomically checks if a row/family/qualifier value match the expectedValue.
 boolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put)
          Atomically checks if a row/family/qualifier value match the expectedValue.
 boolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put)
          Atomically checks if a row/family/qualifier value match the expectedValue.
 boolean checkFileSystem()
          Checks to see if the file system is still accessible.
 boolean checkOOME(Throwable e)
          Take actions on the event of an OutOfMemoryError.
protected  void checkOpen()
          Called to verify that this server is up and running.
 void close(long scannerId)
          Close a scanner
protected  void closeAllRegions(boolean abort)
          Closes all regions.
 boolean closeRegion(byte[] encodedRegionName, boolean zk)
          Closes the region in the RS with the specified encoded regionName and will use or not use ZK during the close according to the specified flag.
protected  boolean closeRegion(byte[] encodedRegionName, boolean abort, boolean zk)
           
 boolean closeRegion(HRegionInfo region)
          Closes the specified region.
 boolean closeRegion(HRegionInfo region, boolean zk)
          Closes the specified region and will use or not use ZK during the close according to the specified flag.
protected  boolean closeRegion(HRegionInfo region, boolean abort, boolean zk)
           
protected  boolean closeRegion(HRegionInfo region, boolean abort, boolean zk, int versionOfClosingNode)
           
protected  boolean closeRegion(HRegionInfo region, boolean zk, int versionOfClosingNode)
           
 boolean closeRegion(HRegionInfo region, int versionOfClosingNode)
          Closes the specified region.
 void compactRegion(HRegionInfo regionInfo, boolean major)
          Compacts the specified region.
 void compactRegion(HRegionInfo regionInfo, boolean major, byte[] family)
          Compacts a column-family within a specified region.
static HRegionServer constructRegionServer(Class<? extends HRegionServer> regionServerClass, org.apache.hadoop.conf.Configuration conf2)
          Utility for constructing an instance of the passed HRegionServer class.
 boolean containsKeyInRegionsInTransition(HRegionInfo hri)
           
 HServerLoad.RegionLoad createRegionLoad(String encodedRegionName)
           
 void delete(byte[] regionName, Delete delete)
          Deletes all the KeyValues that match those found in the Delete object, if their ts <= to the Delete.
 int delete(byte[] regionName, List<Delete> deletes)
          Put an array of deletes into the specified region
protected  void doMetrics()
           
 ExecResult execCoprocessor(byte[] regionName, Exec call)
          Executes a single CoprocessorProtocol method using the registered protocol handlers.
 boolean exists(byte[] regionName, Get get)
          Perform exists operation.
 void flushRegion(byte[] regionName)
          Flushes the given region
 void flushRegion(byte[] regionName, long ifOlderThanTS)
          Flushes the given region if lastFlushTime < ifOlderThanTS
 void flushRegion(HRegionInfo regionInfo)
          Flushes the MemStore of the specified region.
 Result get(byte[] regionName, Get get)
          Perform Get operation.
 List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries()
          Performs a BlockCache summary and returns a List of BlockCacheColumnFamilySummary objects.
 CatalogTracker getCatalogTracker()
           
 Result getClosestRowBefore(byte[] regionName, byte[] row, byte[] family)
          Return all the data for the row that matches row exactly, or the one that immediately preceeds it.
 CompactionRequestor getCompactionRequester()
           
 String getCompactionState(byte[] regionName)
          Get the current compaction state of the region.
 CompactSplitThread getCompactSplitThread()
           
 org.apache.hadoop.conf.Configuration getConfiguration()
          Gets the configuration object for this server.
 RegionServerCoprocessorHost getCoprocessorHost()
           
 String[] getCoprocessors()
           
 SortedMap<Long,HRegion> getCopyOfOnlineRegionsSortedBySize()
           
 ExecutorService getExecutorService()
           
 org.apache.hadoop.fs.FileSystem getFileSystem()
           
 FlushRequester getFlushRequester()
           
 HRegion getFromOnlineRegions(String encodedRegionName)
          Return HRegion instance.
 HServerInfo getHServerInfo()
          Deprecated. Use getServerName() instead.
 InfoServer getInfoServer()
           
 long getLastFlushTime(byte[] regionName)
          Gets last flush time for the given region
 Leases getLeases()
           
protected  org.apache.hadoop.hbase.regionserver.LogRoller getLogRoller()
           
 MasterAddressTracker getMasterAddressManager()
           
protected  List<WALActionsListener> getMetaWALActionListeners()
           
 RegionServerMetrics getMetrics()
           
protected  HRegionInfo[] getMostLoadedRegions()
          Get the top N most loaded regions this server is serving so we can tell the master which regions it can reallocate if we're overloaded.
 int getNumberOfOnlineRegions()
           
 HRegion getOnlineRegion(byte[] regionName)
           
 List<HRegionInfo> getOnlineRegions()
           
 List<HRegion> getOnlineRegions(byte[] tableName)
          Gets the online regions of the specified table.
 Collection<HRegion> getOnlineRegionsLocalContext()
          For tests and web ui.
 ProtocolSignature getProtocolSignature(String protocol, long version, int clientMethodsHashCode)
          Return protocol version corresponding to protocol interface.
 long getProtocolVersion(String protocol, long clientVersion)
          Return protocol version corresponding to protocol interface.
protected  HRegion getRegion(byte[] regionName)
          Protected utility method for safely obtaining an HRegion handle.
 HRegionInfo getRegionInfo(byte[] regionName)
          Get metainfo about an HRegion
 RegionServerAccounting getRegionServerAccounting()
           
 byte[] getRegionStats(String encodedRegionName)
           
 AtomicInteger getRequestCount()
           
 long getResponseQueueSize()
           
protected  org.apache.hadoop.fs.Path getRootDir()
           
 HBaseRpcMetrics getRpcMetrics()
          Return a reference to the metrics instance used for counting RPC calls.
 RpcServer getRpcServer()
          Returns a reference to the region server's RPC server
 HServerInfo getServerInfo()
           
 ServerName getServerName()
           
 long getStartcode()
           
 List<String> getStoreFileList(byte[] regionName)
          Get a list of store files for all CFs in a particular region
 List<String> getStoreFileList(byte[] regionName, byte[] columnFamily)
          Get a list of store files for a particular CF in a particular region
 List<String> getStoreFileList(byte[] regionName, byte[][] columnFamilies)
          Get a list of store files for a set of CFs in a particular region
 int getThreadWakeFrequency()
          Interval at which threads should run
 HLog getWAL()
           
 HLog getWAL(HRegionInfo regionInfo)
           
protected  List<WALActionsListener> getWALActionListeners()
          Called by instantiateHLog(Path, Path) setting up WAL instance.
 ZooKeeperWatcher getZooKeeper()
          Gets the ZooKeeper instance for this server.
 ZooKeeperWatcher getZooKeeperWatcher()
           
protected  void handleReportForDutyResponse(org.apache.hadoop.io.MapWritable c)
           
 Result increment(byte[] regionName, Increment increment)
          Increments one or more columns values in a row.
 long incrementColumnValue(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
          Atomically increments a column value.
protected  HLog instantiateHLog(org.apache.hadoop.fs.Path logdir, org.apache.hadoop.fs.Path oldLogDir)
          Called by setupWALAndReplication() creating WAL instance.
 boolean isAborted()
          Check if the server or client was aborted.
 boolean isOnline()
          Report the status of the server.
 boolean isStopped()
           
 boolean isStopping()
           
protected  void join()
          Wait on all threads to finish.
protected  void kill()
           
 long lockRow(byte[] regionName, byte[] row)
          Deprecated. RowLock and associated operations are deprecated.
static void main(String[] args)
           
protected  void metrics()
           
<R> MultiResponse
multi(MultiAction<R> multi)
          Method used for doing multiple actions(Deletes, Gets and Puts) in one call
 void mutateRow(byte[] regionName, RowMutations rm)
           
 Result next(long scannerId)
          Get the next set of values
 Result[] next(long scannerId, int nbRows)
          Get the next set of values
 RegionOpeningState openRegion(HRegionInfo region)
          Opens the specified region.
 RegionOpeningState openRegion(HRegionInfo region, int versionOfOfflineNode)
          Opens the specified region.
 void openRegions(List<HRegionInfo> regions)
          Opens the specified regions.
 long openScanner(byte[] regionName, Scan scan)
          Opens a remote scanner with a RowFilter.
 void postOpenDeployTasks(HRegion r, CatalogTracker ct, boolean daughter)
          Tasks to perform after region open to complete deploy of region on regionserver
 int put(byte[] regionName, List<Put> puts)
          Put an array of puts into the specified region
 void put(byte[] regionName, Put put)
          Put data into the specified region
 boolean removeFromOnlineRegions(String encodedName)
          This method removes HRegion corresponding to hri from the Map of onlineRegions.
 boolean removeFromRegionsInTransition(HRegionInfo hri)
          Remove passed hri from the internal list of regions in transition on this regionserver.
 void replicateLogEntries(HLog.Entry[] entries)
          Replicates the given entries.
 byte[][] rollHLogWriter()
          Roll the log writer.
 void run()
          The HRegionServer sticks in this loop until closed.
 Result[] scan(byte[] regionName, Scan scan, int numberOfRows)
          Perform scan operation.
 void splitRegion(HRegionInfo regionInfo)
          Splits the specified region.
 void splitRegion(HRegionInfo regionInfo, byte[] splitPoint)
          Splits the specified region.
static Thread startRegionServer(HRegionServer hrs)
           
static Thread startRegionServer(HRegionServer hrs, String name)
           
 void stop(String msg)
          Stop this service.
 String toString()
           
 void unlockRow(byte[] regionName, long lockId)
          Deprecated. RowLock and associated operations are deprecated.
 void waitForServerOnline()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

stopped

protected volatile boolean stopped

abortRequested

protected volatile boolean abortRequested

fsOk

protected volatile boolean fsOk

conf

protected final org.apache.hadoop.conf.Configuration conf

haveRootRegion

protected final AtomicBoolean haveRootRegion

onlineRegions

protected final Map<String,HRegion> onlineRegions
Map of regions currently being served by this region server. Key is the encoded region name. All access should be synchronized.


lock

protected final ReentrantReadWriteLock lock

threadWakeFrequency

protected final int threadWakeFrequency

numRegionsToReport

protected final int numRegionsToReport

REGIONSERVER

public static final String REGIONSERVER
region server process name

See Also:
Constant Field Values

REGIONSERVER_CONF

public static final String REGIONSERVER_CONF
region server configuration name

See Also:
Constant Field Values

compactSplitThread

public CompactSplitThread compactSplitThread

hlog

protected volatile HLog hlog

hlogForMeta

protected volatile HLog hlogForMeta

isOnline

protected volatile boolean isOnline
Constructor Detail

HRegionServer

public HRegionServer(org.apache.hadoop.conf.Configuration conf)
              throws IOException,
                     InterruptedException
Starts a HRegionServer at the default location

Parameters:
conf -
Throws:
IOException
InterruptedException
Method Detail

run

public void run()
The HRegionServer sticks in this loop until closed.

Specified by:
run in interface Runnable

handleReportForDutyResponse

protected void handleReportForDutyResponse(org.apache.hadoop.io.MapWritable c)
                                    throws IOException
Throws:
IOException

getRegionServerAccounting

public RegionServerAccounting getRegionServerAccounting()
Specified by:
getRegionServerAccounting in interface RegionServerServices
Returns:
the RegionServerAccounting for this Region Server

createRegionLoad

public HServerLoad.RegionLoad createRegionLoad(String encodedRegionName)
Parameters:
encodedRegionName -
Returns:
An instance of RegionLoad.

checkOOME

public boolean checkOOME(Throwable e)
Description copied from interface: HBaseRPCErrorHandler
Take actions on the event of an OutOfMemoryError.

Specified by:
checkOOME in interface HBaseRPCErrorHandler
Parameters:
e - the throwable
Returns:
if the server should be shut down

checkFileSystem

public boolean checkFileSystem()
Checks to see if the file system is still accessible. If not, sets abortRequested and stopRequested

Returns:
false if file system is not available

isOnline

public boolean isOnline()
Report the status of the server. A server is online once all the startup is completed (setting up filesystem, starting service threads, etc.). This method is designed mostly to be useful in tests.

Returns:
true if online, false if not.

instantiateHLog

protected HLog instantiateHLog(org.apache.hadoop.fs.Path logdir,
                               org.apache.hadoop.fs.Path oldLogDir)
                        throws IOException
Called by setupWALAndReplication() creating WAL instance.

Parameters:
logdir -
oldLogDir -
Returns:
WAL instance.
Throws:
IOException

getWALActionListeners

protected List<WALActionsListener> getWALActionListeners()
Called by instantiateHLog(Path, Path) setting up WAL instance. Add any WALActionsListeners you want inserted before WAL startup.

Returns:
List of WALActionsListener that will be passed in to HLog on construction.

getMetaWALActionListeners

protected List<WALActionsListener> getMetaWALActionListeners()

getLogRoller

protected org.apache.hadoop.hbase.regionserver.LogRoller getLogRoller()

doMetrics

protected void doMetrics()

metrics

protected void metrics()

getMetrics

public RegionServerMetrics getMetrics()
Returns:
Region server metrics instance.

getMasterAddressManager

public MasterAddressTracker getMasterAddressManager()
Returns:
Master address tracker instance.

getWAL

public HLog getWAL()
Specified by:
getWAL in interface RegionServerServices
Returns:
get the default (common) WAL for the server

getWAL

public HLog getWAL(HRegionInfo regionInfo)
            throws IOException
Specified by:
getWAL in interface RegionServerServices
Returns:
the HLog for a particular region. Pass null for getting the default (common) WAL
Throws:
IOException

getCatalogTracker

public CatalogTracker getCatalogTracker()
Returns:
Master's instance of CatalogTracker

stop

public void stop(String msg)
Description copied from interface: Stoppable
Stop this service.

Specified by:
stop in interface HRegionInterface
Specified by:
stop in interface Stoppable
Parameters:
msg - Why we're stopping.

waitForServerOnline

public void waitForServerOnline()

postOpenDeployTasks

public void postOpenDeployTasks(HRegion r,
                                CatalogTracker ct,
                                boolean daughter)
                         throws org.apache.zookeeper.KeeperException,
                                IOException
Description copied from interface: RegionServerServices
Tasks to perform after region open to complete deploy of region on regionserver

Specified by:
postOpenDeployTasks in interface RegionServerServices
Parameters:
r - Region to open.
ct - Instance of CatalogTracker
daughter - True if this is daughter of a split
Throws:
org.apache.zookeeper.KeeperException
IOException

getRpcMetrics

public HBaseRpcMetrics getRpcMetrics()
Return a reference to the metrics instance used for counting RPC calls.

Returns:
Metrics instance.

getRpcServer

public RpcServer getRpcServer()
Description copied from interface: RegionServerServices
Returns a reference to the region server's RPC server

Specified by:
getRpcServer in interface RegionServerServices

abort

public void abort(String reason,
                  Throwable cause)
Cause the server to exit without closing the regions it is serving, the log it is using and without notifying the master. Used unit testing and on catastrophic events such as HDFS is yanked out from under hbase or we OOME.

Specified by:
abort in interface Abortable
Parameters:
reason - the reason we are aborting
cause - the exception that caused the abort, or null

abort

public void abort(String reason)
See Also:
abort(String, Throwable)

isAborted

public boolean isAborted()
Description copied from interface: Abortable
Check if the server or client was aborted.

Specified by:
isAborted in interface Abortable
Returns:
true if the server or client was aborted, false otherwise

kill

protected void kill()

join

protected void join()
Wait on all threads to finish. Presumption is that all closes and stops have already been called.


closeAllRegions

protected void closeAllRegions(boolean abort)
Closes all regions. Called on our way out. Assumes that its not possible for new regions to be added to onlineRegions while this method runs.


getRegionInfo

public HRegionInfo getRegionInfo(byte[] regionName)
                          throws NotServingRegionException,
                                 IOException
Description copied from interface: HRegionInterface
Get metainfo about an HRegion

Specified by:
getRegionInfo in interface HRegionInterface
Parameters:
regionName - name of the region
Returns:
HRegionInfo object for region
Throws:
NotServingRegionException
ConnectException
IOException - This can manifest as an Hadoop ipc RemoteException

getClosestRowBefore

public Result getClosestRowBefore(byte[] regionName,
                                  byte[] row,
                                  byte[] family)
                           throws IOException
Description copied from interface: HRegionInterface
Return all the data for the row that matches row exactly, or the one that immediately preceeds it.

Specified by:
getClosestRowBefore in interface HRegionInterface
Parameters:
regionName - region name
row - row key
family - Column family to look for row in.
Returns:
map of values
Throws:
IOException - e

get

public Result get(byte[] regionName,
                  Get get)
           throws IOException
Perform Get operation.

Specified by:
get in interface HRegionInterface
Parameters:
regionName - name of region to get from
get - Get operation
Returns:
Result
Throws:
IOException - e

exists

public boolean exists(byte[] regionName,
                      Get get)
               throws IOException
Description copied from interface: HRegionInterface
Perform exists operation.

Specified by:
exists in interface HRegionInterface
Parameters:
regionName - name of region to get from
get - Get operation describing cell to test
Returns:
true if exists
Throws:
IOException - e

put

public void put(byte[] regionName,
                Put put)
         throws IOException
Description copied from interface: HRegionInterface
Put data into the specified region

Specified by:
put in interface HRegionInterface
Parameters:
regionName - region name
put - the data to be put
Throws:
IOException - e

put

public int put(byte[] regionName,
               List<Put> puts)
        throws IOException
Description copied from interface: HRegionInterface
Put an array of puts into the specified region

Specified by:
put in interface HRegionInterface
Parameters:
regionName - region name
puts - List of puts to execute
Returns:
The number of processed put's. Returns -1 if all Puts processed successfully.
Throws:
IOException - e

checkAndPut

public boolean checkAndPut(byte[] regionName,
                           byte[] row,
                           byte[] family,
                           byte[] qualifier,
                           byte[] value,
                           Put put)
                    throws IOException
Description copied from interface: HRegionInterface
Atomically checks if a row/family/qualifier value match the expectedValue. If it does, it adds the put. If passed expected value is null, then the check is for non-existance of the row/column.

Specified by:
checkAndPut in interface HRegionInterface
Parameters:
regionName -
row -
family -
qualifier -
value - the expected value
put -
Returns:
true if the new put was execute, false otherwise
Throws:
IOException

checkAndPut

public boolean checkAndPut(byte[] regionName,
                           byte[] row,
                           byte[] family,
                           byte[] qualifier,
                           CompareFilter.CompareOp compareOp,
                           WritableByteArrayComparable comparator,
                           Put put)
                    throws IOException
Description copied from interface: HRegionInterface
Atomically checks if a row/family/qualifier value match the expectedValue. If it does, it adds the put. If passed expected value is null, then the check is for non-existance of the row/column.

Specified by:
checkAndPut in interface HRegionInterface
Parameters:
regionName -
row -
family -
qualifier -
compareOp -
comparator -
put -
Returns:
true if the new put was execute, false otherwise
Throws:
IOException

checkAndDelete

public boolean checkAndDelete(byte[] regionName,
                              byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              byte[] value,
                              Delete delete)
                       throws IOException
Description copied from interface: HRegionInterface
Atomically checks if a row/family/qualifier value match the expectedValue. If it does, it adds the delete. If passed expected value is null, then the check is for non-existance of the row/column.

Specified by:
checkAndDelete in interface HRegionInterface
Parameters:
regionName -
row -
family -
qualifier -
value - the expected value
delete -
Returns:
true if the new put was execute, false otherwise
Throws:
IOException

getStoreFileList

public List<String> getStoreFileList(byte[] regionName,
                                     byte[] columnFamily)
                              throws IllegalArgumentException
Description copied from interface: HRegionInterface
Get a list of store files for a particular CF in a particular region

Specified by:
getStoreFileList in interface HRegionInterface
Returns:
the list of store files
Throws:
IllegalArgumentException

getStoreFileList

public List<String> getStoreFileList(byte[] regionName,
                                     byte[][] columnFamilies)
                              throws IllegalArgumentException
Description copied from interface: HRegionInterface
Get a list of store files for a set of CFs in a particular region

Specified by:
getStoreFileList in interface HRegionInterface
Returns:
the list of store files
Throws:
IllegalArgumentException

getStoreFileList

public List<String> getStoreFileList(byte[] regionName)
                              throws IllegalArgumentException
Description copied from interface: HRegionInterface
Get a list of store files for all CFs in a particular region

Specified by:
getStoreFileList in interface HRegionInterface
Returns:
the list of store files
Throws:
IllegalArgumentException

flushRegion

public void flushRegion(byte[] regionName)
                 throws IllegalArgumentException,
                        IOException
Flushes the given region

Specified by:
flushRegion in interface HRegionInterface
Throws:
IllegalArgumentException
IOException

flushRegion

public void flushRegion(byte[] regionName,
                        long ifOlderThanTS)
                 throws IllegalArgumentException,
                        IOException
Flushes the given region if lastFlushTime < ifOlderThanTS

Specified by:
flushRegion in interface HRegionInterface
Throws:
IllegalArgumentException
IOException

getLastFlushTime

public long getLastFlushTime(byte[] regionName)
Gets last flush time for the given region

Specified by:
getLastFlushTime in interface HRegionInterface
Returns:
the last flush time for a region

checkAndDelete

public boolean checkAndDelete(byte[] regionName,
                              byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              CompareFilter.CompareOp compareOp,
                              WritableByteArrayComparable comparator,
                              Delete delete)
                       throws IOException
Description copied from interface: HRegionInterface
Atomically checks if a row/family/qualifier value match the expectedValue. If it does, it adds the delete. If passed expected value is null, then the check is for non-existance of the row/column.

Specified by:
checkAndDelete in interface HRegionInterface
Parameters:
regionName -
row -
family -
qualifier -
compareOp -
comparator -
delete -
Returns:
true if the new put was execute, false otherwise
Throws:
IOException

openScanner

public long openScanner(byte[] regionName,
                        Scan scan)
                 throws IOException
Description copied from interface: HRegionInterface
Opens a remote scanner with a RowFilter.

Specified by:
openScanner in interface HRegionInterface
Parameters:
regionName - name of region to scan
scan - configured scan object
Returns:
scannerId scanner identifier used in other calls
Throws:
IOException - e

addScanner

protected long addScanner(RegionScanner s)
                   throws Leases.LeaseStillHeldException
Throws:
Leases.LeaseStillHeldException

next

public Result next(long scannerId)
            throws IOException
Description copied from interface: HRegionInterface
Get the next set of values

Specified by:
next in interface HRegionInterface
Parameters:
scannerId - clientId passed to openScanner
Returns:
map of values; returns null if no results.
Throws:
IOException - e

next

public Result[] next(long scannerId,
                     int nbRows)
              throws IOException
Description copied from interface: HRegionInterface
Get the next set of values

Specified by:
next in interface HRegionInterface
Parameters:
scannerId - clientId passed to openScanner
nbRows - the number of rows to fetch
Returns:
Array of Results (map of values); array is empty if done with this region and null if we are NOT to go to the next region (happens when a filter rules that the scan is done).
Throws:
IOException - e

close

public void close(long scannerId)
           throws IOException
Description copied from interface: HRegionInterface
Close a scanner

Specified by:
close in interface HRegionInterface
Parameters:
scannerId - the scanner id returned by openScanner
Throws:
IOException - e

scan

public Result[] scan(byte[] regionName,
                     Scan scan,
                     int numberOfRows)
              throws IOException
Description copied from interface: HRegionInterface
Perform scan operation.

Specified by:
scan in interface HRegionInterface
Parameters:
regionName - name of region to get from
numberOfRows - the maximum number of rows to fetch
Returns:
Array of Results;array is empty if done with this region and null if we are NOT to go to the next region (happens when a filter rules that the scan is done).
Throws:
IOException - e

delete

public void delete(byte[] regionName,
                   Delete delete)
            throws IOException
Description copied from interface: HRegionInterface
Deletes all the KeyValues that match those found in the Delete object, if their ts <= to the Delete. In case of a delete with a specific ts it only deletes that specific KeyValue.

Specified by:
delete in interface HRegionInterface
Parameters:
regionName - region name
delete - delete object
Throws:
IOException - e

delete

public int delete(byte[] regionName,
                  List<Delete> deletes)
           throws IOException
Description copied from interface: HRegionInterface
Put an array of deletes into the specified region

Specified by:
delete in interface HRegionInterface
Parameters:
regionName - region name
deletes - delete List to execute
Returns:
The number of processed deletes. Returns -1 if all Deletes processed successfully.
Throws:
IOException - e

lockRow

public long lockRow(byte[] regionName,
                    byte[] row)
             throws IOException
Deprecated. RowLock and associated operations are deprecated.

Description copied from interface: HRegionInterface
Opens a remote row lock.

Specified by:
lockRow in interface HRegionInterface
Parameters:
regionName - name of region
row - row to lock
Returns:
lockId lock identifier
Throws:
IOException - e

addRowLock

protected long addRowLock(Integer r,
                          HRegion region)
                   throws Leases.LeaseStillHeldException
Throws:
Leases.LeaseStillHeldException

unlockRow

public void unlockRow(byte[] regionName,
                      long lockId)
               throws IOException
Deprecated. RowLock and associated operations are deprecated.

Description copied from interface: HRegionInterface
Releases a remote row lock.

Specified by:
unlockRow in interface HRegionInterface
Parameters:
regionName - region name
lockId - the lock id returned by lockRow
Throws:
IOException - e

bulkLoadHFiles

public boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths,
                              byte[] regionName)
                       throws IOException
Atomically bulk load several HFiles into an open region

Specified by:
bulkLoadHFiles in interface HRegionInterface
Parameters:
familyPaths - List of (family, hfile path) pairs
regionName - name of region to load hfiles into
Returns:
true if successful, false is failed but recoverably (no action)
Throws:
IOException - if failed unrecoverably

bulkLoadHFiles

public boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths,
                              byte[] regionName,
                              boolean assignSeqNum)
                       throws IOException
Atomically bulk load several HFiles into an open region

Specified by:
bulkLoadHFiles in interface HRegionInterface
Parameters:
familyPaths - List of (family, hfile path) pairs
regionName - name of region to load hfiles into
assignSeqNum - should we assign sequence numbers
Returns:
true if successful, false is failed but recoverably (no action)
Throws:
IOException - if failed unrecoverably

openRegion

public RegionOpeningState openRegion(HRegionInfo region)
                              throws IOException
Description copied from interface: HRegionInterface
Opens the specified region.

Specified by:
openRegion in interface HRegionInterface
Parameters:
region - region to open
Returns:
RegionOpeningState OPENED - if region open request was successful. ALREADY_OPENED - if the region was already opened. FAILED_OPENING - if region opening failed.
Throws:
IOException

openRegion

public RegionOpeningState openRegion(HRegionInfo region,
                                     int versionOfOfflineNode)
                              throws IOException
Description copied from interface: HRegionInterface
Opens the specified region.

Specified by:
openRegion in interface HRegionInterface
Parameters:
region - region to open
versionOfOfflineNode - the version of znode to compare when RS transitions the znode from OFFLINE state.
Returns:
RegionOpeningState OPENED - if region open request was successful. ALREADY_OPENED - if the region was already opened. FAILED_OPENING - if region opening failed.
Throws:
IOException

addRegionsInTransition

protected boolean addRegionsInTransition(HRegionInfo region,
                                         String currentAction)
                                  throws RegionAlreadyInTransitionException
String currentAction) throws RegionAlreadyInTransitionException { Add region to this regionservers list of in transitions regions ONLY if its not already byte[] encodedName = region.getEncodedNameAsBytes(); in transition. If a region already in RIT, we throw RegionAlreadyInTransitionException. if (this.regionsInTransitionInRS.containsKey(encodedName)) { Callers need to call removeFromRegionsInTransition(HRegionInfo) when done or if boolean openAction = this.regionsInTransitionInRS.get(encodedName); error processing.

Parameters:
region - Region to add
currentAction - Whether OPEN or CLOSE.
Throws:
RegionAlreadyInTransitionException

openRegions

public void openRegions(List<HRegionInfo> regions)
                 throws IOException
Description copied from interface: HRegionInterface
Opens the specified regions.

Specified by:
openRegions in interface HRegionInterface
Parameters:
regions - regions to open
Throws:
IOException

closeRegion

public boolean closeRegion(HRegionInfo region)
                    throws IOException
Description copied from interface: HRegionInterface
Closes the specified region.

Specified by:
closeRegion in interface HRegionInterface
Parameters:
region - region to close
Returns:
true if closing region, false if not
Throws:
IOException

closeRegion

public boolean closeRegion(HRegionInfo region,
                           int versionOfClosingNode)
                    throws IOException
Description copied from interface: HRegionInterface
Closes the specified region.

Specified by:
closeRegion in interface HRegionInterface
Parameters:
region - region to close
versionOfClosingNode - the version of znode to compare when RS transitions the znode from CLOSING state.
Returns:
true if closing region, false if not
Throws:
IOException

closeRegion

public boolean closeRegion(HRegionInfo region,
                           boolean zk)
                    throws IOException
Description copied from interface: HRegionInterface
Closes the specified region and will use or not use ZK during the close according to the specified flag.

Specified by:
closeRegion in interface HRegionInterface
Parameters:
region - region to close
zk - true if transitions should be done in ZK, false if not
Returns:
true if closing region, false if not
Throws:
IOException

closeRegion

protected boolean closeRegion(HRegionInfo region,
                              boolean zk,
                              int versionOfClosingNode)
                       throws IOException
Throws:
IOException

closeRegion

public boolean closeRegion(byte[] encodedRegionName,
                           boolean zk)
                    throws IOException
Description copied from interface: HRegionInterface
Closes the region in the RS with the specified encoded regionName and will use or not use ZK during the close according to the specified flag. Note that the encoded region name is in byte format.

Specified by:
closeRegion in interface HRegionInterface
Parameters:
encodedRegionName - in bytes
zk - true if to use zookeeper, false if need not.
Returns:
true if region is closed, false if not.
Throws:
IOException

closeRegion

protected boolean closeRegion(HRegionInfo region,
                              boolean abort,
                              boolean zk)
Parameters:
region - Region to close
abort - True if we are aborting
zk - True if we are to update zk about the region close; if the close was orchestrated by master, then update zk. If the close is being run by the regionserver because its going down, don't update zk.
Returns:
True if closed a region.

closeRegion

protected boolean closeRegion(HRegionInfo region,
                              boolean abort,
                              boolean zk,
                              int versionOfClosingNode)
Parameters:
region - Region to close
abort - True if we are aborting
zk - True if we are to update zk about the region close; if the close was orchestrated by master, then update zk. If the close is being run by the regionserver because its going down, don't update zk.
versionOfClosingNode - the version of znode to compare when RS transitions the znode from CLOSING state.
Returns:
True if closed a region.

closeRegion

protected boolean closeRegion(byte[] encodedRegionName,
                              boolean abort,
                              boolean zk)
                       throws IOException
Parameters:
encodedRegionName - encodedregionName to close
abort - True if we are aborting
zk - True if we are to update zk about the region close; if the close was orchestrated by master, then update zk. If the close is being run by the regionserver because its going down, don't update zk.
Returns:
True if closed a region.
Throws:
IOException

flushRegion

public void flushRegion(HRegionInfo regionInfo)
                 throws NotServingRegionException,
                        IOException
Description copied from interface: HRegionInterface
Flushes the MemStore of the specified region.

This method is synchronous.

Specified by:
flushRegion in interface HRegionInterface
Parameters:
regionInfo - region to flush
Throws:
NotServingRegionException
IOException

splitRegion

public void splitRegion(HRegionInfo regionInfo)
                 throws NotServingRegionException,
                        IOException
Description copied from interface: HRegionInterface
Splits the specified region.

This method currently flushes the region and then forces a compaction which will then trigger a split. The flush is done synchronously but the compaction is asynchronous.

Specified by:
splitRegion in interface HRegionInterface
Parameters:
regionInfo - region to split
Throws:
NotServingRegionException
IOException

splitRegion

public void splitRegion(HRegionInfo regionInfo,
                        byte[] splitPoint)
                 throws NotServingRegionException,
                        IOException
Description copied from interface: HRegionInterface
Splits the specified region.

This method currently flushes the region and then forces a compaction which will then trigger a split. The flush is done synchronously but the compaction is asynchronous.

Specified by:
splitRegion in interface HRegionInterface
Parameters:
regionInfo - region to split
splitPoint - the explicit row to split on
Throws:
NotServingRegionException
IOException

compactRegion

public void compactRegion(HRegionInfo regionInfo,
                          boolean major)
                   throws NotServingRegionException,
                          IOException
Description copied from interface: HRegionInterface
Compacts the specified region. Performs a major compaction if specified.

This method is asynchronous.

Specified by:
compactRegion in interface HRegionInterface
Parameters:
regionInfo - region to compact
major - true to force major compaction
Throws:
NotServingRegionException
IOException

compactRegion

public void compactRegion(HRegionInfo regionInfo,
                          boolean major,
                          byte[] family)
                   throws NotServingRegionException,
                          IOException
Description copied from interface: HRegionInterface
Compacts a column-family within a specified region. Performs a major compaction if specified.

This method is asynchronous.

Specified by:
compactRegion in interface HRegionInterface
Parameters:
regionInfo - region to compact
major - true to force major compaction
family - column family within a region to compact
Throws:
NotServingRegionException
IOException

getInfoServer

public InfoServer getInfoServer()
Returns:
the info server

isStopped

public boolean isStopped()
Specified by:
isStopped in interface Stoppable
Returns:
true if a stop has been requested.

isStopping

public boolean isStopping()
Specified by:
isStopping in interface RegionServerServices
Returns:
True if this regionserver is stopping.

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Description copied from interface: Server
Gets the configuration object for this server.

Returns:
the configuration

getOnlineRegions

public List<HRegionInfo> getOnlineRegions()
                                   throws IOException
Specified by:
getOnlineRegions in interface HRegionInterface
Returns:
All regions online on this region server
Throws:
IOException - e

getNumberOfOnlineRegions

public int getNumberOfOnlineRegions()

getRegionStats

public byte[] getRegionStats(String encodedRegionName)
                      throws IOException
Parameters:
encodedRegionName -
Returns:
JSON Map of labels to values for passed in encodedRegionName
Throws:
IOException

getOnlineRegionsLocalContext

public Collection<HRegion> getOnlineRegionsLocalContext()
For tests and web ui. This method will only work if HRegionServer is in the same JVM as client; HRegion cannot be serialized to cross an rpc.

See Also:
getOnlineRegions()

addToOnlineRegions

public void addToOnlineRegions(HRegion region)
Add to online regions.


removeFromOnlineRegions

public boolean removeFromOnlineRegions(String encodedName)
This method removes HRegion corresponding to hri from the Map of onlineRegions.

Returns:
True if we removed a region from online list.

getCopyOfOnlineRegionsSortedBySize

public SortedMap<Long,HRegion> getCopyOfOnlineRegionsSortedBySize()
Returns:
A new Map of online regions sorted by region size with the first entry being the biggest.

getFromOnlineRegions

public HRegion getFromOnlineRegions(String encodedRegionName)
Return HRegion instance. Only works if caller is in same context, in same JVM. HRegion is not serializable.

Returns:
HRegion for the passed encoded encodedRegionName or null if named region is not member of the online regions.

getOnlineRegion

public HRegion getOnlineRegion(byte[] regionName)
Parameters:
regionName -
Returns:
HRegion for the passed binary regionName or null if named region is not member of the online regions.

getRequestCount

public AtomicInteger getRequestCount()
Returns:
the request count

getStartcode

public long getStartcode()
Returns:
time stamp in millis of when this region server was started

getFlushRequester

public FlushRequester getFlushRequester()
Specified by:
getFlushRequester in interface RegionServerServices
Returns:
reference to FlushRequester

getRegion

protected HRegion getRegion(byte[] regionName)
                     throws NotServingRegionException
Protected utility method for safely obtaining an HRegion handle.

Parameters:
regionName - Name of online HRegion to return
Returns:
HRegion for regionName
Throws:
NotServingRegionException

getMostLoadedRegions

protected HRegionInfo[] getMostLoadedRegions()
Get the top N most loaded regions this server is serving so we can tell the master which regions it can reallocate if we're overloaded. TODO: actually calculate which regions are most loaded. (Right now, we're just grabbing the first N regions being served regardless of load.)


checkOpen

protected void checkOpen()
                  throws IOException
Called to verify that this server is up and running.

Throws:
IOException

getProtocolSignature

public ProtocolSignature getProtocolSignature(String protocol,
                                              long version,
                                              int clientMethodsHashCode)
                                       throws IOException
Description copied from interface: VersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolSignature in interface VersionedProtocol
Parameters:
protocol - The classname of the protocol interface
version - The version of the protocol that the client speaks
clientMethodsHashCode - the hashcode of client protocol methods
Returns:
the server protocol signature containing its version and a list of its supported methods
Throws:
IOException
See Also:
for a default implementation

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Description copied from interface: VersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface VersionedProtocol
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
IOException - if any IO error occurs

getLeases

public Leases getLeases()
Specified by:
getLeases in interface RegionServerServices
Returns:
The RegionServer's "Leases" service

getRootDir

protected org.apache.hadoop.fs.Path getRootDir()
Returns:
Return the rootDir.

getFileSystem

public org.apache.hadoop.fs.FileSystem getFileSystem()
Specified by:
getFileSystem in interface RegionServerServices
Returns:
Return the fs.

getServerInfo

public HServerInfo getServerInfo()
Returns:
This servers HServerInfo

mutateRow

public void mutateRow(byte[] regionName,
                      RowMutations rm)
               throws IOException
Specified by:
mutateRow in interface HRegionInterface
Throws:
IOException

append

public Result append(byte[] regionName,
                     Append append)
              throws IOException
Description copied from interface: HRegionInterface
Appends values to one or more columns values in a row. Optionally Returns the updated keys after the append.

This operation does not appear atomic to readers. Appends are done under a row lock but readers do not take row locks.

Specified by:
append in interface HRegionInterface
Parameters:
regionName - region name
append - Append operation
Returns:
changed cells (maybe null)
Throws:
IOException

increment

public Result increment(byte[] regionName,
                        Increment increment)
                 throws IOException
Description copied from interface: HRegionInterface
Increments one or more columns values in a row. Returns the updated keys after the increment.

This operation does not appear atomic to readers. Increments are done under a row lock but readers do not take row locks.

Specified by:
increment in interface HRegionInterface
Parameters:
regionName - region name
increment - increment operation
Returns:
incremented cells
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] regionName,
                                 byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount,
                                 boolean writeToWAL)
                          throws IOException
Atomically increments a column value. If the column value isn't long-like, this could throw an exception. If passed expected value is null, then the check is for non-existance of the row/column.

Specified by:
incrementColumnValue in interface HRegionInterface
Parameters:
regionName - region name
row - row to check
family - column family
qualifier - column qualifier
amount - long amount to increment
writeToWAL - whether to write the increment to the WAL
Returns:
new incremented column value
Throws:
IOException - e

getHServerInfo

public HServerInfo getHServerInfo()
                           throws IOException
Deprecated. Use getServerName() instead.

Method used when a master is taking the place of another failed one.

Specified by:
getHServerInfo in interface HRegionInterface
Returns:
This servers HServerInfo; it has RegionServer POV on the hostname which may not agree w/ how the Master sees this server.
Throws:
IOException - e

multi

public <R> MultiResponse multi(MultiAction<R> multi)
                    throws IOException
Description copied from interface: HRegionInterface
Method used for doing multiple actions(Deletes, Gets and Puts) in one call

Specified by:
multi in interface HRegionInterface
Returns:
MultiResult
Throws:
IOException

execCoprocessor

public ExecResult execCoprocessor(byte[] regionName,
                                  Exec call)
                           throws IOException
Executes a single CoprocessorProtocol method using the registered protocol handlers. CoprocessorProtocol implementations must be registered per-region via the HRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol) method before they are available.

Specified by:
execCoprocessor in interface HRegionInterface
Parameters:
regionName - name of the region against which the invocation is executed
call - an Exec instance identifying the protocol, method name, and parameters for the method invocation
Returns:
an ExecResult instance containing the region name of the invocation and the return value
Throws:
IOException - if no registered protocol handler is found or an error occurs during the invocation
See Also:
HRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)

toString

public String toString()
Overrides:
toString in class Object

getThreadWakeFrequency

public int getThreadWakeFrequency()
Interval at which threads should run

Returns:
the interval

getZooKeeper

public ZooKeeperWatcher getZooKeeper()
Description copied from interface: Server
Gets the ZooKeeper instance for this server.


getServerName

public ServerName getServerName()
Returns:
The unique server name for this server.

getCompactionRequester

public CompactionRequestor getCompactionRequester()
Specified by:
getCompactionRequester in interface RegionServerServices
Returns:
Implementation of CompactionRequestor or null.

getZooKeeperWatcher

public ZooKeeperWatcher getZooKeeperWatcher()

getCoprocessorHost

public RegionServerCoprocessorHost getCoprocessorHost()

removeFromRegionsInTransition

public boolean removeFromRegionsInTransition(HRegionInfo hri)
Description copied from interface: RegionServerServices
Remove passed hri from the internal list of regions in transition on this regionserver.

Specified by:
removeFromRegionsInTransition in interface RegionServerServices
Parameters:
hri - Region to remove.
Returns:
True if removed

containsKeyInRegionsInTransition

public boolean containsKeyInRegionsInTransition(HRegionInfo hri)
Specified by:
containsKeyInRegionsInTransition in interface RegionServerServices
Returns:
True if the internal list of regions in transition includes the passed hri.

getExecutorService

public ExecutorService getExecutorService()

startRegionServer

public static Thread startRegionServer(HRegionServer hrs)
                                throws IOException
Parameters:
hrs -
Returns:
Thread the RegionServer is running in correctly named.
Throws:
IOException

startRegionServer

public static Thread startRegionServer(HRegionServer hrs,
                                       String name)
                                throws IOException
Parameters:
hrs -
name -
Returns:
Thread the RegionServer is running in correctly named.
Throws:
IOException

constructRegionServer

public static HRegionServer constructRegionServer(Class<? extends HRegionServer> regionServerClass,
                                                  org.apache.hadoop.conf.Configuration conf2)
Utility for constructing an instance of the passed HRegionServer class.

Parameters:
regionServerClass -
conf2 -
Returns:
HRegionServer instance.

replicateLogEntries

public void replicateLogEntries(HLog.Entry[] entries)
                         throws IOException
Description copied from interface: HRegionInterface
Replicates the given entries. The guarantee is that the given entries will be durable on the slave cluster if this method returns without any exception. hbase.replication has to be set to true for this to work.

Specified by:
replicateLogEntries in interface HRegionInterface
Parameters:
entries - entries to replicate
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception
See Also:
HRegionServerCommandLine

getBlockCacheColumnFamilySummaries

public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries()
                                                                       throws IOException
Description copied from interface: HRegionInterface
Performs a BlockCache summary and returns a List of BlockCacheColumnFamilySummary objects. This method could be fairly heavyweight in that it evaluates the entire HBase file-system against what is in the RegionServer BlockCache.

Specified by:
getBlockCacheColumnFamilySummaries in interface HRegionInterface
Returns:
BlockCacheColumnFamilySummary
Throws:
IOException - exception

rollHLogWriter

public byte[][] rollHLogWriter()
                        throws IOException,
                               FailedLogCloseException
Description copied from interface: HRegionInterface
Roll the log writer. That is, start writing log messages to a new file.

Specified by:
rollHLogWriter in interface HRegionInterface
Returns:
If lots of logs, flush the returned regions so next time through we can clean logs. Returns null if nothing to flush. Names are actual region names as returned by HRegionInfo.getEncodedName()
Throws:
IOException
FailedLogCloseException

getOnlineRegions

public List<HRegion> getOnlineRegions(byte[] tableName)
Gets the online regions of the specified table. This method looks at the in-memory onlineRegions. It does not go to .META.. Only returns online regions. If a region on this table has been closed during a disable, etc., it will not be included in the returned list. So, the returned list may not necessarily be ALL regions in this table, its all the ONLINE regions in the table.

Parameters:
tableName -
Returns:
Online regions from tableName

getCoprocessors

public String[] getCoprocessors()

getCompactionState

public String getCompactionState(byte[] regionName)
                          throws IOException
Get the current compaction state of the region.

Specified by:
getCompactionState in interface HRegionInterface
Parameters:
regionName - the name of the region to check compaction statte.
Returns:
the compaction state name.
Throws:
IOException - exception

getResponseQueueSize

public long getResponseQueueSize()

getCompactSplitThread

public CompactSplitThread getCompactSplitThread()
Returns:
the underlying CompactSplitThread for the servers


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