org.apache.hadoop.hbase.io.hfile
Class HFile.WriterFactory

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.HFile.WriterFactory
Enclosing class:
HFile

public abstract static class HFile.WriterFactory
extends Object

This variety of ways to construct writers is used throughout the code, and we want to be able to swap writer implementations.


Field Summary
protected  CacheConfig cacheConf
           
protected  KeyValue.KVComparator comparator
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected  InetSocketAddress[] favoredNodes
           
protected  org.apache.hadoop.fs.FileSystem fs
           
protected  org.apache.hadoop.fs.FSDataOutputStream ostream
           
protected  org.apache.hadoop.fs.Path path
           
protected  boolean shouldDropBehind
           
 
Method Summary
 HFile.Writer create()
           
protected abstract  HFile.Writer createWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FSDataOutputStream ostream, KeyValue.KVComparator comparator, HFileContext fileContext)
           
 HFile.WriterFactory withComparator(KeyValue.KVComparator comparator)
           
 HFile.WriterFactory withFavoredNodes(InetSocketAddress[] favoredNodes)
           
 HFile.WriterFactory withFileContext(HFileContext fileContext)
           
 HFile.WriterFactory withOutputStream(org.apache.hadoop.fs.FSDataOutputStream ostream)
           
 HFile.WriterFactory withPath(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
           
 HFile.WriterFactory withShouldDropCacheBehind(boolean shouldDropBehind)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected final org.apache.hadoop.conf.Configuration conf

cacheConf

protected final CacheConfig cacheConf

fs

protected org.apache.hadoop.fs.FileSystem fs

path

protected org.apache.hadoop.fs.Path path

ostream

protected org.apache.hadoop.fs.FSDataOutputStream ostream

comparator

protected KeyValue.KVComparator comparator

favoredNodes

protected InetSocketAddress[] favoredNodes

shouldDropBehind

protected boolean shouldDropBehind
Method Detail

withPath

public HFile.WriterFactory withPath(org.apache.hadoop.fs.FileSystem fs,
                                    org.apache.hadoop.fs.Path path)

withOutputStream

public HFile.WriterFactory withOutputStream(org.apache.hadoop.fs.FSDataOutputStream ostream)

withComparator

public HFile.WriterFactory withComparator(KeyValue.KVComparator comparator)

withFavoredNodes

public HFile.WriterFactory withFavoredNodes(InetSocketAddress[] favoredNodes)

withFileContext

public HFile.WriterFactory withFileContext(HFileContext fileContext)

withShouldDropCacheBehind

public HFile.WriterFactory withShouldDropCacheBehind(boolean shouldDropBehind)

create

public HFile.Writer create()
                    throws IOException
Throws:
IOException

createWriter

protected abstract HFile.Writer createWriter(org.apache.hadoop.fs.FileSystem fs,
                                             org.apache.hadoop.fs.Path path,
                                             org.apache.hadoop.fs.FSDataOutputStream ostream,
                                             KeyValue.KVComparator comparator,
                                             HFileContext fileContext)
                                      throws IOException
Throws:
IOException


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.