Interface IndexerBatchContext
-
- All Known Implementing Classes:
DefaultIndexerBatchContext
public interface IndexerBatchContext
This interface represents a context valid for the duration of an indexer batch. Each batch runs on a separate thread and this context is only valid for the corresponding thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IndexerBatchContext.Status
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Returns a mutableMap
that can be used to store attributes associated with thisIndexerBatchContext
.FacetSearchConfig
getFacetSearchConfig()
Returns the facet search configuration.java.util.List<java.lang.Exception>
getFailureExceptions()
Returns all failure causing exceptions for thisIndexerBatchContext
.Index
getIndex()
Returns the index to use during the indexer operation.java.util.Collection<IndexedProperty>
getIndexedProperties()
Returns the indexed properties to be indexed.IndexedType
getIndexedType()
Returns the indexed type.java.util.Map<java.lang.String,java.lang.String>
getIndexerHints()
Returns a mutableMap
that can be used to store indexer hints.IndexOperation
getIndexOperation()
Returns the index operation.long
getIndexOperationId()
Returns the index operation id.java.util.List<InputDocument>
getInputDocuments()
Returns a mutableList
that can be used to store attributes associated with this input documents.java.util.List<ItemModel>
getItems()
Returns the items to be indexed in this batch.java.util.List<PK>
getPks()
Return the pks to be indexed in this batch.IndexerBatchContext.Status
getStatus()
Returns the current status for thisIndexerBatchContext
boolean
isExternalIndexOperation()
Returnstrue
if the index operation is external.void
setIndex(Index index)
Sets the index to use during the indexer operation.void
setItems(java.util.List<ItemModel> items)
Sets the items to be indexed in this batch.void
setPks(java.util.List<PK> pks)
Sets the pks to be indexed in this batch.
-
-
-
Method Detail
-
getIndexOperationId
long getIndexOperationId()
Returns the index operation id.- Returns:
- the index operation id
-
getIndexOperation
IndexOperation getIndexOperation()
Returns the index operation.- Returns:
- the index operation
-
isExternalIndexOperation
boolean isExternalIndexOperation()
Returnstrue
if the index operation is external. An external operation does not use a default indexer query.- Returns:
true
if the index operation is external,false
otherwise
-
getFacetSearchConfig
FacetSearchConfig getFacetSearchConfig()
Returns the facet search configuration.- Returns:
- the facet search configuration
-
getIndexedType
IndexedType getIndexedType()
Returns the indexed type.- Returns:
- the indexed type
-
getIndexedProperties
java.util.Collection<IndexedProperty> getIndexedProperties()
Returns the indexed properties to be indexed.- Returns:
- the indexed properties to be indexed
-
getPks
java.util.List<PK> getPks()
Return the pks to be indexed in this batch.- Returns:
- pks to be indexed in this batch.
-
setPks
void setPks(java.util.List<PK> pks)
Sets the pks to be indexed in this batch.- Parameters:
pks
- - the pks to be indexed in this batch.
-
getItems
java.util.List<ItemModel> getItems()
Returns the items to be indexed in this batch.- Returns:
- items to be indexed in this batch
-
setItems
void setItems(java.util.List<ItemModel> items)
Sets the items to be indexed in this batch.- Parameters:
items
- - the items to be indexed in this batch- Throws:
java.lang.IllegalStateException
- if this method is called and the status is notIndexerBatchContext.Status.CREATED
orIndexerBatchContext.Status.STARTING
-
getIndex
Index getIndex()
Returns the index to use during the indexer operation.- Returns:
- the index to use
-
setIndex
void setIndex(Index index)
Sets the index to use during the indexer operation.- Parameters:
index
- - the index to use
-
getIndexerHints
java.util.Map<java.lang.String,java.lang.String> getIndexerHints()
Returns a mutableMap
that can be used to store indexer hints.- Returns:
- the map containing the indexer hints
-
getAttributes
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns a mutableMap
that can be used to store attributes associated with thisIndexerBatchContext
.- Returns:
- the map containing the attributes
-
getInputDocuments
java.util.List<InputDocument> getInputDocuments()
Returns a mutableList
that can be used to store attributes associated with this input documents.- Returns:
- the map containing the indexed property values
-
getStatus
IndexerBatchContext.Status getStatus()
Returns the current status for thisIndexerBatchContext
- Returns:
- the current status
-
getFailureExceptions
java.util.List<java.lang.Exception> getFailureExceptions()
Returns all failure causing exceptions for thisIndexerBatchContext
.
-
-