org.apache.hadoop.hbase.io.hfile.Compression.Algorithm Java Examples

The following examples show how to use org.apache.hadoop.hbase.io.hfile.Compression.Algorithm. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HFileSortedOplog.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public HFileSortedOplogWriter(int keys) throws IOException {
      try {
        int hfileBlockSize = Integer.getInteger(
            HoplogConfig.HFILE_BLOCK_SIZE_CONF, (1 << 16));

        Algorithm compress = Algorithm.valueOf(System.getProperty(HoplogConfig.COMPRESSION,
            HoplogConfig.COMPRESSION_DEFAULT));

//        ByteComparator bc = new ByteComparator();
        writer = HFile.getWriterFactory(conf, cacheConf)
            .withPath(fsProvider.getFS(), path)
            .withBlockSize(hfileBlockSize)
//            .withComparator(bc)
            .withCompression(compress)
            .create();
        bfw = BloomFilterFactory.createGeneralBloomAtWrite(conf, cacheConf, BloomType.ROW, keys,
            writer);

        logger.fine("Created hoplog writer with compression " + compress);
      } catch (IOException e) {
        logger.fine("IO Error while creating writer");
        throw e;
      }
    }
 
Example #2
Source File: HFileSortedOplog.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
public HFileSortedOplogWriter(int keys) throws IOException {
      try {
        int hfileBlockSize = Integer.getInteger(
            HoplogConfig.HFILE_BLOCK_SIZE_CONF, (1 << 16));

        Algorithm compress = Algorithm.valueOf(System.getProperty(HoplogConfig.COMPRESSION,
            HoplogConfig.COMPRESSION_DEFAULT));

//        ByteComparator bc = new ByteComparator();
        writer = HFile.getWriterFactory(conf, cacheConf)
            .withPath(fsProvider.getFS(), path)
            .withBlockSize(hfileBlockSize)
//            .withComparator(bc)
            .withCompression(compress)
            .create();
        bfw = BloomFilterFactory.createGeneralBloomAtWrite(conf, cacheConf, BloomType.ROW, keys,
            writer);

        logger.fine("Created hoplog writer with compression " + compress);
      } catch (IOException e) {
        logger.fine("IO Error while creating writer");
        throw e;
      }
    }
 
Example #3
Source File: HFileSortedOplogFactory.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static Algorithm convertCompression(Compression type) {
  switch (type) {
  default:
  case NONE: return Algorithm.NONE;
  }
}
 
Example #4
Source File: HFileSortedOplogFactory.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static Algorithm convertCompression(Compression type) {
  switch (type) {
  default:
  case NONE: return Algorithm.NONE;
  }
}