org.apache.lucene.codecs.lucene40.values
Class DocValuesWriterBase

java.lang.Object
  extended by org.apache.lucene.codecs.PerDocConsumer
      extended by org.apache.lucene.codecs.lucene40.values.DocValuesWriterBase
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
Lucene40DocValuesConsumer

public abstract class DocValuesWriterBase
extends PerDocConsumer

Abstract base class for PerDocConsumer implementations

WARNING: This API is experimental and might change in incompatible ways in the next release.

Field Summary
protected  IOContext context
          IOContext to use when writing files.
static String DATA_EXTENSION
          Filename extension for data files.
static String INDEX_EXTENSION
          Filename extension for index files
protected  String segmentName
          Segment name to use when writing files.
 
Constructor Summary
protected DocValuesWriterBase(PerDocWriteState state)
          Creates DocValuesWriterBase, using PackedInts.FAST.
protected DocValuesWriterBase(PerDocWriteState state, float acceptableOverheadRatio)
          Creates DocValuesWriterBase.
 
Method Summary
 DocValuesConsumer addValuesField(DocValues.Type valueType, FieldInfo field)
          Adds a new DocValuesField
 void close()
           
 Comparator<BytesRef> getComparator()
          Returns the comparator used to sort BytesRef values.
protected abstract  Directory getDirectory()
          Returns the Directory that files should be written to.
 
Methods inherited from class org.apache.lucene.codecs.PerDocConsumer
abort, canMerge, getDocValuesForMerge, getDocValuesType, merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

segmentName

protected final String segmentName
Segment name to use when writing files.


context

protected final IOContext context
IOContext to use when writing files.


INDEX_EXTENSION

public static final String INDEX_EXTENSION
Filename extension for index files

See Also:
Constant Field Values

DATA_EXTENSION

public static final String DATA_EXTENSION
Filename extension for data files.

See Also:
Constant Field Values
Constructor Detail

DocValuesWriterBase

protected DocValuesWriterBase(PerDocWriteState state)
Creates DocValuesWriterBase, using PackedInts.FAST.

Parameters:
state - The state to initiate a PerDocConsumer instance

DocValuesWriterBase

protected DocValuesWriterBase(PerDocWriteState state,
                              float acceptableOverheadRatio)
Creates DocValuesWriterBase.

Parameters:
state - The state to initiate a PerDocConsumer instance
acceptableOverheadRatio - how to trade space for speed. This option is only applicable for docvalues of type DocValues.Type.BYTES_FIXED_SORTED and DocValues.Type.BYTES_VAR_SORTED.
See Also:
PackedInts.getReader(org.apache.lucene.store.DataInput)
Method Detail

getDirectory

protected abstract Directory getDirectory()
                                   throws IOException
Returns the Directory that files should be written to.

Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class PerDocConsumer
Throws:
IOException

addValuesField

public DocValuesConsumer addValuesField(DocValues.Type valueType,
                                        FieldInfo field)
                                 throws IOException
Description copied from class: PerDocConsumer
Adds a new DocValuesField

Specified by:
addValuesField in class PerDocConsumer
Throws:
IOException

getComparator

public Comparator<BytesRef> getComparator()
                                   throws IOException
Returns the comparator used to sort BytesRef values.

Throws:
IOException


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.