Package org.apache.solr.common
Class ToleratedUpdateError
java.lang.Object
org.apache.solr.common.ToleratedUpdateError
Models the basic information related to a single "tolerated" error that occurred during updates.
This class is only useful when the
TolerantUpdateProcessorFactory is used in an
update processor chain-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHelper class for dealing with SolrException metadata (String) keys -
Constructor Summary
ConstructorsConstructorDescriptionToleratedUpdateError(ToleratedUpdateError.CmdType type, String id, String message) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic List<SimpleOrderedMap<String>> 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.getId()returns a string suitable for use as a key inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)returns a string suitable for use as a value inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)returns a map of simple objects suitable for putting in a SolrQueryResponse headergetType()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 convenience.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 nulltoString()
-
Constructor Details
-
ToleratedUpdateError
-
-
Method Details
-
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
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 convenience. Input ofmaxErrors < -1will trip an assertion and otherwise have undefined behavior.- See Also:
-
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- See Also:
-
parseMap
returns a ToleratedUpdateError instance from the data in this Map- See Also:
-
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:
-
getType
-
getId
-
getMessage
-
getMetadataKey
returns a string suitable for use as a key inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)- See Also:
-
getMetadataValue
returns a string suitable for use as a value inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)- See Also:
-
getSimpleMap
returns a map of simple objects suitable for putting in a SolrQueryResponse header- See Also:
-
toString
-
hashCode
public int hashCode() -
equals
-