Created
December 12, 2015 14:11
-
-
Save bobrik/fc7fa3f4e69f8dee3cea to your computer and use it in GitHub Desktop.
TableInputFormat for HBase that works with binary row keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.mapreduce.TableInputFormat; | |
import org.apache.hadoop.hbase.util.Bytes; | |
public class UnfuckedTableInputFormat extends TableInputFormat { | |
@Override | |
public void setConf(Configuration configuration) { | |
super.setConf(configuration); | |
if (getConf().get(SCAN_ROW_START) != null) { | |
getScan().setStartRow(Bytes.toBytesBinary(getConf().get(SCAN_ROW_START))); | |
} | |
if (getConf().get(SCAN_ROW_STOP) != null) { | |
getScan().setStopRow(Bytes.toBytesBinary(getConf().get(SCAN_ROW_STOP))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment