Some handy classes for using Hadoop / Map Reduce / Hbase
IDENTITYMAPPER / IDENTITYREDUCER
org.apache.hadoop.mapreduce.Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
org.apache.hadoop.mapreduce.Reducer<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
jar : hadoop-core.jar
if your mappers and reducers write inputs to outputs, then use these guys. No need to receate them.
SHELL / SHELLCOMMANDEXECUTOR
org.apache.hadoop.util.Shell
org.apache.hadoop.util.Shell.ShellCommandExecutor
jar : hadoop-core.jar
handy for executing commands on local machine and inspect outputs
STRINGUTILS
org.apache.hadoop.util.StringUtils
jar : hadoop-core.jar
lots of functions to deal with Strings. I will highlight a few
StringUtils.byteDesc() : User-friendly / human-readable byte lengths
how many megabytes is 10000000 bytes? this will tell you.
IDENTITYMAPPER / IDENTITYREDUCER
org.apache.hadoop.mapreduce.Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
org.apache.hadoop.mapreduce.Reducer<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
jar : hadoop-core.jar
if your mappers and reducers write inputs to outputs, then use these guys. No need to receate them.
SHELL / SHELLCOMMANDEXECUTOR
org.apache.hadoop.util.Shell
org.apache.hadoop.util.Shell.ShellCommandExecutor
jar : hadoop-core.jar
handy for executing commands on local machine and inspect outputs
123456789101112131415161718192021222324 |
|
STRINGUTILS
org.apache.hadoop.util.StringUtils
jar : hadoop-core.jar
lots of functions to deal with Strings. I will highlight a few
StringUtils.byteDesc() : User-friendly / human-readable byte lengths
how many megabytes is 10000000 bytes? this will tell you.
123456789101112 |
|
StringUtils.byteToHexString() : Convert Bytes to Hex strings and vice-versa
We deal with byte arrays in Hadoop / map reduce. This is a handy way to print / debug issues
12345678910111213 |
|
StringUtils.formatTime() : human readable elapsed time
how long is 100000000 ms? see below
1234567891011 |
|
HADOOP CLUSTER STATUS
ClusterStatus : org.apache.hadoop.mapred.ClusterStatus
jar : hadoop-core.jar
Find out how many nodes are in the cluster, how many mappers, reducers ...etc
1234567891011121314151617181920212223242526272829303132333435363738394041 |
|
Hbase Handy Classes
BYTES
org.apache.hadoop.hbase.util.Bytes
jar : hbase*.jar
handy utility for dealing with bytes and byte arrays
Bytes.toBytes() : convert objects to bytes
123456789101112131415161718 |
|
Bytes.add() : create composite keys
12345678910111213141516 |
|
Comments
Post a Comment