Module org.elasticsearch.xcore
Class TransformCheckpoint
java.lang.Object
org.elasticsearch.xpack.core.transform.transforms.TransformCheckpoint
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public class TransformCheckpoint
extends Object
implements Writeable, org.elasticsearch.xcontent.ToXContentObject
Checkpoint document to store the checkpoint of a transform
The fields:
timestamp the timestamp when this document has been created
checkpoint the checkpoint number, incremented for every checkpoint, if -1 this is a non persisted checkpoint
indices a map of the indices from the source including all checkpoints of all indices matching the source pattern, shard level
time_upper_bound for time-based indices this holds the upper time boundary of this checkpoint
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.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 org.elasticsearch.xcontent.ParseFieldstatic final TransformCheckpointstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldstatic final StringFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTransformCheckpoint(String transformId, long timestamp, long checkpoint, Map<String, long[]> checkpoints, Long timeUpperBound) -
Method Summary
Modifier and TypeMethodDescriptionstatic TransformCheckpointcreateEmpty(long timestampMillis) static StringdocumentId(String transformId, long checkpoint) booleanstatic TransformCheckpointfromXContent(org.elasticsearch.xcontent.XContentParser parser, boolean lenient) static longgetBehind(TransformCheckpoint oldCheckpoint, TransformCheckpoint newCheckpoint) Calculate the diff of 2 checkpoints This is to get an indicator for the difference between checkpoints.static Collection<String> getChangedIndices(TransformCheckpoint oldCheckpoint, TransformCheckpoint newCheckpoint) longlonglonginthashCode()booleanisEmpty()static booleanisNullOrEmpty(TransformCheckpoint checkpoint) booleanWhether this checkpoint is a transient (non persisted) checkpointbooleanmatches(TransformCheckpoint that) Compares 2 checkpoints ignoring some inner fields.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) Create XContent for the purpose of storing it in the internal index Note:voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
EMPTY_NAME
- See Also:
-
EMPTY
-
CHECKPOINT
public static final org.elasticsearch.xcontent.ParseField CHECKPOINT -
INDICES
public static final org.elasticsearch.xcontent.ParseField INDICES -
NAME
- See Also:
-
-
Constructor Details
-
TransformCheckpoint
-
TransformCheckpoint
- Throws:
IOException
-
-
Method Details
-
createEmpty
-
isEmpty
public boolean isEmpty() -
isTransient
public boolean isTransient()Whether this checkpoint is a transient (non persisted) checkpoint- Returns:
- true if this is a transient checkpoint, false otherwise
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException Create XContent for the purpose of storing it in the internal index Note:- Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Parameters:
builder- theXContentBuilderparams- builder specific parameters- Returns:
- builder instance
- Throws:
IOException
-
getTransformId
-
getTimestamp
public long getTimestamp() -
getCheckpoint
public long getCheckpoint() -
getIndicesCheckpoints
-
getTimeUpperBound
public long getTimeUpperBound() -
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
equals
-
matches
Compares 2 checkpoints ignoring some inner fields. This is for comparing 2 checkpoints to check whether the transform requires an update- Parameters:
that- other checkpoint- Returns:
- true if checkpoints match
-
hashCode
public int hashCode() -
fromXContent
public static TransformCheckpoint fromXContent(org.elasticsearch.xcontent.XContentParser parser, boolean lenient) throws IOException - Throws:
IOException
-
documentId
-
isNullOrEmpty
-
getBehind
Calculate the diff of 2 checkpoints This is to get an indicator for the difference between checkpoints. Note: order is important- Parameters:
oldCheckpoint- the older checkpoint, if transient, newer must be transient, toonewCheckpoint- the newer checkpoint, can be a transient checkpoint- Returns:
- count number of operations the checkpoint is behind or -1L if it could not calculate the difference
-
getChangedIndices
public static Collection<String> getChangedIndices(TransformCheckpoint oldCheckpoint, TransformCheckpoint newCheckpoint)
-