org.apache.hadoop.hbase.regionserver
Class StoreFile.WriterBuilder

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.StoreFile.WriterBuilder
Enclosing class:
StoreFile

public static class StoreFile.WriterBuilder
extends Object


Constructor Summary
StoreFile.WriterBuilder(org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, org.apache.hadoop.fs.FileSystem fs, int blockSize)
           
 
Method Summary
 StoreFile.Writer build()
          Create a store file writer.
 StoreFile.WriterBuilder withBloomType(StoreFile.BloomType bloomType)
           
 StoreFile.WriterBuilder withBytesPerChecksum(int bytesPerChecksum)
           
 StoreFile.WriterBuilder withChecksumType(ChecksumType checksumType)
           
 StoreFile.WriterBuilder withComparator(KeyValue.KVComparator comparator)
           
 StoreFile.WriterBuilder withCompression(Compression.Algorithm compressAlgo)
           
 StoreFile.WriterBuilder withDataBlockEncoder(HFileDataBlockEncoder encoder)
           
 StoreFile.WriterBuilder withFilePath(org.apache.hadoop.fs.Path filePath)
          Use either this method or withOutputDir(org.apache.hadoop.fs.Path), but not both.
 StoreFile.WriterBuilder withMaxKeyCount(long maxKeyCount)
           
 StoreFile.WriterBuilder withOutputDir(org.apache.hadoop.fs.Path dir)
          Use either this method or withFilePath(org.apache.hadoop.fs.Path), but not both.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreFile.WriterBuilder

public StoreFile.WriterBuilder(org.apache.hadoop.conf.Configuration conf,
                               CacheConfig cacheConf,
                               org.apache.hadoop.fs.FileSystem fs,
                               int blockSize)
Method Detail

withOutputDir

public StoreFile.WriterBuilder withOutputDir(org.apache.hadoop.fs.Path dir)
Use either this method or withFilePath(org.apache.hadoop.fs.Path), but not both.

Parameters:
dir - Path to column family directory. The directory is created if does not exist. The file is given a unique name within this directory.
Returns:
this (for chained invocation)

withFilePath

public StoreFile.WriterBuilder withFilePath(org.apache.hadoop.fs.Path filePath)
Use either this method or withOutputDir(org.apache.hadoop.fs.Path), but not both.

Parameters:
filePath - the StoreFile path to write
Returns:
this (for chained invocation)

withCompression

public StoreFile.WriterBuilder withCompression(Compression.Algorithm compressAlgo)

withDataBlockEncoder

public StoreFile.WriterBuilder withDataBlockEncoder(HFileDataBlockEncoder encoder)

withComparator

public StoreFile.WriterBuilder withComparator(KeyValue.KVComparator comparator)

withBloomType

public StoreFile.WriterBuilder withBloomType(StoreFile.BloomType bloomType)

withMaxKeyCount

public StoreFile.WriterBuilder withMaxKeyCount(long maxKeyCount)
Parameters:
maxKeyCount - estimated maximum number of keys we expect to add
Returns:
this (for chained invocation)

withChecksumType

public StoreFile.WriterBuilder withChecksumType(ChecksumType checksumType)
Parameters:
checksumType - the type of checksum
Returns:
this (for chained invocation)

withBytesPerChecksum

public StoreFile.WriterBuilder withBytesPerChecksum(int bytesPerChecksum)
Parameters:
bytesPerChecksum - the number of bytes per checksum chunk
Returns:
this (for chained invocation)

build

public StoreFile.Writer build()
                       throws IOException
Create a store file writer. Client is responsible for closing file when done. If metadata, add BEFORE closing using StoreFile.Writer.appendMetadata(long, boolean).

Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.