Class SimpleTotalOrderPartitioner<VALUE>
java.lang.Object
org.apache.hadoop.mapreduce.Partitioner<ImmutableBytesWritable,VALUE>
org.apache.hadoop.hbase.mapreduce.SimpleTotalOrderPartitioner<VALUE>
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
@Public
public class SimpleTotalOrderPartitioner<VALUE>
extends org.apache.hadoop.mapreduce.Partitioner<ImmutableBytesWritable,VALUE>
implements org.apache.hadoop.conf.Configurable
A partitioner that takes start and end keys and uses bigdecimal to figure which reduce a key
belongs to. Pass the start and end keys in the Configuration using "hbase.simpletotalorder.start.base64" and
"hbase.simpletotalorder.end.base64". The end key needs to be exclusive; i.e. one larger than the biggest key in
your key space. You may be surprised at how this class partitions the space; it may not align
with preconceptions; e.g. a start key of zero and an end key of 100 divided in ten will not make
regions whose range is 0-10, 10-20, and so on. Make your own partitioner if you need the region
spacing to come out a particular way.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]
getBase64KeyFromConf
(org.apache.hadoop.conf.Configuration conf, String base64Key) org.apache.hadoop.conf.Configuration
getConf()
(package private) static byte[]
getEndKey
(org.apache.hadoop.conf.Configuration conf) int
getPartition
(ImmutableBytesWritable key, VALUE value, int reduces) (package private) static byte[]
getStartKey
(org.apache.hadoop.conf.Configuration conf) void
setConf
(org.apache.hadoop.conf.Configuration conf) static void
setEndKey
(org.apache.hadoop.conf.Configuration conf, byte[] endKey) static void
setStartKey
(org.apache.hadoop.conf.Configuration conf, byte[] startKey)
-
Field Details
-
LOG
-
START_BASE64
- See Also:
-
END_BASE64
- See Also:
-
c
-
startkey
-
endkey
-
splits
-
lastReduces
-
-
Constructor Details
-
SimpleTotalOrderPartitioner
public SimpleTotalOrderPartitioner()
-
-
Method Details
-
setStartKey
-
setEndKey
-
getStartKey
-
getEndKey
-
getBase64KeyFromConf
private static byte[] getBase64KeyFromConf(org.apache.hadoop.conf.Configuration conf, String base64Key) -
getPartition
- Specified by:
getPartition
in classorg.apache.hadoop.mapreduce.Partitioner<ImmutableBytesWritable,
VALUE>
-
getConf
- Specified by:
getConf
in interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
-