public abstract static class RegionSplitter.NumberStringSplit extends Object implements RegionSplitter.SplitAlgorithm
Modifier and Type | Field and Description |
---|---|
(package private) String |
firstRow |
(package private) BigInteger |
firstRowInt |
(package private) String |
lastRow |
(package private) BigInteger |
lastRowInt |
(package private) int |
radix |
(package private) int |
rowComparisonLength |
Constructor and Description |
---|
NumberStringSplit(String minRow,
String maxRow,
int radix) |
Modifier and Type | Method and Description |
---|---|
BigInteger |
convertToBigInteger(byte[] row)
Returns the BigInteger represented by the byte array
|
byte[] |
convertToByte(BigInteger bigInteger)
Returns the bytes corresponding to the BigInteger
|
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)
n * byte array representing a row in HBase
|
String |
separator()
Returns the separator character to use when storing / printing the row
|
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(byte[] start,
byte[] end,
int numSplits,
boolean inclusive)
Some MapReduce jobs may want to run multiple mappers per region, this is intended for such
usecase.
|
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)
n * user or file input for row
|
String |
toString() |
BigInteger firstRowInt
BigInteger lastRowInt
int rowComparisonLength
int radix
NumberStringSplit(String minRow, String maxRow, int radix)
public byte[] split(byte[] start, byte[] end)
RegionSplitter.SplitAlgorithm
split
in interface RegionSplitter.SplitAlgorithm
public byte[][] split(int n)
RegionSplitter.SplitAlgorithm
split
in interface RegionSplitter.SplitAlgorithm
public byte[][] split(byte[] start, byte[] end, int numSplits, boolean inclusive)
RegionSplitter.SplitAlgorithm
split
in interface RegionSplitter.SplitAlgorithm
start
- first row (inclusive)end
- last row (exclusive)numSplits
- number of splits to generateinclusive
- whether start and end are returned as split pointspublic 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
public void setLastRow(String userInput)
RegionSplitter.SplitAlgorithm
setLastRow
in interface RegionSplitter.SplitAlgorithm
public byte[] strToRow(String in)
RegionSplitter.SplitAlgorithm
strToRow
in interface RegionSplitter.SplitAlgorithm
public String rowToStr(byte[] row)
RegionSplitter.SplitAlgorithm
rowToStr
in interface RegionSplitter.SplitAlgorithm
public String separator()
RegionSplitter.SplitAlgorithm
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 #2public byte[][] convertToBytes(BigInteger[] bigIntegers)
bigIntegers
- numbers to convertpublic byte[] convertToByte(BigInteger bigInteger, int pad)
bigInteger
- number to convertpad
- padding lengthpublic byte[] convertToByte(BigInteger bigInteger)
bigInteger
- number to convertpublic BigInteger convertToBigInteger(byte[] row)
row
- byte array representing rowCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.