org.apache.hadoop.hbase.util
Class RegionSplitter.MD5StringSplit

java.lang.Object
  extended by org.apache.hadoop.hbase.util.RegionSplitter.MD5StringSplit
All Implemented Interfaces:
RegionSplitter.SplitAlgorithm
Enclosing class:
RegionSplitter

public static class RegionSplitter.MD5StringSplit
extends Object
implements RegionSplitter.SplitAlgorithm

MD5StringSplit is the default RegionSplitter.SplitAlgorithm for creating pre-split tables. The format of MD5StringSplit is the ASCII representation of an MD5 checksum. Row are long values in the range "00000000" => "7FFFFFFF" and are left-padded with zeros to keep the same order lexographically as if they were binary.


Constructor Summary
RegionSplitter.MD5StringSplit()
           
 
Method Summary
 byte[] firstRow()
          In HBase, the first row is represented by an empty byte array.
 byte[] lastRow()
          In HBase, the last row is represented by an empty byte array.
 String rowToStr(byte[] row)
           
 String separator()
           
 byte[] split(byte[] start, byte[] end)
          Split a pre-existing region into 2 regions.
 byte[][] split(int n)
          Split an entire table.
 byte[] strToRow(String in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegionSplitter.MD5StringSplit

public RegionSplitter.MD5StringSplit()
Method Detail

split

public byte[] split(byte[] start,
                    byte[] end)
Description copied from interface: RegionSplitter.SplitAlgorithm
Split a pre-existing region into 2 regions.

Specified by:
split in interface RegionSplitter.SplitAlgorithm
Parameters:
start - row
end - row
Returns:
the split row to use

split

public byte[][] split(int n)
Description copied from interface: RegionSplitter.SplitAlgorithm
Split an entire table.

Specified by:
split in interface RegionSplitter.SplitAlgorithm
Parameters:
n - number of regions to split the table into
Returns:
array of split keys for the initial regions of the table

firstRow

public byte[] firstRow()
Description copied from interface: RegionSplitter.SplitAlgorithm
In HBase, the first row is represented by an empty byte array. This might cause problems with your split algorithm or row printing. All your APIs will be passed firstRow() instead of empty array.

Specified by:
firstRow in interface RegionSplitter.SplitAlgorithm
Returns:
your representation of your first row

lastRow

public byte[] lastRow()
Description copied from interface: RegionSplitter.SplitAlgorithm
In HBase, the last row is represented by an empty byte array. This might cause problems with your split algorithm or row printing. All your APIs will be passed firstRow() instead of empty array.

Specified by:
lastRow in interface RegionSplitter.SplitAlgorithm
Returns:
your representation of your last row

strToRow

public byte[] strToRow(String in)
Specified by:
strToRow in interface RegionSplitter.SplitAlgorithm
Parameters:
in - user or file input for row
Returns:
byte array representation of this row for HBase

rowToStr

public String rowToStr(byte[] row)
Specified by:
rowToStr in interface RegionSplitter.SplitAlgorithm
Parameters:
row - byte array representing a row in HBase
Returns:
String to use for debug & file printing

separator

public String separator()
Specified by:
separator in interface RegionSplitter.SplitAlgorithm
Returns:
the separator character to use when storing / printing the row


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