HBASE-10443-IndexOutOfBoundExceptions when processing compressed tags in HFile(Ramkrishna S Vasudevan)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1563584 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ramkrishna 2014-02-02 09:16:21 +00:00
parent 11eace02ab
commit d5a347591c
3 changed files with 20 additions and 15 deletions

View File

@ -18,9 +18,14 @@
*/
package org.apache.hadoop.hbase;
import com.google.common.base.Preconditions;
import com.google.protobuf.HBaseZeroCopyByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
@ -37,14 +42,9 @@ import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.common.base.Preconditions;
import com.google.protobuf.HBaseZeroCopyByteString;
import com.google.protobuf.InvalidProtocolBufferException;
/**
* An HColumnDescriptor contains information about a column family such as the
@ -194,9 +194,10 @@ public class HColumnDescriptor implements WritableComparable<HColumnDescriptor>
public static final boolean DEFAULT_EVICT_BLOCKS_ON_CLOSE = false;
/**
* Default compress tags along with any type of DataBlockEncoding
* Default compress tags along with any type of DataBlockEncoding.
* Disabled to false by default in 0.98.0
*/
public static final boolean DEFAULT_COMPRESS_TAGS = true;
public static final boolean DEFAULT_COMPRESS_TAGS = false;
private final static Map<String, String> DEFAULT_VALUES
= new HashMap<String, String>();

View File

@ -42,7 +42,7 @@ public class HFileContextBuilder {
/** Compression algorithm used **/
private Algorithm compression = Algorithm.NONE;
/** Whether tags to be compressed or not **/
private boolean compressTags;
private boolean compressTags = false;
/** the checksum type **/
private ChecksumType checksumType = DEFAULT_CHECKSUM_TYPE;
/** the number of bytes per checksum value **/

View File

@ -891,11 +891,15 @@ public class HStore implements Store {
if (compression == null) {
compression = HFile.DEFAULT_COMPRESSION_ALGORITHM;
}
if(family.shouldCompressTags()) {
LOG.warn("HFile tag compression attribute ignored for '" + family.getNameAsString()
+ "', see HBASE-10443.");
}
HFileContext hFileContext = new HFileContextBuilder()
.withIncludesMvcc(includeMVCCReadpoint)
.withIncludesTags(includesTag)
.withCompression(compression)
.withCompressTags(family.shouldCompressTags())
.withCompressTags(false)
.withChecksumType(checksumType)
.withBytesPerCheckSum(bytesPerChecksum)
.withBlockSize(blocksize)