Class HFileTestUtil

java.lang.Object
org.apache.hadoop.hbase.util.HFileTestUtil

public class HFileTestUtil extends Object
Utility class for HFile-related testing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte[][]
    Column families used by the test
    static byte[]
    Column family used by the test
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • 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

      public static void verifyTags(org.apache.hadoop.hbase.client.Table table) throws IOException
      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