Module org.elasticsearch.server
Class RolloverConditions
java.lang.Object
org.elasticsearch.action.admin.indices.rollover.RolloverConditions
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
Contains the conditions that determine if an index can be rolled over or not. It is used by the
RolloverRequest,
the Index Lifecycle Management and the Data Stream Lifecycle.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelps to build or create a mutation of rollover conditionsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ObjectParser<RolloverConditions.Builder, Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareConditionsMet(Map<String, Boolean> conditionResults) Given the results of evaluating each individual condition, determine whether the rollover request should proceed -- that is, whether the conditions are met.booleanstatic RolloverConditionsfromXContent(XContentParser parser) Returns the age an index can reach before rollover is triggered, if defined, or null otherwiseReturns the max count of documents an index can reach before rollover is triggered, if it is defined, or null otherwiseReturns the max count of documents a primary shard can reach before rollover is triggered, if it is defined, or null otherwiseReturns the size a primary shard can reach before rollover is triggered, if defined, or null otherwiseReturns the size an index can reach before rollover is triggered, if defined, or null otherwiseReturns the minimum age an index is required to have before rollover is allowed, if it is defined, or null otherwiseReturns the minimum document count an index is required to have before rollover is allowed, if it is defined, or null otherwiseReturns the minimum document count a primary shard is required to have before rollover is allowed, if it is defined, or null otherwiseReturns the minimum size a primary shard is required to have before rollover is allowed, if it is defined, or null otherwiseReturns the minimum size an index is required to have before rollover is allowed, if it is defined, or null otherwisebooleanReturns true if there is at least one condition of any typeinthashCode()booleanReturns true if there is at least one condition of type MAXbooleanReturns true if there is at least one condition of type MINstatic RolloverConditions.Builderstatic RolloverConditions.BuildernewBuilder(RolloverConditions conditions) toString()toXContent(XContentBuilder builder, ToXContent.Params params) toXContentFragment(XContentBuilder builder, ToXContent.Params params) This method adds the conditions as fields in an already existing object.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
PARSER
-
MAX_AGE_FIELD
-
MAX_DOCS_FIELD
-
MAX_SIZE_FIELD
-
MAX_PRIMARY_SHARD_SIZE_FIELD
-
MAX_PRIMARY_SHARD_DOCS_FIELD
-
MIN_AGE_FIELD
-
MIN_DOCS_FIELD
-
MIN_SIZE_FIELD
-
MIN_PRIMARY_SHARD_SIZE_FIELD
-
MIN_PRIMARY_SHARD_DOCS_FIELD
-
-
Constructor Details
-
RolloverConditions
public RolloverConditions() -
RolloverConditions
- Throws:
IOException
-
RolloverConditions
-
-
Method Details
-
hasMaxConditions
public boolean hasMaxConditions()Returns true if there is at least one condition of type MAX -
hasMinConditions
public boolean hasMinConditions()Returns true if there is at least one condition of type MIN -
hasConditions
public boolean hasConditions()Returns true if there is at least one condition of any type -
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getMaxSize
Returns the size an index can reach before rollover is triggered, if defined, or null otherwise -
getMaxPrimaryShardSize
Returns the size a primary shard can reach before rollover is triggered, if defined, or null otherwise -
getMaxAge
Returns the age an index can reach before rollover is triggered, if defined, or null otherwise -
getMaxDocs
Returns the max count of documents an index can reach before rollover is triggered, if it is defined, or null otherwise -
getMaxPrimaryShardDocs
Returns the max count of documents a primary shard can reach before rollover is triggered, if it is defined, or null otherwise -
getMinSize
Returns the minimum size an index is required to have before rollover is allowed, if it is defined, or null otherwise -
getMinPrimaryShardSize
Returns the minimum size a primary shard is required to have before rollover is allowed, if it is defined, or null otherwise -
getMinAge
Returns the minimum age an index is required to have before rollover is allowed, if it is defined, or null otherwise -
getMinDocs
Returns the minimum document count an index is required to have before rollover is allowed, if it is defined, or null otherwise -
getMinPrimaryShardDocs
Returns the minimum document count a primary shard is required to have before rollover is allowed, if it is defined, or null otherwise -
getConditions
-
areConditionsMet
Given the results of evaluating each individual condition, determine whether the rollover request should proceed -- that is, whether the conditions are met. If there are no conditions at all, then the request is unconditional (i.e. a command), and the conditions are met. If the request has conditions, then all min_* conditions and at least one max_* condition must have a true result.- Parameters:
conditionResults- a map of individual conditions and their associated evaluation results- Returns:
- where the conditions for rollover are satisfied or not
-
fromXContent
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toXContentFragment
public XContentBuilder toXContentFragment(XContentBuilder builder, ToXContent.Params params) throws IOException This method adds the conditions as fields in an already existing object.- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
newBuilder
-
newBuilder
-