Class KVGenerator

java.lang.Object
org.apache.hadoop.hbase.io.hfile.KVGenerator

class KVGenerator extends Object
Generate random <key, value> pairs.

Copied from hadoop-3315 tfile. Remove after tfile is committed and use the tfile version of this class instead.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final byte[][]
     
    private final org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG
     
    private org.apache.hadoop.io.BytesWritable
     
    private static final int
     
    private final byte[]
     
    private final Random
     
    private final boolean
     
    private final org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KVGenerator(Random random, boolean sorted, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG keyLenRNG, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG valLenRNG, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG wordLenRNG, int dictSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    fillKey(org.apache.hadoop.io.BytesWritable o)
     
    private void
    fillValue(org.apache.hadoop.io.BytesWritable o)
     
    private void
     
    void
    next(org.apache.hadoop.io.BytesWritable key, org.apache.hadoop.io.BytesWritable value, boolean dupKey)
     

    Methods inherited from class java.lang.Object

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

    • random

      private final Random random
    • dict

      private final byte[][] dict
    • sorted

      private final boolean sorted
    • keyLenRNG

      private final org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG keyLenRNG
    • valLenRNG

      private final org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG valLenRNG
    • lastKey

      private org.apache.hadoop.io.BytesWritable lastKey
    • MIN_KEY_LEN

      private static final int MIN_KEY_LEN
      See Also:
    • prefix

      private final byte[] prefix
  • Constructor Details

    • KVGenerator

      public KVGenerator(Random random, boolean sorted, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG keyLenRNG, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG valLenRNG, org.apache.hadoop.hbase.util.RandomDistribution.DiscreteRNG wordLenRNG, int dictSize)
  • Method Details

    • fillKey

      private void fillKey(org.apache.hadoop.io.BytesWritable o)
    • fillValue

      private void fillValue(org.apache.hadoop.io.BytesWritable o)
    • incrementPrefix

      private void incrementPrefix()
    • next

      public void next(org.apache.hadoop.io.BytesWritable key, org.apache.hadoop.io.BytesWritable value, boolean dupKey)