Class GlobalOrdinalsIndexFieldData.Consumer
- java.lang.Object
-
- org.elasticsearch.index.AbstractIndexComponent
-
- org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData.Consumer
-
- All Implemented Interfaces:
org.apache.lucene.util.Accountable
,IndexFieldData<AtomicOrdinalsFieldData>
,IndexFieldData.Global<AtomicOrdinalsFieldData>
,IndexOrdinalsFieldData
,IndexComponent
- Enclosing class:
- GlobalOrdinalsIndexFieldData
public class GlobalOrdinalsIndexFieldData.Consumer extends AbstractIndexComponent implements IndexOrdinalsFieldData, org.apache.lucene.util.Accountable
A non-thread safeIndexOrdinalsFieldData
for global ordinals that creates theTermsEnum
of each segment once and use them to provide a single lookup per segment.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
IndexFieldData.Builder, IndexFieldData.Global<FD extends AtomicFieldData>, IndexFieldData.XFieldComparatorSource
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.index.AbstractIndexComponent
deprecationLogger, indexSettings, logger
-
-
Method Summary
Modifier and Type Method Description void
clear()
Clears any resources associated with this field data.java.util.Collection<org.apache.lucene.util.Accountable>
getChildResources()
java.lang.String
getFieldName()
The field name.org.apache.lucene.index.OrdinalMap
getOrdinalMap()
Returns the underlyingOrdinalMap
for this fielddata or null if global ordinals are not needed (constant value or single segment).AtomicOrdinalsFieldData
load(org.apache.lucene.index.LeafReaderContext context)
Loads the atomic field data for the reader, possibly cached.AtomicOrdinalsFieldData
loadDirect(org.apache.lucene.index.LeafReaderContext context)
Loads directly the atomic field data for the reader, ignoring any caching involved.IndexOrdinalsFieldData
loadGlobal(org.apache.lucene.index.DirectoryReader indexReader)
Load a global view of the ordinals for the givenIndexReader
, potentially from a cache.IndexOrdinalsFieldData
localGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader)
Load a global view of the ordinals for the givenIndexReader
.long
ramBytesUsed()
org.apache.lucene.search.SortField
sortField(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)
Returns theSortField
to use for sorting.boolean
supportsGlobalOrdinalsMapping()
Whether this field data is able to provide a mapping between global and segment ordinals, by returning the underlyingOrdinalMap
.-
Methods inherited from class org.elasticsearch.index.AbstractIndexComponent
getIndexSettings, index
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.index.IndexComponent
index
-
-
-
-
Method Detail
-
loadDirect
public AtomicOrdinalsFieldData loadDirect(org.apache.lucene.index.LeafReaderContext context) throws java.lang.Exception
Description copied from interface:IndexFieldData
Loads directly the atomic field data for the reader, ignoring any caching involved.- Specified by:
loadDirect
in interfaceIndexFieldData<AtomicOrdinalsFieldData>
- Throws:
java.lang.Exception
-
loadGlobal
public IndexOrdinalsFieldData loadGlobal(org.apache.lucene.index.DirectoryReader indexReader)
Description copied from interface:IndexOrdinalsFieldData
Load a global view of the ordinals for the givenIndexReader
, potentially from a cache.- Specified by:
loadGlobal
in interfaceIndexFieldData.Global<AtomicOrdinalsFieldData>
- Specified by:
loadGlobal
in interfaceIndexOrdinalsFieldData
-
localGlobalDirect
public IndexOrdinalsFieldData localGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader) throws java.lang.Exception
Description copied from interface:IndexOrdinalsFieldData
Load a global view of the ordinals for the givenIndexReader
.- Specified by:
localGlobalDirect
in interfaceIndexFieldData.Global<AtomicOrdinalsFieldData>
- Specified by:
localGlobalDirect
in interfaceIndexOrdinalsFieldData
- Throws:
java.lang.Exception
-
getFieldName
public java.lang.String getFieldName()
Description copied from interface:IndexFieldData
The field name.- Specified by:
getFieldName
in interfaceIndexFieldData<AtomicOrdinalsFieldData>
-
sortField
public org.apache.lucene.search.SortField sortField(@Nullable java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)
Description copied from interface:IndexFieldData
Returns theSortField
to use for sorting.- Specified by:
sortField
in interfaceIndexFieldData<AtomicOrdinalsFieldData>
-
clear
public void clear()
Description copied from interface:IndexFieldData
Clears any resources associated with this field data.- Specified by:
clear
in interfaceIndexFieldData<AtomicOrdinalsFieldData>
-
ramBytesUsed
public long ramBytesUsed()
- Specified by:
ramBytesUsed
in interfaceorg.apache.lucene.util.Accountable
-
getChildResources
public java.util.Collection<org.apache.lucene.util.Accountable> getChildResources()
- Specified by:
getChildResources
in interfaceorg.apache.lucene.util.Accountable
-
load
public AtomicOrdinalsFieldData load(org.apache.lucene.index.LeafReaderContext context)
Description copied from interface:IndexFieldData
Loads the atomic field data for the reader, possibly cached.- Specified by:
load
in interfaceIndexFieldData<AtomicOrdinalsFieldData>
-
supportsGlobalOrdinalsMapping
public boolean supportsGlobalOrdinalsMapping()
Description copied from interface:IndexOrdinalsFieldData
Whether this field data is able to provide a mapping between global and segment ordinals, by returning the underlyingOrdinalMap
. If this method returns false, then callingIndexOrdinalsFieldData.getOrdinalMap()
will result in anUnsupportedOperationException
.- Specified by:
supportsGlobalOrdinalsMapping
in interfaceIndexOrdinalsFieldData
-
getOrdinalMap
public org.apache.lucene.index.OrdinalMap getOrdinalMap()
Description copied from interface:IndexOrdinalsFieldData
Returns the underlyingOrdinalMap
for this fielddata or null if global ordinals are not needed (constant value or single segment).- Specified by:
getOrdinalMap
in interfaceIndexOrdinalsFieldData
-
-