Package org.apache.solr.common
Class ToleratedUpdateError
- java.lang.Object
-
- org.apache.solr.common.ToleratedUpdateError
-
public final class ToleratedUpdateError extends Object
Models the basic information related to a single "tolerated" error that occurred during updates. This class is only useful when theTolerantUpdateProcessorFactoryis used in an update processor chain
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classToleratedUpdateError.CmdTypeHelper class for dealing with SolrException metadata (String) keys
-
Constructor Summary
Constructors Constructor Description ToleratedUpdateError(ToleratedUpdateError.CmdType type, String id, String message)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static List<SimpleOrderedMap<String>>formatForResponseHeader(List<ToleratedUpdateError> errs)returns a list of maps of simple objects suitable for putting in a SolrQueryResponse headerstatic intgetEffectiveMaxErrors(int maxErrors)Given a 'maxErrors' value such that-1 <= maxErrors <=this method returns the original input unless it isInteger.MAX_VALUE-1in which case the effective value ofInteger.MAX_VALUEis returned.StringgetId()StringgetMessage()StringgetMetadataKey()returns a string suitable for use as a key inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)StringgetMetadataValue()returns a string suitable for use as a value inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)SimpleOrderedMap<String>getSimpleMap()returns a map of simple objects suitable for putting in a SolrQueryResponse headerToleratedUpdateError.CmdTypegetType()static intgetUserFriendlyMaxErrors(int maxErrors)Given a 'maxErrors' value such that-1 <= maxErrors <=this method returns the original input unless it isInteger.MAX_VALUEInteger.MAX_VALUEin which case-1is returned for user convinience.inthashCode()static ToleratedUpdateErrorparseMap(SimpleOrderedMap<String> data)returns a ToleratedUpdateError instance from the data in this Mapstatic ToleratedUpdateErrorparseMetadataIfToleratedUpdateError(String metadataKey, String metadataVal)returns a ToleratedUpdateError instance if this metadataKey is one we care about, else nullStringtoString()
-
-
-
Constructor Detail
-
ToleratedUpdateError
public ToleratedUpdateError(ToleratedUpdateError.CmdType type, String id, String message)
-
-
Method Detail
-
getEffectiveMaxErrors
public static int getEffectiveMaxErrors(int maxErrors)
Given a 'maxErrors' value such that-1 <= maxErrors <=this method returns the original input unless it isInteger.MAX_VALUE-1in which case the effective value ofInteger.MAX_VALUEis returned. Input ofmaxErrors < -1will trip an assertion and otherwise have undefined behavior.- See Also:
getUserFriendlyMaxErrors(int)
-
getUserFriendlyMaxErrors
public static int getUserFriendlyMaxErrors(int maxErrors)
Given a 'maxErrors' value such that-1 <= maxErrors <=this method returns the original input unless it isInteger.MAX_VALUEInteger.MAX_VALUEin which case-1is returned for user convinience. Input ofmaxErrors < -1will trip an assertion and otherwise have undefined behavior.- See Also:
getEffectiveMaxErrors(int)
-
formatForResponseHeader
public static List<SimpleOrderedMap<String>> formatForResponseHeader(List<ToleratedUpdateError> errs)
returns a list of maps of simple objects suitable for putting in a SolrQueryResponse header
-
parseMap
public static ToleratedUpdateError parseMap(SimpleOrderedMap<String> data)
returns a ToleratedUpdateError instance from the data in this Map- See Also:
getSimpleMap()
-
parseMetadataIfToleratedUpdateError
public static ToleratedUpdateError parseMetadataIfToleratedUpdateError(String metadataKey, String metadataVal)
returns a ToleratedUpdateError instance if this metadataKey is one we care about, else null- See Also:
getMetadataKey(),getMetadataValue()
-
getType
public ToleratedUpdateError.CmdType getType()
-
getId
public String getId()
-
getMessage
public String getMessage()
-
getMetadataKey
public String getMetadataKey()
returns a string suitable for use as a key inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)
-
getMetadataValue
public String getMetadataValue()
returns a string suitable for use as a value inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)
-
getSimpleMap
public SimpleOrderedMap<String> getSimpleMap()
returns a map of simple objects suitable for putting in a SolrQueryResponse header
-
-