Package org.apache.hadoop.hbase.util
Class HFileTestUtil
java.lang.Object
org.apache.hadoop.hbase.util.HFileTestUtil
Utility class for HFile-related testing.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createHFile
(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) Create an HFile with the given number of rows between a given start key and end key @ family:qualifier.static void
createHFile
(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows, boolean withTag) Create an HFile with the given number of rows between a given start key and end key @ family:qualifier.static void
createHFileWithDataBlockEncoding
(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) Create an HFile with the given number of rows between a given start key and end key @ family:qualifier.static void
createHFileWithTags
(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) Create an HFile with the given number of rows between a given start key and end key @ family:qualifier.static void
verifyTags
(org.apache.hadoop.hbase.client.Table table) This verifies that each cell has a tag that is equal to its rowkey name.
-
Field Details
-
OPT_DATA_BLOCK_ENCODING_USAGE
-
OPT_DATA_BLOCK_ENCODING
-
DEFAULT_COLUMN_FAMILY
Column family used by the test -
DEFAULT_COLUMN_FAMILIES
Column families used by the test
-
-
Constructor Details
-
HFileTestUtil
public HFileTestUtil()
-
-
Method Details
-
createHFile
public static void createHFile(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) throws IOException Create an HFile with the given number of rows between a given start key and end key @ family:qualifier. The value will be the key value. This file will not have tags.- Throws:
IOException
-
createHFileWithDataBlockEncoding
public static void createHFileWithDataBlockEncoding(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) throws IOException Create an HFile with the given number of rows between a given start key and end key @ family:qualifier. The value will be the key value. This file will use certain data block encoding algorithm.- Throws:
IOException
-
createHFileWithTags
public static void createHFileWithTags(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows) throws IOException Create an HFile with the given number of rows between a given start key and end key @ family:qualifier. The value will be the key value. This cells will also have a tag whose value is the key.- Throws:
IOException
-
createHFile
public static void createHFile(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, byte[] family, byte[] qualifier, byte[] startKey, byte[] endKey, int numRows, boolean withTag) throws IOException Create an HFile with the given number of rows between a given start key and end key @ family:qualifier. If withTag is true, we add the rowKey as the tag value for tagtype MOB_TABLE_NAME_TAG_TYPE- Throws:
IOException
-
verifyTags
This verifies that each cell has a tag that is equal to its rowkey name. For this to work the hbase instance must have HConstants.RPC_CODEC_CONF_KEY set to KeyValueCodecWithTags.class.getCanonicalName());- Parameters:
table
- table containing tagged cells- Throws:
IOException
- if problems reading table
-