|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.RegionSplitter.HexStringSplit
public static class RegionSplitter.HexStringSplit
HexStringSplit is a well-known RegionSplitter.SplitAlgorithm
for choosing region
boundaries. The format of a HexStringSplit region boundary is the ASCII
representation of an MD5 checksum, or any other uniformly distributed
hexadecimal value. Row are hex-encoded long values in the range
"00000000" => "FFFFFFFF" and are left-padded with zeros to keep the
same order lexicographically as if they were binary.
Since this split algorithm uses hex strings as keys, it is easy to read &
write in the shell but takes up more space and may be non-intuitive.
Constructor Summary | |
---|---|
RegionSplitter.HexStringSplit()
|
Method Summary | |
---|---|
BigInteger |
convertToBigInteger(byte[] row)
Returns the BigInteger represented by the byte array |
byte[] |
convertToByte(BigInteger bigInteger)
Returns the bytes corresponding to the BigInteger |
static byte[] |
convertToByte(BigInteger bigInteger,
int pad)
Returns the bytes corresponding to the BigInteger |
byte[][] |
convertToBytes(BigInteger[] bigIntegers)
Returns an array of bytes corresponding to an array of BigIntegers |
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()
|
void |
setFirstRow(byte[] userInput)
Set the first row |
void |
setFirstRow(String userInput)
In HBase, the last row is represented by an empty byte array. |
void |
setLastRow(byte[] userInput)
Set the last row |
void |
setLastRow(String userInput)
In HBase, the last row is represented by an empty byte array. |
byte[] |
split(byte[] start,
byte[] end)
Split a pre-existing region into 2 regions. |
byte[][] |
split(int n)
Split an entire table. |
BigInteger |
split2(BigInteger a,
BigInteger b)
Divide 2 numbers in half (for split algorithm) |
byte[] |
strToRow(String in)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegionSplitter.HexStringSplit()
Method Detail |
---|
public byte[] split(byte[] start, byte[] end)
RegionSplitter.SplitAlgorithm
split
in interface RegionSplitter.SplitAlgorithm
start
- first row (inclusive)end
- last row (exclusive)
public byte[][] split(int n)
RegionSplitter.SplitAlgorithm
split
in interface RegionSplitter.SplitAlgorithm
n
- number of regions to split the table into
public byte[] firstRow()
RegionSplitter.SplitAlgorithm
firstRow
in interface RegionSplitter.SplitAlgorithm
public byte[] lastRow()
RegionSplitter.SplitAlgorithm
lastRow
in interface RegionSplitter.SplitAlgorithm
public void setFirstRow(String userInput)
RegionSplitter.SplitAlgorithm
setFirstRow
in interface RegionSplitter.SplitAlgorithm
userInput
- raw user input (may throw RuntimeException on parse failure)public void setLastRow(String userInput)
RegionSplitter.SplitAlgorithm
setLastRow
in interface RegionSplitter.SplitAlgorithm
userInput
- raw user input (may throw RuntimeException on parse failure)public byte[] strToRow(String in)
strToRow
in interface RegionSplitter.SplitAlgorithm
in
- user or file input for row
public String rowToStr(byte[] row)
rowToStr
in interface RegionSplitter.SplitAlgorithm
row
- byte array representing a row in HBase
public String separator()
separator
in interface RegionSplitter.SplitAlgorithm
public void setFirstRow(byte[] userInput)
RegionSplitter.SplitAlgorithm
setFirstRow
in interface RegionSplitter.SplitAlgorithm
userInput
- byte array of the row key.public void setLastRow(byte[] userInput)
RegionSplitter.SplitAlgorithm
setLastRow
in interface RegionSplitter.SplitAlgorithm
userInput
- byte array of the row key.public BigInteger split2(BigInteger a, BigInteger b)
a
- number #1b
- number #2
public byte[][] convertToBytes(BigInteger[] bigIntegers)
bigIntegers
- numbers to convert
public static byte[] convertToByte(BigInteger bigInteger, int pad)
bigInteger
- number to convertpad
- padding length
public byte[] convertToByte(BigInteger bigInteger)
bigInteger
- number to convert
public BigInteger convertToBigInteger(byte[] row)
row
- byte array representing row
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |