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 theTolerantUpdateProcessorFactory
is used in an update processor chain
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ToleratedUpdateError.CmdType
Helper 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 boolean
equals(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 int
getEffectiveMaxErrors(int maxErrors)
Given a 'maxErrors' value such that-1 <= maxErrors <=
this method returns the original input unless it isInteger.MAX_VALUE
-1
in which case the effective value ofInteger.MAX_VALUE
is returned.String
getId()
String
getMessage()
String
getMetadataKey()
returns a string suitable for use as a key inSolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)
String
getMetadataValue()
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.CmdType
getType()
static int
getUserFriendlyMaxErrors(int maxErrors)
Given a 'maxErrors' value such that-1 <= maxErrors <=
this method returns the original input unless it isInteger.MAX_VALUE
Integer.MAX_VALUE
in which case-1
is returned for user convinience.int
hashCode()
static ToleratedUpdateError
parseMap(SimpleOrderedMap<String> data)
returns a ToleratedUpdateError instance from the data in this Mapstatic ToleratedUpdateError
parseMetadataIfToleratedUpdateError(String metadataKey, String metadataVal)
returns a ToleratedUpdateError instance if this metadataKey is one we care about, else nullString
toString()
-
-
-
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
-1
in which case the effective value ofInteger.MAX_VALUE
is returned. Input ofmaxErrors < -1
will 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_VALUE
Integer.MAX_VALUE
in which case-1
is returned for user convinience. Input ofmaxErrors < -1
will 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
-
-