Package org.apache.hadoop.hbase.io.util

Examples of org.apache.hadoop.hbase.io.util.LRUDictionary


  @Test
  public void testCompressingWithClearDictionaries() throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    Dictionary dictionary = new LRUDictionary();
    dictionary.init(Short.MAX_VALUE);
    byte [] blahBytes = Bytes.toBytes("blah");
    Compressor.writeCompressed(blahBytes, 0, blahBytes.length, dos, dictionary);
    dos.close();
    byte [] dosbytes = baos.toByteArray();
    DataInputStream dis =
      new DataInputStream(new ByteArrayInputStream(dosbytes));
    dictionary = new LRUDictionary();
    dictionary.init(Short.MAX_VALUE);
    byte [] product = Compressor.readCompressed(dis, dictionary);
    assertTrue(Bytes.equals(blahBytes, product));
  }
View Full Code Here


  @Test
  public void testCompressingWithClearDictionaries() throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    Dictionary dictionary = new LRUDictionary();
    dictionary.init(Short.MAX_VALUE);
    byte [] blahBytes = Bytes.toBytes("blah");
    Compressor.writeCompressed(blahBytes, 0, blahBytes.length, dos, dictionary);
    dos.close();
    byte [] dosbytes = baos.toByteArray();
    DataInputStream dis =
      new DataInputStream(new ByteArrayInputStream(dosbytes));
    dictionary = new LRUDictionary();
    dictionary.init(Short.MAX_VALUE);
    byte [] product = Compressor.readCompressed(dis, dictionary);
    assertTrue(Bytes.equals(blahBytes, product));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.io.util.LRUDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.