org.apache.lucene.codecs.lucene40
Class Lucene40DocValuesProducer

java.lang.Object
  extended by org.apache.lucene.codecs.PerDocProducer
      extended by org.apache.lucene.codecs.PerDocProducerBase
          extended by org.apache.lucene.codecs.lucene40.Lucene40DocValuesProducer
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
Lucene40NormsFormat.Lucene40NormsDocValuesProducer

public class Lucene40DocValuesProducer
extends PerDocProducerBase

Lucene 4.0 PerDocProducer implementation that uses compound file.

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

Field Summary
protected  TreeMap<String,DocValues> docValues
          Maps field name to DocValues instance.
 
Constructor Summary
Lucene40DocValuesProducer(SegmentReadState state, String segmentSuffix)
          Creates a new Lucene40DocValuesProducer instance and loads all DocValues instances for this segment and codec.
 
Method Summary
protected  void closeInternal(Collection<? extends Closeable> closeables)
          Closes provided Closables.
protected  Map<String,DocValues> docValues()
          Returns a map, mapping field names to doc values.
protected  DocValues loadDocValues(int docCount, Directory dir, String id, DocValues.Type type, IOContext context)
          Loads a DocValues instance depending on the given DocValues.Type.
 
Methods inherited from class org.apache.lucene.codecs.PerDocProducerBase
anyDocValuesFields, canLoad, close, docValues, docValuesId, getComparator, getDocValuesType, load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

docValues

protected final TreeMap<String,DocValues> docValues
Maps field name to DocValues instance.

Constructor Detail

Lucene40DocValuesProducer

public Lucene40DocValuesProducer(SegmentReadState state,
                                 String segmentSuffix)
                          throws IOException
Creates a new Lucene40DocValuesProducer instance and loads all DocValues instances for this segment and codec.

Throws:
IOException
Method Detail

docValues

protected Map<String,DocValues> docValues()
Description copied from class: PerDocProducerBase
Returns a map, mapping field names to doc values.

Specified by:
docValues in class PerDocProducerBase

closeInternal

protected void closeInternal(Collection<? extends Closeable> closeables)
                      throws IOException
Description copied from class: PerDocProducerBase
Closes provided Closables.

Specified by:
closeInternal in class PerDocProducerBase
Throws:
IOException

loadDocValues

protected DocValues loadDocValues(int docCount,
                                  Directory dir,
                                  String id,
                                  DocValues.Type type,
                                  IOContext context)
                           throws IOException
Description copied from class: PerDocProducerBase
Loads a DocValues instance depending on the given DocValues.Type. Codecs that use different implementations for a certain DocValues.Type can simply override this method and return their custom implementations.

Specified by:
loadDocValues in class PerDocProducerBase
Parameters:
docCount - number of documents in the segment
dir - the Directory to load the DocValues from
id - the unique file ID within the segment
type - the type to load
Returns:
a DocValues instance for the given type
Throws:
IOException - if an IOException occurs


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