public abstract class PerDocProducerBase extends PerDocProducer
Modifier | Constructor and Description |
---|---|
protected |
PerDocProducerBase()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
anyDocValuesFields(FieldInfos infos)
Returns true if any fields indexed doc values.
|
protected boolean |
canLoad(FieldInfo info)
Returns true if this field indexed doc values.
|
void |
close() |
protected abstract void |
closeInternal(Collection<? extends Closeable> closeables)
Closes provided Closables.
|
protected abstract Map<String,DocValues> |
docValues()
Returns a map, mapping field names to doc values.
|
DocValues |
docValues(String field)
Returns
DocValues for the current field. |
static String |
docValuesId(String segmentsName,
int fieldId)
Returns the unique segment and field id for any
per-field files this implementation needs to write.
|
Comparator<BytesRef> |
getComparator()
Returns the comparator used to sort
BytesRef values. |
protected DocValues.Type |
getDocValuesType(FieldInfo info)
Returns the doc values type for this field.
|
protected TreeMap<String,DocValues> |
load(FieldInfos fieldInfos,
String segment,
int docCount,
Directory dir,
IOContext context)
Only opens files...
|
protected abstract DocValues |
loadDocValues(int docCount,
Directory dir,
String id,
DocValues.Type type,
IOContext context)
Loads a
DocValues instance depending on the given DocValues.Type . |
protected PerDocProducerBase()
protected abstract void closeInternal(Collection<? extends Closeable> closeables) throws IOException
IOException
protected abstract Map<String,DocValues> docValues()
public void close() throws IOException
close
in interface Closeable
close
in class PerDocProducer
IOException
public DocValues docValues(String field) throws IOException
PerDocProducer
DocValues
for the current field.docValues
in class PerDocProducer
field
- the field nameDocValues
for this field or null
if not
applicable.IOException
- If an I/O error occurspublic Comparator<BytesRef> getComparator() throws IOException
BytesRef
values.IOException
protected TreeMap<String,DocValues> load(FieldInfos fieldInfos, String segment, int docCount, Directory dir, IOContext context) throws IOException
IOException
protected boolean canLoad(FieldInfo info)
protected DocValues.Type getDocValuesType(FieldInfo info)
protected boolean anyDocValuesFields(FieldInfos infos)
public static String docValuesId(String segmentsName, int fieldId)
protected abstract DocValues loadDocValues(int docCount, Directory dir, String id, DocValues.Type type, IOContext context) throws IOException
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.docCount
- number of documents in the segmentdir
- the Directory
to load the DocValues
fromid
- the unique file ID within the segmenttype
- the type to loadDocValues
instance for the given typeIOException
- if an IOException
occursIllegalArgumentException
- if the given DocValues.Type
is not supportedCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.