Search in sources :

Example 1 with KeyValueCodec

use of org.apache.hadoop.hbase.codec.KeyValueCodec in project hbase by apache.

the class TestCellBlockBuilder method main.

/**
   * For running a few tests of methods herein.
   * @param args
   * @throws IOException
   */
public static void main(String[] args) throws IOException {
    int count = 1024;
    int size = 10240;
    for (String arg : args) {
        if (arg.startsWith(COUNT)) {
            count = Integer.parseInt(arg.replace(COUNT, ""));
        } else if (arg.startsWith(SIZE)) {
            size = Integer.parseInt(arg.replace(SIZE, ""));
        } else {
            usage(1);
        }
    }
    CellBlockBuilder builder = new CellBlockBuilder(HBaseConfiguration.create());
    ((Log4JLogger) CellBlockBuilder.LOG).getLogger().setLevel(Level.ALL);
    timerTests(builder, count, size, new KeyValueCodec(), null);
    timerTests(builder, count, size, new KeyValueCodec(), new DefaultCodec());
    timerTests(builder, count, size, new KeyValueCodec(), new GzipCodec());
}
Also used : KeyValueCodec(org.apache.hadoop.hbase.codec.KeyValueCodec) GzipCodec(org.apache.hadoop.io.compress.GzipCodec) DefaultCodec(org.apache.hadoop.io.compress.DefaultCodec)

Example 2 with KeyValueCodec

use of org.apache.hadoop.hbase.codec.KeyValueCodec in project hbase by apache.

the class TestCellBlockBuilder method testBuildCellBlock.

@Test
public void testBuildCellBlock() throws IOException {
    doBuildCellBlockUndoCellBlock(this.builder, new KeyValueCodec(), null);
    doBuildCellBlockUndoCellBlock(this.builder, new KeyValueCodec(), new DefaultCodec());
    doBuildCellBlockUndoCellBlock(this.builder, new KeyValueCodec(), new GzipCodec());
}
Also used : KeyValueCodec(org.apache.hadoop.hbase.codec.KeyValueCodec) GzipCodec(org.apache.hadoop.io.compress.GzipCodec) DefaultCodec(org.apache.hadoop.io.compress.DefaultCodec) Test(org.junit.Test)

Example 3 with KeyValueCodec

use of org.apache.hadoop.hbase.codec.KeyValueCodec in project hbase by apache.

the class CodecPerformance method main.

public static void main(String[] args) throws IOException {
    // How many Cells to encode/decode on each cycle.
    final int count = 100000;
    // How many times to do an operation; repeat gives hotspot chance to warm up.
    final int cycles = 30;
    Cell[] cells = getCells(count);
    int size = getRoughSize(cells);
    // Multiply by 2 to ensure we don't have to grow buffer
    int initialBufferSize = 2 * size;
    // Test KeyValue codec.
    doCodec(new KeyValueCodec(), cells, cycles, count, initialBufferSize);
    doCodec(new CellCodec(), cells, cycles, count, initialBufferSize);
    doCodec(new MessageCodec(), cells, cycles, count, initialBufferSize);
}
Also used : CellCodec(org.apache.hadoop.hbase.codec.CellCodec) KeyValueCodec(org.apache.hadoop.hbase.codec.KeyValueCodec) MessageCodec(org.apache.hadoop.hbase.codec.MessageCodec) Cell(org.apache.hadoop.hbase.Cell)

Aggregations

KeyValueCodec (org.apache.hadoop.hbase.codec.KeyValueCodec)3 DefaultCodec (org.apache.hadoop.io.compress.DefaultCodec)2 GzipCodec (org.apache.hadoop.io.compress.GzipCodec)2 Cell (org.apache.hadoop.hbase.Cell)1 CellCodec (org.apache.hadoop.hbase.codec.CellCodec)1 MessageCodec (org.apache.hadoop.hbase.codec.MessageCodec)1 Test (org.junit.Test)1