HBASE-5656 LoadIncrementalHFiles createTable should detect and set compression algorithm(Cosmin Lehene)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1311106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2012-04-08 21:34:19 +00:00
parent 2f06c667d3
commit 720a974794
1 changed files with 5 additions and 0 deletions

View File

@ -659,6 +659,11 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
new CacheConfig(getConf())); new CacheConfig(getConf()));
final byte[] first, last; final byte[] first, last;
try { try {
if (hcd.getCompressionType() != reader.getCompressionAlgorithm()) {
hcd.setCompressionType(reader.getCompressionAlgorithm());
LOG.info("Setting compression " + hcd.getCompressionType().name() +
" for family " + hcd.toString());
}
reader.loadFileInfo(); reader.loadFileInfo();
first = reader.getFirstRowKey(); first = reader.getFirstRowKey();
last = reader.getLastRowKey(); last = reader.getLastRowKey();