Package org.apache.solr.analytics.facet
Class AnalyticsFacet
- java.lang.Object
-
- org.apache.solr.analytics.facet.AnalyticsFacet
-
- Direct Known Subclasses:
AbstractSolrQueryFacet
,PivotFacet
,SortableFacet
public abstract class AnalyticsFacet extends Object
An abstract Facet to break up Analytics data over.
-
-
Field Summary
Fields Modifier and Type Field Description protected ReductionCollectionManager
collectionManager
protected ExpressionCalculator
expressionCalculator
protected String
name
protected Map<String,ReductionCollectionManager.ReductionDataCollection>
reductionData
-
Constructor Summary
Constructors Constructor Description AnalyticsFacet(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.common.util.NamedList<Object>
createOldResponse()
Create the old olap-style response of the facet to be returned in the overall analytics response.Iterable<Map<String,Object>>
createResponse()
Create the response of the facet to be returned in the overall analytics response.protected void
exportFacetValue(DataOutput output, String facetValue)
Export the next facet value's set ofReductionData
.void
exportShardData(DataOutput output)
Export the shard data through a bit-stream, to be imported by theimportShardData(java.io.DataInput)
method in the originating shard.String
getName()
Get the name of the Facet.protected void
importFacetValue(DataInput input, String facetValue)
Import the next facet value's set ofReductionData
.void
importShardData(DataInput input)
Import the shard data from a bit-stream, exported by theexportShardData(java.io.DataOutput)
method in the each of the collection's shards.void
setExpressionCalculator(ExpressionCalculator expressionCalculator)
Set theExpressionCalculator
that calculates the collection of the expressions requested for this facet.void
setReductionCollectionManager(ReductionCollectionManager collectionManager)
Set theReductionCollectionManager
that manages the collection of the expressions calculated with this facet.
-
-
-
Field Detail
-
reductionData
protected final Map<String,ReductionCollectionManager.ReductionDataCollection> reductionData
-
collectionManager
protected ReductionCollectionManager collectionManager
-
expressionCalculator
protected ExpressionCalculator expressionCalculator
-
name
protected final String name
-
-
Constructor Detail
-
AnalyticsFacet
public AnalyticsFacet(String name)
-
-
Method Detail
-
setReductionCollectionManager
public void setReductionCollectionManager(ReductionCollectionManager collectionManager)
Set theReductionCollectionManager
that manages the collection of the expressions calculated with this facet.- Parameters:
collectionManager
- The manager for relevant expressions
-
setExpressionCalculator
public void setExpressionCalculator(ExpressionCalculator expressionCalculator)
Set theExpressionCalculator
that calculates the collection of the expressions requested for this facet.- Parameters:
expressionCalculator
- The calculator for relevant expressions
-
importShardData
public void importShardData(DataInput input) throws IOException
Import the shard data from a bit-stream, exported by theexportShardData(java.io.DataOutput)
method in the each of the collection's shards.- Parameters:
input
- The bit-stream to import the data from- Throws:
IOException
- if an exception occurs while reading from theDataInput
-
importFacetValue
protected void importFacetValue(DataInput input, String facetValue) throws IOException
Import the next facet value's set ofReductionData
.- Parameters:
input
- the bit-stream to import the reduction data fromfacetValue
- the next facet value- Throws:
IOException
- if an exception occurs while reading from the input
-
exportShardData
public void exportShardData(DataOutput output) throws IOException
Export the shard data through a bit-stream, to be imported by theimportShardData(java.io.DataInput)
method in the originating shard.- Parameters:
output
- The bit-stream to output the data through- Throws:
IOException
- if an exception occurs while writing to theDataOutput
-
exportFacetValue
protected void exportFacetValue(DataOutput output, String facetValue) throws IOException
Export the next facet value's set ofReductionData
.- Parameters:
output
- the bit-stream to output the reduction data tofacetValue
- the next facet value- Throws:
IOException
- if an exception occurs while reading from the input
-
createOldResponse
public org.apache.solr.common.util.NamedList<Object> createOldResponse()
Create the old olap-style response of the facet to be returned in the overall analytics response.- Returns:
- the response of the facet
-
createResponse
public Iterable<Map<String,Object>> createResponse()
Create the response of the facet to be returned in the overall analytics response.- Returns:
- the response of the facet
-
getName
public String getName()
Get the name of the Facet. This is unique for the grouping.- Returns:
- The name of the Facet
-
-